UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23: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 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 user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:04:44";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:34:44", deviceType = "DESKTOP" WHERE userid = -1;
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-21',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 23:04:44";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 02:34:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:04:50";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:34:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:04:53";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:34:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:04:53";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:34:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:05:04";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:35:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:05:21";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:35:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 23:05:28";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 02:35:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 01:14:54";
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-21 04:33:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:03:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:03:06', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15967
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-21 04:33:06";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 08:03:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:03:06', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15968
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 04:33:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:03:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 08:03:09', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15969
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 04:33:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:03:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 08:03:11', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15970
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 04:35:17";
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-21 04:37:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:07:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:07:29', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15971
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-21 04:37:29";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 08:07:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:07:29', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15972
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:19:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:49:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:49:12', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15973
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-21 05:19:12";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 08:49:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:49:12', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15974
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:19:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:49:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:49:13', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15975
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-21 05:19:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 08:49:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:49:13', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15976
UPDATE user SET loginip = "" WHERE userid = 4;
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-21 05:19:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:49:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:49:26', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15977
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-21 05:19:26";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 08:49:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:49:26', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15978
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:20:04";
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-21 05:29:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 08:59:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 08:59:03', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15979
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-21 05:29:03";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 08:59:03', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15980
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:30:23";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:30:23";
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-21 05:30:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:00:26", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 09:00:26', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15981
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-21 05:30:27";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 09:00:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 09:00:27', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15982
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:31:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:01:43", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 09:01:43', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15983
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-21 05:33:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:03:33", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 09:03:33', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15984
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-21 05:33:33";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 09:03:33', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15985
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-21 05:33:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:03:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 09:03:46', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15986
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-21 05:33:46";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 09:03:46', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15987
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:46:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:16:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 09:16:39', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15988
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 05:46:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:16:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:16:46', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15989
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-21 06:01:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:31:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 09:31:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15990
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-21 06:01:46";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 09:31:46', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15991
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:04:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:34:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 09:34:46', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15992
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:05:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:35:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 09:35:33', '7', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15993
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-21','','90', '7','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=203
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (203, 1,'2026-10-21 09:35:33',7)
                ON DUPLICATE KEY UPDATE catid = 203, edited = 1, sysdate = '2026-10-21 09:35:33', userid = 7; -- id=218
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '203', '1', '2026-10-21', '7', '0'); -- id=95
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:05:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:35:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 09:35:33', '7', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15994
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:05:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:35:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 09:35:35', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15995
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:05:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:35:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:35:43', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15996
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:08:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:38:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 09:38:52', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15997
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:09:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:39:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:39:02', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15998
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:09:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:39:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:39:05', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15999
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:09:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:39:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:39:16', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16000
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:11:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:41:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:41:55', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16001
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:12:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:42:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:42:32', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16002
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 ('موديلات 390 زد و هارلي','','179','390','390','0','0','2026-10-21','0','1','0','','0','0','0','0','0','390','390','390','390','390','0','0','0','0','.','0','0','0','390','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','390','390','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','390','0','0','0','0','0','0','','','0','0','0','0'); -- id=2290
UPDATE product SET productName = 'موديلات 390 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '390', productSellAllPrice = '390', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02290',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '390',meanbuyprice = '390',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',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='390',meanbuyprice_withTax='390',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='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2290';
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', '2290', '1.00', '2026-10-21', '1', '0','0229001','390','0','0','390','','0','0','0','0','0','0','0','0','0','0'); -- id=2290
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2290', '1', '0', '1', '2026-10-21'); -- id=3683
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '0', '0', '2290', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15495
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2290, 1,'2026-10-21 09:42:32',1)
                ON DUPLICATE KEY UPDATE productid = 2290, edited = 1, sysdate = '2026-10-21 09:42:32', userid = 1; -- id=3367
UPDATE product SET productName = 'موديلات 390 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02290',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '390',meanbuyprice = '390',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',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='390',meanbuyprice_withTax='390',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='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2290';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:12:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:42:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:42:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16003
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:12:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:42:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 09:42:35', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16004
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:15:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:45:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 09:45:28', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16005
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 ('06ad85edbc9a1c', '2026-10-21 09:42:35', '138', '71451.20', '114176', '8', '1', '46440.00',  '42724.80', '0', '42724.8', '1', '2026-10-21 09:45:28', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=275
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 ('02106', '275', '179', '2106', '18', '490', '8820.00', '0', '', '2026-10-21 09:45:28', '2106','','','0','0','0','0','0',null,'490','8820','0','0','0','0','0','0','0','0','1'); -- id=1524
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2106, 0, 0
                    , 450.8, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6793
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2106', '490', '18', '0', 'buyBillController.php', '1524', '', '0', '0'); -- id=1120
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2106 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1524 ;
UPDATE product SET productName = 'موديلات 490 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02106',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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.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 = '2106';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1524;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2106;
UPDATE storedetail SET  productquantity = '78', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3465';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2106', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '78', '1', '2026-10-21 09:42:35','0','0'); -- id=15496
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 ('02290', '275', '179', '2290', '18', '390', '7020.00', '0', '', '2026-10-21 09:45:28', '2290','','','0','0','0','0','0',null,'390','7020','0','0','0','0','0','0','0','0','1'); -- id=1525
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2290, 0, 0
                    , 358.8, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 358.8,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6794
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2290', '390', '18', '0', 'buyBillController.php', '1525', '', '0', '0'); -- id=1121
UPDATE product SET  productBuyPrice = "390" WHERE productId = 2290 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1525 ;
UPDATE product SET productName = 'موديلات 390 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02290',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '358.8',meanbuyprice = '390',meanbuyprice_withDiscount = '358.8' , productbuypricereal = '390.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='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='358.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 = '2290';
UPDATE buybilldetail SET  lastbuyprice = 390 , meanbuyprice = 390, lastbuyprice_withDiscount = 358.8, meanbuyprice_withDiscount = 358.8
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 358.8
                where buybilldetailid = 1525;
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 2290;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '18', '1', '2026-10-21 09:42:35','0','0'); -- id=15497
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 ('02104', '275', '179', '2104', '18', '360', '6480.00', '0', '', '2026-10-21 09:45:28', '2104','','','0','0','0','0','0',null,'360','6480','0','0','0','0','0','0','0','0','1'); -- id=1526
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2104, 0, 0
                    , 331.2, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 331.2,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6795
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2104', '360', '18', '0', 'buyBillController.php', '1526', '', '0', '0'); -- id=1122
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2104 ;
UPDATE buybilldetail SET  quantitybefore = 99 WHERE buybilldetailid = 1526 ;
UPDATE product SET productName = 'موديلات 360 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02104',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='331.2',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2104';
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 = 1526;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2104;
UPDATE storedetail SET  productquantity = '117', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3463';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2104', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '99', '117', '1', '2026-10-21 09:42:35','0','0'); -- id=15498
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 ('02106', '275', '179', '2106', '18', '490', '8820.00', '0', '', '2026-10-21 09:45:28', '2106','','','0','0','0','0','0',null,'490','8820','0','0','0','0','0','0','0','0','1'); -- id=1527
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2106, 0, 0
                    , 450.8, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6793
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2106', '490', '18', '0', 'buyBillController.php', '1527', '', '0', '0'); -- id=1123
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2106 ;
UPDATE buybilldetail SET  quantitybefore = 78 WHERE buybilldetailid = 1527 ;
UPDATE product SET productName = 'موديلات 490 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02106',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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.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 = '2106';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1527;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2106;
UPDATE storedetail SET  productquantity = '96', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3465';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2106', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '78', '96', '1', '2026-10-21 09:42:35','0','0'); -- id=15499
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 ('02105', '275', '179', '2105', '18', '460', '8280.00', '0', '', '2026-10-21 09:45:28', '2105','','','0','0','0','0','0',null,'460','8280','0','0','0','0','0','0','0','0','1'); -- id=1528
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2105, 0, 0
                    , 423.2, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 423.2,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6797
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2105', '460', '18', '0', 'buyBillController.php', '1528', '', '0', '0'); -- id=1124
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2105 ;
UPDATE buybilldetail SET  quantitybefore = 99 WHERE buybilldetailid = 1528 ;
UPDATE product SET productName = 'موديلات 460 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02105',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '423.2',meanbuyprice = '460',meanbuyprice_withDiscount = '423.2' , productbuypricereal = '460.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='423.2',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='423.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 = '2105';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 423.2, meanbuyprice_withDiscount = 423.2
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where buybilldetailid = 1528;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2105;
UPDATE storedetail SET  productquantity = '117', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3464';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2105', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '99', '117', '1', '2026-10-21 09:42:35','0','0'); -- id=15500
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 ('02290', '275', '179', '2290', '18', '390', '7020.00', '0', '', '2026-10-21 09:45:28', '2290','','','0','0','0','0','0',null,'390','7020','0','0','0','0','0','0','0','0','1'); -- id=1529
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 09:42:35', 1, 2290, 0, 0
                    , 358.8, 18, 0, 0, 1, '2026-10-21 09:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 358.8,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 09:45:28' ; -- id=6794
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2290', '390', '18', '0', 'buyBillController.php', '1529', '', '0', '0'); -- id=1125
UPDATE product SET  productBuyPrice = "390" WHERE productId = 2290 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 1529 ;
UPDATE product SET productName = 'موديلات 390 زد و هارلي', productDescription = '', productCatId = '179', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02290',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '358.8',meanbuyprice = '390',meanbuyprice_withDiscount = '358.8' , productbuypricereal = '390.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='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='358.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 = '2290';
UPDATE buybilldetail SET  lastbuyprice = 390 , meanbuyprice = 390, lastbuyprice_withDiscount = 358.8, meanbuyprice_withDiscount = 358.8
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 358.8
                where buybilldetailid = 1529;
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 2290;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '18', '0', '275', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '36', '1', '2026-10-21 09:42:35','0','0'); -- id=15501
UPDATE supplier SET  suppliercurrentDebt = '114176',suppliercurrentDebtInCurrency= '114176' , userid = '1', supplierdate = '2026-10-21 09:45:28'   WHERE supplierid = '138';
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 ('138', '71451.20', '42724.8', '0', 'اضافة فاتورة مشتريات', '275', '114176', '2026-10-21 09:42:35', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','42724.8','1','71451.2','42724.8','114176','0',''); -- id=782
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '42724.8', '42724.8', '2026-10-21', '1', '0', '0', '2026-10-21 09:45:28','اضافة فاتورة مشتريات رقم 275','1','0',null,'0','275','buyBillController.php?do=details&id=275'); -- id=4040
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4040', '382', '42724.8', '','0'); -- id=4146
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24450921.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 ('4040', '621', '42724.8', '','0'); -- id=4042
UPDATE accountstree SET name = 'زد و هارلي', customName = 'زد و هارلي', customNameEn = 'زد و هارلي', nameEn = 'زد و هارلي', parent = '81', accountNature = '1', theValue = '114176', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:10:45' WHERE id = '621';
update buybill set dailyentryid='4040,0' where buybillid=275;
COMMIT;
UPDATE product SET overAllAveragePrice = 331.2 WHERE productId = 2104;UPDATE product SET overAllAveragePrice = 423.2 WHERE productId = 2105;UPDATE product SET overAllAveragePrice = 450.8 WHERE productId = 2106;UPDATE product SET overAllAveragePrice = 358.8 WHERE productId = 2290;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:15:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:45:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 09:45:28', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=275'); -- id=16006
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:15:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 09:45:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 09:45:36', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=275&type=2'); -- id=16007
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:34:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:04:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:04:28', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16008
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 ('موديلات 450 دريم كونز','','203','420','450','0','0','2026-10-21','0','7','0','','0','0','0','0','0','420','420','420','420','420','0','7.14','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','0','0','0','0','0','-1','0','','420','0','0','0','0','0','0','','','0','0','0','0'); -- id=2291
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420', productSellAllPrice = '450', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
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', '2291', '1.00', '2026-10-21', '7', '0','0229101','450','0','0','420','','0','0','0','0','0','0','0','0','0','0'); -- id=2291
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2291', '1', '0', '7', '2026-10-21'); -- id=3684
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '0', '0', '2291', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15502
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2291, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2291, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3368
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
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 ('جاكت سويد 7252 دريم كونز','','203','775','825','0','0','2026-10-21','0','7','0','','0','0','0','0','0','775','775','775','775','775','0','6.45','0','0','.','0','0','0','775','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','775','775','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','775','0','0','0','0','0','0','','','0','0','0','0'); -- id=2292
UPDATE product SET productName = 'جاكت سويد 7252 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '775', productSellAllPrice = '825', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02292',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '775',lastbuyprice_withDiscount = '775',meanbuyprice = '775',meanbuyprice_withDiscount = '775' , productbuypricereal = '775' , buypricereal_precentage = '0' , buytotal_precentage = '6.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='775',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='775',meanbuyprice_withTax='775',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='775',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2292';
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', '2292', '1.00', '2026-10-21', '7', '0','0229201','825','0','0','775','','0','0','0','0','0','0','0','0','0','0'); -- id=2292
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2292', '1', '0', '7', '2026-10-21'); -- id=3685
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2292', '1', '0', '0', '2292', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15503
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2292, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2292, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3369
UPDATE product SET productName = 'جاكت سويد 7252 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '775.00', productSellAllPrice = '825.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02292',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '775',lastbuyprice_withDiscount = '775',meanbuyprice = '775',meanbuyprice_withDiscount = '775' , productbuypricereal = '775' , buypricereal_precentage = '0' , buytotal_precentage = '6.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='775',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='775',meanbuyprice_withTax='775',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='775',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2292';
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 ('جاكت سويد 7254 دريم كونز','','203','660','710','0','0','2026-10-21','0','7','0','','0','0','0','0','0','660','660','660','660','660','0','7.58','0','0','.','0','0','0','660','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','660','660','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','660','0','0','0','0','0','0','','','0','0','0','0'); -- id=2293
UPDATE product SET productName = 'جاكت سويد 7254 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660', productSellAllPrice = '710', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02293',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660' , buypricereal_precentage = '0' , buytotal_precentage = '7.58' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2293';
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', '2293', '1.00', '2026-10-21', '7', '0','0229301','710','0','0','660','','0','0','0','0','0','0','0','0','0','0'); -- id=2293
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2293', '1', '0', '7', '2026-10-21'); -- id=3686
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2293', '1', '0', '0', '2293', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15504
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2293, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2293, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3370
UPDATE product SET productName = 'جاكت سويد 7254 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660.00', productSellAllPrice = '710.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02293',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660' , buypricereal_precentage = '0' , buytotal_precentage = '7.58' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2293';
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 ('جلد مموه 7259 دريم كونز','','203','825','875','0','0','2026-10-21','0','7','0','','0','0','0','0','0','825','825','825','825','825','0','6.06','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=2294
UPDATE product SET productName = 'جلد مموه 7259 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '825', productSellAllPrice = '875', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02294',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 = '6.06' , 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 = '2294';
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', '2294', '1.00', '2026-10-21', '7', '0','0229401','875','0','0','825','','0','0','0','0','0','0','0','0','0','0'); -- id=2294
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2294', '1', '0', '7', '2026-10-21'); -- id=3687
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2294', '1', '0', '0', '2294', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15505
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2294, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2294, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3371
UPDATE product SET productName = 'جلد مموه 7259 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '825.00', productSellAllPrice = '875.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02294',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 = '6.06' , 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 = '2294';
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 ('جاكت سويد 7261 دريم كونز','','203','630','680','0','0','2026-10-21','0','7','0','','0','0','0','0','0','630','630','630','630','630','0','7.94','0','0','.','0','0','0','630','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','630','630','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','630','0','0','0','0','0','0','','','0','0','0','0'); -- id=2295
UPDATE product SET productName = 'جاكت سويد 7261 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '630', productSellAllPrice = '680', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02295',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '7.94' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',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='630',meanbuyprice_withTax='630',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2295';
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', '2295', '1.00', '2026-10-21', '7', '0','0229501','680','0','0','630','','0','0','0','0','0','0','0','0','0','0'); -- id=2295
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2295', '1', '0', '7', '2026-10-21'); -- id=3688
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2295', '1', '0', '0', '2295', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15506
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2295, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2295, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3372
UPDATE product SET productName = 'جاكت سويد 7261 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '630.00', productSellAllPrice = '680.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02295',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '7.94' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',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='630',meanbuyprice_withTax='630',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2295';
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 ('سويت شيرت ميلتون 7266 دريم كونز','','203','560','595','0','0','2026-10-21','0','7','0','','0','0','0','0','0','560','560','560','560','560','0','6.25','0','0','.','0','0','0','560','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','560','560','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','560','0','0','0','0','0','0','','','0','0','0','0'); -- id=2296
UPDATE product SET productName = 'سويت شيرت ميلتون 7266 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '560', productSellAllPrice = '595', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02296',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '6.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2296';
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', '2296', '1.00', '2026-10-21', '7', '0','0229601','595','0','0','560','','0','0','0','0','0','0','0','0','0','0'); -- id=2296
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2296', '1', '0', '7', '2026-10-21'); -- id=3689
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2296', '1', '0', '0', '2296', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15507
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2296, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2296, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3373
UPDATE product SET productName = 'سويت شيرت ميلتون 7266 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '560.00', productSellAllPrice = '595.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02296',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '6.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2296';
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 ('هودي بزنط 7277 دريم كونز','','203','405','440','0','0','2026-10-21','0','7','0','','0','0','0','0','0','405','405','405','405','405','0','8.64','0','0','.','0','0','0','405','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','405','405','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','405','0','0','0','0','0','0','','','0','0','0','0'); -- id=2297
UPDATE product SET productName = 'هودي بزنط 7277 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405', productSellAllPrice = '440', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02297',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '405' , buypricereal_precentage = '0' , buytotal_precentage = '8.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='405',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='405',meanbuyprice_withTax='405',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2297';
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', '2297', '1.00', '2026-10-21', '7', '0','0229701','440','0','0','405','','0','0','0','0','0','0','0','0','0','0'); -- id=2297
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2297', '1', '0', '7', '2026-10-21'); -- id=3690
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2297', '1', '0', '0', '2297', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15508
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2297, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2297, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3374
UPDATE product SET productName = 'هودي بزنط 7277 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02297',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '405' , buypricereal_precentage = '0' , buytotal_precentage = '8.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='405',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='405',meanbuyprice_withTax='405',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2297';
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 ('هودي ميلتون 7279 دريم كونز','','203','405','435','0','0','2026-10-21','0','7','0','','0','0','0','0','0','405','405','405','405','405','0','7.41','0','0','.','0','0','0','405','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','405','405','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','405','0','0','0','0','0','0','','','0','0','0','0'); -- id=2298
UPDATE product SET productName = 'هودي ميلتون 7279 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405', productSellAllPrice = '435', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02298',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '405' , buypricereal_precentage = '0' , buytotal_precentage = '7.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='405',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='405',meanbuyprice_withTax='405',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2298';
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', '2298', '1.00', '2026-10-21', '7', '0','0229801','435','0','0','405','','0','0','0','0','0','0','0','0','0','0'); -- id=2298
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2298', '1', '0', '7', '2026-10-21'); -- id=3691
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2298', '1', '0', '0', '2298', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15509
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2298, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2298, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3375
UPDATE product SET productName = 'هودي ميلتون 7279 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405.00', productSellAllPrice = '435.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02298',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '405' , buypricereal_precentage = '0' , buytotal_precentage = '7.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='405',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='405',meanbuyprice_withTax='405',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2298';
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 ('تيشرت ياقة 7284 دريم كونز','','203','420','455','0','0','2026-10-21','0','7','0','','0','0','0','0','0','420','420','420','420','420','0','8.33','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=2299
UPDATE product SET productName = 'تيشرت ياقة 7284 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420', productSellAllPrice = '455', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02299',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 = '8.33' , 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 = '2299';
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', '2299', '1.00', '2026-10-21', '7', '0','0229901','455','0','0','420','','0','0','0','0','0','0','0','0','0','0'); -- id=2299
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2299', '1', '0', '7', '2026-10-21'); -- id=3692
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2299', '1', '0', '0', '2299', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15510
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2299, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2299, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3376
UPDATE product SET productName = 'تيشرت ياقة 7284 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02299',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 = '8.33' , 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 = '2299';
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 ('موديل 495 دريم كونز','','203','460','495','0','0','2026-10-21','0','7','0','','0','0','0','0','0','460','460','460','460','460','0','7.61','0','0','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=2300
UPDATE product SET productName = 'موديل 495 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '460', productSellAllPrice = '495', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02300',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '7.61' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2300';
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', '2300', '1.00', '2026-10-21', '7', '0','0230001','495','0','0','460','','0','0','0','0','0','0','0','0','0','0'); -- id=2300
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2300', '1', '0', '7', '2026-10-21'); -- id=3693
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2300', '1', '0', '0', '2300', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15511
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2300, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2300, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3377
UPDATE product SET productName = 'موديل 495 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '460.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02300',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '7.61' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2300';
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 ('هودي بزنط 7290 دريم كونز','','203','435','460','0','0','2026-10-21','0','7','0','','0','0','0','0','0','435','435','435','435','435','0','5.75','0','0','.','0','0','0','435','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','435','435','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','435','0','0','0','0','0','0','','','0','0','0','0'); -- id=2301
UPDATE product SET productName = 'هودي بزنط 7290 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '435', productSellAllPrice = '460', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02301',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435' , buypricereal_precentage = '0' , buytotal_precentage = '5.75' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2301';
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', '2301', '1.00', '2026-10-21', '7', '0','0230101','460','0','0','435','','0','0','0','0','0','0','0','0','0','0'); -- id=2301
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2301', '1', '0', '7', '2026-10-21'); -- id=3694
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2301', '1', '0', '0', '2301', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15512
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2301, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2301, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3378
UPDATE product SET productName = 'هودي بزنط 7290 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '435.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02301',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435' , buypricereal_precentage = '0' , buytotal_precentage = '5.75' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2301';
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 ('هودي بزنط 7291 دريم كونز','','203','525','560','0','0','2026-10-21','0','7','0','','0','0','0','0','0','525','525','525','525','525','0','6.67','0','0','.','0','0','0','525','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','525','525','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','525','0','0','0','0','0','0','','','0','0','0','0'); -- id=2302
UPDATE product SET productName = 'هودي بزنط 7291 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '525', productSellAllPrice = '560', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02302',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='525',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='525',meanbuyprice_withTax='525',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='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 = '2302';
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', '2302', '1.00', '2026-10-21', '7', '0','0230201','560','0','0','525','','0','0','0','0','0','0','0','0','0','0'); -- id=2302
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2302', '1', '0', '7', '2026-10-21'); -- id=3695
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2302', '1', '0', '0', '2302', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15513
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2302, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2302, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3379
UPDATE product SET productName = 'هودي بزنط 7291 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '525.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02302',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='525',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='525',meanbuyprice_withTax='525',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='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 = '2302';
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 ('هودي  بزنط 7293 دريم كونز','','203','430','460','0','0','2026-10-21','0','7','0','','0','0','0','0','0','430','430','430','430','430','0','6.98','0','0','.','0','0','0','430','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','430','430','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','430','0','0','0','0','0','0','','','0','0','0','0'); -- id=2303
UPDATE product SET productName = 'هودي  بزنط 7293 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '430', productSellAllPrice = '460', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02303',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '6.98' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',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='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2303';
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', '2303', '1.00', '2026-10-21', '7', '0','0230301','460','0','0','430','','0','0','0','0','0','0','0','0','0','0'); -- id=2303
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2303', '1', '0', '7', '2026-10-21'); -- id=3696
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2303', '1', '0', '0', '2303', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15514
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2303, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2303, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3380
UPDATE product SET productName = 'هودي  بزنط 7293 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '430.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02303',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '6.98' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',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='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2303';
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 ('سويت شيرت 7300 دريم كونز','','203','515','550','0','0','2026-10-21','0','7','0','','0','0','0','0','0','515','515','515','515','515','0','6.8','0','0','.','0','0','0','515','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','515','515','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','515','0','0','0','0','0','0','','','0','0','0','0'); -- id=2304
UPDATE product SET productName = 'سويت شيرت 7300 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '515', productSellAllPrice = '550', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02304',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '6.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2304';
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', '2304', '1.00', '2026-10-21', '7', '0','0230401','550','0','0','515','','0','0','0','0','0','0','0','0','0','0'); -- id=2304
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2304', '1', '0', '7', '2026-10-21'); -- id=3697
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2304', '1', '0', '0', '2304', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15515
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2304, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2304, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3381
UPDATE product SET productName = 'سويت شيرت 7300 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '515.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02304',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '6.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2304';
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 ('طقم رجالي ميلتون 7301 دريم كونز','','203','915','960','0','0','2026-10-21','0','7','0','','0','0','0','0','0','915','915','915','915','915','0','4.92','0','0','.','0','0','0','915','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','915','915','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','915','0','0','0','0','0','0','','','0','0','0','0'); -- id=2305
UPDATE product SET productName = 'طقم رجالي ميلتون 7301 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '915', productSellAllPrice = '960', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02305',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '915',lastbuyprice_withDiscount = '915',meanbuyprice = '915',meanbuyprice_withDiscount = '915' , productbuypricereal = '915' , buypricereal_precentage = '0' , buytotal_precentage = '4.92' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='915',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='915',meanbuyprice_withTax='915',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='915',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2305';
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', '2305', '1.00', '2026-10-21', '7', '0','0230501','960','0','0','915','','0','0','0','0','0','0','0','0','0','0'); -- id=2305
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2305', '1', '0', '7', '2026-10-21'); -- id=3698
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2305', '1', '0', '0', '2305', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15516
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2305, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2305, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3382
UPDATE product SET productName = 'طقم رجالي ميلتون 7301 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '915.00', productSellAllPrice = '960.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02305',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '915',lastbuyprice_withDiscount = '915',meanbuyprice = '915',meanbuyprice_withDiscount = '915' , productbuypricereal = '915' , buypricereal_precentage = '0' , buytotal_precentage = '4.92' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='915',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='915',meanbuyprice_withTax='915',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='915',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2305';
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 ('جاكت وتر بروف 7272 دريم كونز','','203','660','700','0','0','2026-10-21','0','7','0','','0','0','0','0','0','660','660','660','660','660','0','6.06','0','0','.','0','0','0','660','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','660','660','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','660','0','0','0','0','0','0','','','0','0','0','0'); -- id=2306
UPDATE product SET productName = 'جاكت وتر بروف 7272 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660', productSellAllPrice = '700', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02306',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660' , buypricereal_precentage = '0' , buytotal_precentage = '6.06' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2306';
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', '2306', '1.00', '2026-10-21', '7', '0','0230601','700','0','0','660','','0','0','0','0','0','0','0','0','0','0'); -- id=2306
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2306', '1', '0', '7', '2026-10-21'); -- id=3699
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2306', '1', '0', '0', '2306', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15517
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2306, 1,'2026-10-21 10:04:28',7)
                ON DUPLICATE KEY UPDATE productid = 2306, edited = 1, sysdate = '2026-10-21 10:04:28', userid = 7; -- id=3383
UPDATE product SET productName = 'جاكت وتر بروف 7272 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660.00', productSellAllPrice = '700.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02306',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660' , buypricereal_precentage = '0' , buytotal_precentage = '6.06' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2306';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:34:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:04:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:04:30', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:34:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:04:42", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:04:42', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16010
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', '7', '2026-10-21 10:05:00', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=200
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 ('200', '0', '', '0', 'إضافة مورد جديد', '200', '', '2026-10-21 10:05:00', '7', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=783
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', '', '7', '0', '2026-10-21 10:05:00'); -- id=687
UPDATE supplier SET suppliername = 'دريم كونز', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '7', supplierdate = '2026-10-21', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='687',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '200';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:42:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:12:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:12:25', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=275&type=2'); -- id=16011
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:42:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:12:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:12:27', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16012
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:53:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:23:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:23:49', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16013
UPDATE productunit SET unitid = '1', productid = '2293', productnumber = '1.00', productunitdate = '2026-10-21', userid = '7', conditions = '0',proUnitParcode='0229301',proUnitSellAllPrice='710',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='660',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '2293';
UPDATE product SET productName = 'جاكت سويد 7254 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660', productSellAllPrice = '710', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02293',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660.00',lastbuyprice_withDiscount = '660',meanbuyprice = '660.00',meanbuyprice_withDiscount = '660' , productbuypricereal = '660' , buypricereal_precentage = '0' , buytotal_precentage = '7.58' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2293';
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:54:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:24:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:24:59', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16014
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-21 06:54:59";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:24:59', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16015
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:54:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:25:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:25:00', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16016
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-21 06:55:00";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:25:00', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16017
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:55:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:25:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:25:03', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16018
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:55:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:25:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:25:23', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16019
UPDATE productunit SET proUnitBuyPrice  = 405.00 * productnumber WHERE productid = 2297;
UPDATE product SET productName = 'هودي بزنط 7277 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02297',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '405.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.64' , 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='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2297';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2297, 1,'2026-10-21 10:25:39',7)
                ON DUPLICATE KEY UPDATE productid = 2297, edited = 1, sysdate = '2026-10-21 10:25:39', userid = 7; -- id=3374
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:55:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:25:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:25:46', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16020
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 ('06ad8640a45c00', '2026-10-21 10:04:42', '200', '0.00', '304620', '0', '0', '304620.00',  '304620.00', '0', '304620', '1', '2026-10-21 10:25:46', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=276
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 ('02291', '276', '203', '2291', '36', '420', '15120.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','15120','0','0','0','0','0','0','0','0','1'); -- id=1530
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 36, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '36', '0', 'buyBillController.php', '1530', '', '0', '0'); -- id=1126
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1530 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1530;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '36', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 10:04:42','0','0'); -- id=15518
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 ('02291', '276', '203', '2291', '21', '420', '8820.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','8820','0','0','0','0','0','0','0','0','1'); -- id=1531
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 21, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '21', '0', 'buyBillController.php', '1531', '', '0', '0'); -- id=1127
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 36 WHERE buybilldetailid = 1531 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1531;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '57', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '21', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '36', '57', '7', '2026-10-21 10:04:42','0','0'); -- id=15519
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 ('02291', '276', '203', '2291', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1532
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '24', '0', 'buyBillController.php', '1532', '', '0', '0'); -- id=1128
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 57 WHERE buybilldetailid = 1532 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1532;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '81', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '57', '81', '7', '2026-10-21 10:04:42','0','0'); -- id=15520
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 ('02291', '276', '203', '2291', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1533
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '24', '0', 'buyBillController.php', '1533', '', '0', '0'); -- id=1129
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 81 WHERE buybilldetailid = 1533 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1533;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '105', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '81', '105', '7', '2026-10-21 10:04:42','0','0'); -- id=15521
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 ('02291', '276', '203', '2291', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1534
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '24', '0', 'buyBillController.php', '1534', '', '0', '0'); -- id=1130
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 105 WHERE buybilldetailid = 1534 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1534;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '129', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '105', '129', '7', '2026-10-21 10:04:42','0','0'); -- id=15522
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 ('02291', '276', '203', '2291', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1535
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '24', '0', 'buyBillController.php', '1535', '', '0', '0'); -- id=1131
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 129 WHERE buybilldetailid = 1535 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1535;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '153', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '129', '153', '7', '2026-10-21 10:04:42','0','0'); -- id=15523
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 ('02291', '276', '203', '2291', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2291','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1536
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2291, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6799
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2291', '420', '24', '0', 'buyBillController.php', '1536', '', '0', '0'); -- id=1132
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2291 ;
UPDATE buybilldetail SET  quantitybefore = 153 WHERE buybilldetailid = 1536 ;
UPDATE product SET productName = 'موديلات 450 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02291',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 = '7.14' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '2291';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1536;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2291;
UPDATE storedetail SET  productquantity = '177', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '153', '177', '7', '2026-10-21 10:04:42','0','0'); -- id=15524
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 ('02292', '276', '203', '2292', '24', '775', '18600.00', '0', '', '2026-10-21 10:25:46', '2292','','','0','0','0','0','0',null,'775','18600','0','0','0','0','0','0','0','0','1'); -- id=1537
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2292, 0, 0
                    , 775, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 775,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6806
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2292', '775', '24', '0', 'buyBillController.php', '1537', '', '0', '0'); -- id=1133
UPDATE product SET  productBuyPrice = "775" WHERE productId = 2292 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1537 ;
UPDATE product SET productName = 'جاكت سويد 7252 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '775.00', productSellAllPrice = '825.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02292',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '775',lastbuyprice_withDiscount = '775',meanbuyprice = '775',meanbuyprice_withDiscount = '775' , productbuypricereal = '775.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='775',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='775',meanbuyprice_withTax='775',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='775',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2292';
UPDATE buybilldetail SET  lastbuyprice = 775 , meanbuyprice = 775, lastbuyprice_withDiscount = 775, meanbuyprice_withDiscount = 775
        , lastbuyprice_withTax = 775, meanbuyprice_withTax = 775, lastbuyprice_withDiscountAndTax = 775
                where buybilldetailid = 1537;
UPDATE productunit SET proUnitBuyPrice  = 775 * productnumber WHERE productid = 2292;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3685';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2292', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15525
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 ('02293', '276', '203', '2293', '24', '660', '15840.00', '0', '', '2026-10-21 10:25:46', '2293','','','0','0','0','0','0',null,'660','15840','0','0','0','0','0','0','0','0','1'); -- id=1538
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2293, 0, 0
                    , 660, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 660,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6807
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2293', '660', '24', '0', 'buyBillController.php', '1538', '', '0', '0'); -- id=1134
UPDATE product SET  productBuyPrice = "660" WHERE productId = 2293 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1538 ;
UPDATE product SET productName = 'جاكت سويد 7254 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660.00', productSellAllPrice = '710.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02293',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.58' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2293';
UPDATE buybilldetail SET  lastbuyprice = 660 , meanbuyprice = 660, lastbuyprice_withDiscount = 660, meanbuyprice_withDiscount = 660
        , lastbuyprice_withTax = 660, meanbuyprice_withTax = 660, lastbuyprice_withDiscountAndTax = 660
                where buybilldetailid = 1538;
UPDATE productunit SET proUnitBuyPrice  = 660 * productnumber WHERE productid = 2293;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3686';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2293', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15526
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 ('02294', '276', '203', '2294', '24', '825', '19800.00', '0', '', '2026-10-21 10:25:46', '2294','','','0','0','0','0','0',null,'825','19800','0','0','0','0','0','0','0','0','1'); -- id=1539
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2294, 0, 0
                    , 825, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 825,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6808
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2294', '825', '24', '0', 'buyBillController.php', '1539', '', '0', '0'); -- id=1135
UPDATE product SET  productBuyPrice = "825" WHERE productId = 2294 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1539 ;
UPDATE product SET productName = 'جلد مموه 7259 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '825.00', productSellAllPrice = '875.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02294',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 = '6.06' , 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 = '2294';
UPDATE buybilldetail SET  lastbuyprice = 825 , meanbuyprice = 825, lastbuyprice_withDiscount = 825, meanbuyprice_withDiscount = 825
        , lastbuyprice_withTax = 825, meanbuyprice_withTax = 825, lastbuyprice_withDiscountAndTax = 825
                where buybilldetailid = 1539;
UPDATE productunit SET proUnitBuyPrice  = 825 * productnumber WHERE productid = 2294;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3687';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2294', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15527
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 ('02295', '276', '203', '2295', '24', '630', '15120.00', '0', '', '2026-10-21 10:25:46', '2295','','','0','0','0','0','0',null,'630','15120','0','0','0','0','0','0','0','0','1'); -- id=1540
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2295, 0, 0
                    , 630, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 630,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6809
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2295', '630', '24', '0', 'buyBillController.php', '1540', '', '0', '0'); -- id=1136
UPDATE product SET  productBuyPrice = "630" WHERE productId = 2295 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1540 ;
UPDATE product SET productName = 'جاكت سويد 7261 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '630.00', productSellAllPrice = '680.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02295',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.94' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',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='630',meanbuyprice_withTax='630',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2295';
UPDATE buybilldetail SET  lastbuyprice = 630 , meanbuyprice = 630, lastbuyprice_withDiscount = 630, meanbuyprice_withDiscount = 630
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where buybilldetailid = 1540;
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 2295;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3688';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2295', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15528
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 ('02296', '276', '203', '2296', '24', '560', '13440.00', '0', '', '2026-10-21 10:25:46', '2296','','','0','0','0','0','0',null,'560','13440','0','0','0','0','0','0','0','0','1'); -- id=1541
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2296, 0, 0
                    , 560, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 560,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6810
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2296', '560', '24', '0', 'buyBillController.php', '1541', '', '0', '0'); -- id=1137
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2296 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1541 ;
UPDATE product SET productName = 'سويت شيرت ميلتون 7266 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '560.00', productSellAllPrice = '595.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02296',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2296';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 560, meanbuyprice_withDiscount = 560
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where buybilldetailid = 1541;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2296;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3689';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2296', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15529
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 ('02297', '276', '203', '2297', '24', '405', '9720.00', '0', '', '2026-10-21 10:25:46', '2297','','','0','0','0','0','0',null,'405','9720','0','0','0','0','0','0','0','0','1'); -- id=1542
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2297, 0, 0
                    , 405, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6811
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2297', '405', '24', '0', 'buyBillController.php', '1542', '', '0', '0'); -- id=1138
UPDATE product SET  productBuyPrice = "405" WHERE productId = 2297 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1542 ;
UPDATE product SET productName = 'هودي بزنط 7277 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02297',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '405.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.64' , 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='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2297';
UPDATE buybilldetail SET  lastbuyprice = 405 , meanbuyprice = 405, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 405, meanbuyprice_withTax = 405, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 1542;
UPDATE productunit SET proUnitBuyPrice  = 405 * productnumber WHERE productid = 2297;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3690';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2297', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15530
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 ('02298', '276', '203', '2298', '24', '400', '9600.00', '0', '', '2026-10-21 10:25:46', '2298','','','0','0','0','0','0',null,'400','9600','0','0','0','0','0','0','0','0','1'); -- id=1543
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2298, 0, 0
                    , 400, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6812
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2298', '400', '24', '0', 'buyBillController.php', '1543', '', '0', '0'); -- id=1139
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2298 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1543 ;
UPDATE product SET productName = 'هودي ميلتون 7279 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '400.00', productSellAllPrice = '435.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02298',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '405.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.41' , 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='0',weightedDiscount='0',sortby='0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2298';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 1543;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2298;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3691';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2298', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15531
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 ('02299', '276', '203', '2299', '24', '420', '10080.00', '0', '', '2026-10-21 10:25:46', '2299','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=1544
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2299, 0, 0
                    , 420, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6813
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2299', '420', '24', '0', 'buyBillController.php', '1544', '', '0', '0'); -- id=1140
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2299 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1544 ;
UPDATE product SET productName = 'تيشرت ياقة 7284 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '420.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02299',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 = '8.33' , 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 = '2299';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1544;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2299;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2299', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15532
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 ('02300', '276', '203', '2300', '24', '460', '11040.00', '0', '', '2026-10-21 10:25:46', '2300','','','0','0','0','0','0',null,'460','11040','0','0','0','0','0','0','0','0','1'); -- id=1545
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2300, 0, 0
                    , 460, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6814
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2300', '460', '24', '0', 'buyBillController.php', '1545', '', '0', '0'); -- id=1141
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2300 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1545 ;
UPDATE product SET productName = 'موديل 495 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '460.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02300',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 = '7.61' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2300';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1545;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2300;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2300', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15533
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 ('02300', '276', '203', '2300', '24', '460', '11040.00', '0', '', '2026-10-21 10:25:46', '2300','','','0','0','0','0','0',null,'460','11040','0','0','0','0','0','0','0','0','1'); -- id=1546
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2300, 0, 0
                    , 460, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6814
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2300', '460', '24', '0', 'buyBillController.php', '1546', '', '0', '0'); -- id=1142
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2300 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1546 ;
UPDATE product SET productName = 'موديل 495 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '460.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02300',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 = '7.61' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2300';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1546;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2300;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2300', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '48', '7', '2026-10-21 10:04:42','0','0'); -- id=15534
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 ('02301', '276', '203', '2301', '24', '435', '10440.00', '0', '', '2026-10-21 10:25:46', '2301','','','0','0','0','0','0',null,'435','10440','0','0','0','0','0','0','0','0','1'); -- id=1547
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2301, 0, 0
                    , 435, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 435,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6816
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2301', '435', '24', '0', 'buyBillController.php', '1547', '', '0', '0'); -- id=1143
UPDATE product SET  productBuyPrice = "435" WHERE productId = 2301 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1547 ;
UPDATE product SET productName = 'هودي بزنط 7290 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '435.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02301',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.75' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2301';
UPDATE buybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where buybilldetailid = 1547;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 2301;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2301', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15535
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 ('02302', '276', '203', '2302', '24', '525', '12600.00', '0', '', '2026-10-21 10:25:46', '2302','','','0','0','0','0','0',null,'525','12600','0','0','0','0','0','0','0','0','1'); -- id=1548
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2302, 0, 0
                    , 525, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 525,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6817
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2302', '525', '24', '0', 'buyBillController.php', '1548', '', '0', '0'); -- id=1144
UPDATE product SET  productBuyPrice = "525" WHERE productId = 2302 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1548 ;
UPDATE product SET productName = 'هودي بزنط 7291 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '525.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02302',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 = '6.67' , 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='525',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='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 = '2302';
UPDATE buybilldetail SET  lastbuyprice = 525 , meanbuyprice = 525, lastbuyprice_withDiscount = 525, meanbuyprice_withDiscount = 525
        , lastbuyprice_withTax = 525, meanbuyprice_withTax = 525, lastbuyprice_withDiscountAndTax = 525
                where buybilldetailid = 1548;
UPDATE productunit SET proUnitBuyPrice  = 525 * productnumber WHERE productid = 2302;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3695';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2302', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15536
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 ('02301', '276', '203', '2301', '24', '435', '10440.00', '0', '', '2026-10-21 10:25:46', '2301','','','0','0','0','0','0',null,'435','10440','0','0','0','0','0','0','0','0','1'); -- id=1549
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2301, 0, 0
                    , 435, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 435,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6816
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2301', '435', '24', '0', 'buyBillController.php', '1549', '', '0', '0'); -- id=1145
UPDATE product SET  productBuyPrice = "435" WHERE productId = 2301 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1549 ;
UPDATE product SET productName = 'هودي بزنط 7290 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '435.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02301',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.75' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2301';
UPDATE buybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where buybilldetailid = 1549;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 2301;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2301', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '48', '7', '2026-10-21 10:04:42','0','0'); -- id=15537
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 ('02304', '276', '203', '2304', '48', '515', '24720.00', '0', '', '2026-10-21 10:25:46', '2304','','','0','0','0','0','0',null,'515','24720','0','0','0','0','0','0','0','0','1'); -- id=1550
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2304, 0, 0
                    , 515, 48, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 515,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6819
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2304', '515', '48', '0', 'buyBillController.php', '1550', '', '0', '0'); -- id=1146
UPDATE product SET  productBuyPrice = "515" WHERE productId = 2304 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1550 ;
UPDATE product SET productName = 'سويت شيرت 7300 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '515.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02304',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.80' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2304';
UPDATE buybilldetail SET  lastbuyprice = 515 , meanbuyprice = 515, lastbuyprice_withDiscount = 515, meanbuyprice_withDiscount = 515
        , lastbuyprice_withTax = 515, meanbuyprice_withTax = 515, lastbuyprice_withDiscountAndTax = 515
                where buybilldetailid = 1550;
UPDATE productunit SET proUnitBuyPrice  = 515 * productnumber WHERE productid = 2304;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3697';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2304', '1', '48', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '7', '2026-10-21 10:04:42','0','0'); -- id=15538
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 ('02305', '276', '203', '2305', '24', '915', '21960.00', '0', '', '2026-10-21 10:25:46', '2305','','','0','0','0','0','0',null,'915','21960','0','0','0','0','0','0','0','0','1'); -- id=1551
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2305, 0, 0
                    , 915, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 915,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6820
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2305', '915', '24', '0', 'buyBillController.php', '1551', '', '0', '0'); -- id=1147
UPDATE product SET  productBuyPrice = "915" WHERE productId = 2305 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1551 ;
UPDATE product SET productName = 'طقم رجالي ميلتون 7301 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '915.00', productSellAllPrice = '960.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02305',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '915',lastbuyprice_withDiscount = '915',meanbuyprice = '915',meanbuyprice_withDiscount = '915' , productbuypricereal = '915.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.92' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='915',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='915',meanbuyprice_withTax='915',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='915',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2305';
UPDATE buybilldetail SET  lastbuyprice = 915 , meanbuyprice = 915, lastbuyprice_withDiscount = 915, meanbuyprice_withDiscount = 915
        , lastbuyprice_withTax = 915, meanbuyprice_withTax = 915, lastbuyprice_withDiscountAndTax = 915
                where buybilldetailid = 1551;
UPDATE productunit SET proUnitBuyPrice  = 915 * productnumber WHERE productid = 2305;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3698';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2305', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15539
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 ('02306', '276', '203', '2306', '24', '660', '15840.00', '0', '', '2026-10-21 10:25:46', '2306','','','0','0','0','0','0',null,'660','15840','0','0','0','0','0','0','0','0','1'); -- id=1552
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:04:42', 1, 2306, 0, 0
                    , 660, 24, 0, 0, 7, '2026-10-21 10:25:46')
                ON DUPLICATE KEY UPDATE buyprice = 660,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:25:46' ; -- id=6821
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2306', '660', '24', '0', 'buyBillController.php', '1552', '', '0', '0'); -- id=1148
UPDATE product SET  productBuyPrice = "660" WHERE productId = 2306 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1552 ;
UPDATE product SET productName = 'جاكت وتر بروف 7272 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '660.00', productSellAllPrice = '700.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02306',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '660',meanbuyprice_withDiscount = '660' , productbuypricereal = '660.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.06' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='660',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='660',meanbuyprice_withTax='660',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='660',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2306';
UPDATE buybilldetail SET  lastbuyprice = 660 , meanbuyprice = 660, lastbuyprice_withDiscount = 660, meanbuyprice_withDiscount = 660
        , lastbuyprice_withTax = 660, meanbuyprice_withTax = 660, lastbuyprice_withDiscountAndTax = 660
                where buybilldetailid = 1552;
UPDATE productunit SET proUnitBuyPrice  = 660 * productnumber WHERE productid = 2306;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2306', '1', '24', '0', '276', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 10:04:42','0','0'); -- id=15540
UPDATE supplier SET  suppliercurrentDebt = '304620',suppliercurrentDebtInCurrency= '304620' , userid = '7', supplierdate = '2026-10-21 10:25:46'   WHERE supplierid = '200';
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 ('200', '0.00', '304620', '0', 'اضافة فاتورة مشتريات', '276', '304620', '2026-10-21 10:04:42', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','304620','1','0','304620','304620','0',''); -- id=784
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '304620', '304620', '2026-10-21', '7', '0', '0', '2026-10-21 10:25:46','اضافة فاتورة مشتريات رقم 276','1','0',null,'0','276','buyBillController.php?do=details&id=276'); -- id=4041
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4041', '382', '304620', '','0'); -- id=4147
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24755541.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 ('4041', '687', '304620', '','0'); -- id=4043
UPDATE accountstree SET name = 'دريم كونز', customName = 'دريم كونز', customNameEn = 'دريم كونز', nameEn = 'دريم كونز', parent = '81', accountNature = '1', theValue = '304620', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '7', del = '0', sysdate = '2026-10-21 10:05:00' WHERE id = '687';
update buybill set dailyentryid='4041,0' where buybillid=276;
COMMIT;
UPDATE product SET overAllAveragePrice = 420 WHERE productId = 2291;UPDATE product SET overAllAveragePrice = 775 WHERE productId = 2292;UPDATE product SET overAllAveragePrice = 660 WHERE productId = 2293;UPDATE product SET overAllAveragePrice = 825 WHERE productId = 2294;UPDATE product SET overAllAveragePrice = 630 WHERE productId = 2295;UPDATE product SET overAllAveragePrice = 560 WHERE productId = 2296;UPDATE product SET overAllAveragePrice = 405 WHERE productId = 2297;UPDATE product SET overAllAveragePrice = 400 WHERE productId = 2298;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 2299;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 2300;UPDATE product SET overAllAveragePrice = 435 WHERE productId = 2301;UPDATE product SET overAllAveragePrice = 525 WHERE productId = 2302;UPDATE product SET overAllAveragePrice = 515 WHERE productId = 2304;UPDATE product SET overAllAveragePrice = 915 WHERE productId = 2305;UPDATE product SET overAllAveragePrice = 660 WHERE productId = 2306;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:55:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:25:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:25:46', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=276'); -- id=16021
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 06:56:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:26:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:26:00', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=276&type=2'); -- id=16022
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:03: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-21 07:03:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:33:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:33:18', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16023
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-21 07:03:18";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 10:33:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:33:18', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16024
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:03:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:33:21", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:33:21', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16025
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:03:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:33:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:33:37', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=276&type=2'); -- id=16026
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:04:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:34:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:34:23', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16027

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad86ac111f71
-- ----------------------------------------------------------------------------------------------------

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-21 10:34:23', '06ad86ac111f71', '1', '0.00', '0', '0', '1', '2660.00', '2660', '2660', '0', '2', '2026-10-21 10:34:23', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','2660','0','','0','0','2660','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1134
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','اضافة فاتورة مبيعات','1134', '0', '2026-10-21 10:34:23', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2660', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 10:34:23','0','0','',''); -- id=1355
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+7 where id = 495;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01551', '1134', '112', '1551', '7', '380', '2660', '0', '', '0', '2026-10-21 10:34:23', '1551', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','495-7,','1','1','0','0','380','2660','0','','0','0.00','0','0','0','0'); -- id=4547
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 = 4547;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1551, '2026-10-21', 2660, 2240, 2240
                    , 2240, 2240, 2240, 2240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 2240, 2240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2660, sellCostBuyPrice =sellCostBuyPrice+2240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-21', 2660, 2240, 2240
                    , 2240, 2240, 2240, 2240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2240, 2240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2660, sellCostBuyPrice =sellCostBuyPrice+2240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '222', userid = '4', storedetaildate = '2026-10-21 10:34:23' WHERE storedetailid = '2563';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1551', '2', '7', '1', '1134', 'اضافة فاتورة مبيعات', 'sellbillController.php', '229', '222', '4', '2026-10-21 10:34:23','0','0'); -- id=15541
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1123392.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 ('1120732.875','2660', '0', '3', 'اضافة فاتورة مبيعات', '1134', '1123392.875', '2026-10-21 10:34:23', '4',  'sellbillController.php','1','','0'); -- id=1411
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2660', '2660', '2026-10-21', '4', '0', '0', '2026-10-21 10:34:23','اضافة فاتورة مبيعات رقم 1134','1','0',null,'0','1134','sellbillController.php?do=showDetail&sellbillid=1134'); -- id=4042
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4042', '501', '2660', '','0'); -- id=4148
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1123392.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 ('4042', '143', '2660', '','0'); -- id=4044
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12772230', 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 ( '2240', '2240', '2026-10-21', '4', '0', '0', '2026-10-21 10:34:23','اضافة فاتورة مبيعات رقم 1134 - صرف البضاعة من المخزن','1','0',null,'0','1134','sellbillController.php?do=showDetail&sellbillid=1134'); -- id=4043
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4043', '402', '2240', '','0'); -- id=4149
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11818547.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 ('4043', '492', '2240', '','0'); -- id=4045
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1576591', 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='4042,0,4043' where sellbillid=1134;
 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-21', 2660, 2240, 2240
                    , 2240, 2240, 2240, 2240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2240, 2240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2660, sellCostBuyPrice =sellCostBuyPrice+2240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2240
                        , returnSellVal = returnSellVal+0, 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-21', 2660, 2240, 2240
                    , 2240, 2240, 2240, 2240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2240, 2240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2660, sellCostBuyPrice =sellCostBuyPrice+2240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2240
                        , returnSellVal = returnSellVal+0, 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, 2660, 2240, 2240
                    , 2240, 2240, 2240, 2240, 2240, 2240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2660, netSellCostBuyPrice = netSellCostBuyPrice+2240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad86ac111f71 and sellbillId = 1134 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:04:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:34:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:34:23', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:04:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:34:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 10:34:30', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16029
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:04:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:34:35", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:34:35', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16030
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:05:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:35:36", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:35:36', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=276'); -- id=16031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:07:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:37:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:37:26', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16032
UPDATE productunit SET proUnitBuyPrice  = 405.00 * productnumber WHERE productid = 2297;
UPDATE product SET productName = 'هودي بزنط 7277 دريم كونز', productDescription = '', productCatId = '203', productBuyPrice = '405.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02297',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '405.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.64' , 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='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2297';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2297, 1,'2026-10-21 10:40:46',7)
                ON DUPLICATE KEY UPDATE productid = 2297, edited = 1, sysdate = '2026-10-21 10:40:46', userid = 7; -- id=3374
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:11:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:41:02", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:41:02', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16033
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-21 07:11:02";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:41:02', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16034
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:11:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:41:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:41:19', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:11:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:41:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:41:30', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:15:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:45:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:45:32', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=276&type=2'); -- id=16037
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:16:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:46:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:46:03', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16038
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-21 07:16:04";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:46:04', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16039
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:16:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:46:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:46:06', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16040
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:16:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:46:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:46:28', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16041
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-21 07:16:28";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:46:29', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16042
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:16:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:46:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:46:29', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16043
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-21 07:16:29";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:46:29', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16044
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:20:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:50:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:50:27', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:20:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:50:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:50:29', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:20:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:50:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:50:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16047
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 10:52:14', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16048
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 10:52:19', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16049
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:32', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=238'); -- id=16050
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:39', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16051
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:46', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16052
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:49', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=238'); -- id=16053
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:57', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16054
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 238;
UPDATE buybill SET  buybillsysdate = '2026-10-21 10:52:57', userid = '7',delbyuserid = '1', conditions = '1' WHERE buybillid = '238';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2055, 0, 0
                    , 250, 179, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-179, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6087
UPDATE buybilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250.00, meanbuyprice_withTax = 124.65, lastbuyprice_withDiscountAndTax = 250.00
                where buybilldetailid = 1380;
UPDATE product SET productName = 'ميلتون فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '250.00', productSellAllPrice = '270.00', productSellUnitPrice = '270.00', productSellHalfPrice = '270.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02055',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '0',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',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='250',meanbuyprice_withTax='412.31',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 = '2055';
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 2055;
UPDATE storedetail SET  productquantity = '-78', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '179', '1', '238', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '101', '-78', '1', '2026-10-14 21:08:41','0','0'); -- id=15542
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2056, 0, 0
                    , 290, 72, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-72, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6088
UPDATE buybilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        , lastbuyprice_withTax = 290.00, meanbuyprice_withTax = 145.00, lastbuyprice_withDiscountAndTax = 290.00
                where buybilldetailid = 1381;
UPDATE product SET productName = 'ميلتون خاص فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '290.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02056',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '0',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='290',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='290',meanbuyprice_withTax='642.14',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 = '2056';
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 2056;
UPDATE storedetail SET  productquantity = '-21', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3415';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2056', '1', '72', '1', '238', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '51', '-21', '1', '2026-10-14 21:08:41','0','0'); -- id=15543
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2057, 0, 0
                    , 140, 120, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-120, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6089
UPDATE buybilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140.00, meanbuyprice_withTax = 140.00, lastbuyprice_withDiscountAndTax = 140.00
                where buybilldetailid = 1382;
UPDATE product SET productName = 'بدي قطن دريب فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '140.00', productSellAllPrice = '150.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02057',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '0',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140',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='140',meanbuyprice_withTax='140',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 = '2057';
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 2057;
UPDATE storedetail SET  productquantity = '-69', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2057', '1', '120', '1', '238', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '51', '-69', '1', '2026-10-14 21:08:41','0','0'); -- id=15544
UPDATE supplier SET  suppliercurrentDebt = '-55000',suppliercurrentDebtInCurrency= '-55000' , userid = '1', supplierdate = '2026-10-21 10:52:57'   WHERE supplierid = '177';
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', '27430.00', '82430.00', '1', 'حذف فاتورة مشتريات - للتعديل', '238', '-55000', '2026-10-14 21:08:41', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','82430','1','27430','82430','-55000','0',''); -- id=785
UPDATE productserial SET del = 1
		 WHERE billid = 238;
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 ('06acfc529cb224', '2026-10-14 21:08:41', '177', '-55000.00', '27680', '0', '0', '82680.00', '82680.00', '0.00', '82680', '1', '2026-10-21 10:52:57', '', '1', '0', '', '1', '1','1','238','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=277
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 ('02055', '277', '169', '2055', '180.00', '250', '45000.00', '0.00', '', '2026-10-21 10:52:57', '2055','','','0','0','0','0','0',null,'250','45000','0','0','0','0','0','0','0','0','1'); -- id=1553
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2055, 0, 0
                    , 250, 180, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6087
UPDATE product SET  productBuyPrice = "250" WHERE productId = 2055 ;
UPDATE buybilldetail SET  quantitybefore = -78 WHERE buybilldetailid = 1553 ;
UPDATE product SET productName = 'ميلتون فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '250.00', productSellAllPrice = '270.00', productSellUnitPrice = '270.00', productSellHalfPrice = '270.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02055',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',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='250',meanbuyprice_withTax='308.34',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='250',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2055';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 308.34, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 1553;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 2055;
UPDATE storedetail SET  productquantity = '102', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '180', '0', '277', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-78', '102', '1', '2026-10-14 21:08:41','0','0'); -- id=15545
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 ('02056', '277', '169', '2056', '72.00', '290', '20880.00', '0.00', '', '2026-10-21 10:52:57', '2056','','','0','0','0','0','0',null,'290','20880','0','0','0','0','0','0','0','0','1'); -- id=1554
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2056, 0, 0
                    , 290, 72, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyprice = 290,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6088
UPDATE product SET  productBuyPrice = "290" WHERE productId = 2056 ;
UPDATE buybilldetail SET  quantitybefore = -21 WHERE buybilldetailid = 1554 ;
UPDATE product SET productName = 'ميلتون خاص فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '290.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '310.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02056',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='290',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='290',meanbuyprice_withTax='436.01',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='290',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2056';
UPDATE buybilldetail SET  lastbuyprice = 290 , meanbuyprice = 290, lastbuyprice_withDiscount = 290, meanbuyprice_withDiscount = 290
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 436.01, lastbuyprice_withDiscountAndTax = 290
                where buybilldetailid = 1554;
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 2056;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3415';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2056', '1', '72', '0', '277', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-21', '51', '1', '2026-10-14 21:08:41','0','0'); -- id=15546
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 ('02057', '277', '169', '2057', '120.00', '140', '16800.00', '0.00', '', '2026-10-21 10:52:57', '2057','','','0','0','0','0','0',null,'140','16800','0','0','0','0','0','0','0','0','1'); -- id=1555
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 21:08:41', 1, 2057, 0, 0
                    , 140, 120, 0, 0, 1, '2026-10-21 10:52:57')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+120, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:52:57' ; -- id=6089
UPDATE product SET  productBuyPrice = "140" WHERE productId = 2057 ;
UPDATE buybilldetail SET  quantitybefore = -69 WHERE buybilldetailid = 1555 ;
UPDATE product SET productName = 'بدي قطن دريب فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '140.00', productSellAllPrice = '150.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02057',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140',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='140',meanbuyprice_withTax='140',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='140',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2057';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 140, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 140
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 1555;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 2057;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2057', '1', '120', '0', '277', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-69', '51', '1', '2026-10-14 21:08:41','0','0'); -- id=15547
DELETE FROM productserial WHERE billid = 238
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '27680',suppliercurrentDebtInCurrency= '27680' , userid = '1', supplierdate = '2026-10-21 10:52:57'   WHERE supplierid = '177';
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', '-55000.00', '82680', '0', 'اضافة فاتورة مشتريات', '277', '27680', '2026-10-21 10:52:57', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','82430','1','-55000','82680','27680','0',''); -- id=786
UPDATE dailyentry SET totalcreditor = '82430.00', totaldebtor = '82430.00', thedate = '2026-10-19', userid = '7', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 13:06:45', entryComment = 'اضافة فاتورة مشتريات رقم 238', fromFlag = '1',related='0',isopeningentry='0',operationId='238',operationDetailLink='buyBillController.php?do=details&id=238' WHERE id = '3710';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82430.00', '82430.00', '2026-10-21', '1', '0', '3710', '2026-10-21 10:52:57','تم عكس القيد رقم 3710 ','1','0','0','0','0',''); -- id=4044
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4044', '382', '82430.00', '','0'); -- id=4046
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24673111.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4044', '660', '82430.00', '','0'); -- id=4150
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '-55000', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82680', '82680', '2026-10-21', '1', '0', '0', '2026-10-21 10:52:57','اضافة فاتورة مشتريات رقم 277','1','0',null,'0','277','buyBillController.php?do=details&id=277'); -- id=4045
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4045', '382', '82680', '','0'); -- id=4151
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24755791.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 ('4045', '660', '82680', '','0'); -- id=4047
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '27680', 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';
update buybill set dailyentryid='4045,0' where buybillid=277;
UPDATE product SET overAllAveragePrice = 250 WHERE productId = 2055;UPDATE product SET overAllAveragePrice = 290 WHERE productId = 2056;UPDATE product SET overAllAveragePrice = 140 WHERE productId = 2057;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:22:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:52:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:52:57', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=277'); -- id=16055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:23:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:53:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:53:27', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16056
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:23:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:53:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:53:33', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:23:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:53:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:53:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16058
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:23:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:53:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:53:36', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=274'); -- id=16059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:23:58";
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-21 07:24:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:00", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:54:00', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16060
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-21 07:24:00";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 10:54:00", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:54:00', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:02", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:54:02', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:54:08', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16063
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 274;
UPDATE buybill SET  buybillsysdate = '2026-10-21 10:54:08', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '274';
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6784
UPDATE buybilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275.00, meanbuyprice_withTax = 275.00, lastbuyprice_withDiscountAndTax = 275.00
                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 = '0',meanbuyprice = '275.00',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='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 = '2288';
UPDATE productunit SET proUnitBuyPrice  = 275 * productnumber WHERE productid = 2288;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3681';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2288', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15548
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6785
UPDATE buybilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260.00, meanbuyprice_withTax = 260.00, lastbuyprice_withDiscountAndTax = 260.00
                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 = '0',meanbuyprice = '260.00',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='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 = '2280';
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2280;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3673';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2280', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15549
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6786
UPDATE buybilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370.00, meanbuyprice_withTax = 370.00, lastbuyprice_withDiscountAndTax = 370.00
                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 = '0',meanbuyprice = '370.00',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='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 = '2281';
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 2281;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3674';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2281', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15550
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6787
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 360.00
                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 = '0',meanbuyprice = '360.00',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='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 = '2282';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2282;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2282', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15551
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6788
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 360.00
                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 = '0',meanbuyprice = '360.00',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='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 = '2283';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2283;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2283', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15552
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-21 10:54:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:08' ; -- id=6789
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 350.00
                where 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 = '0',meanbuyprice = '350.00',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='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 = '2284';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2284;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3677';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2284', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15553
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-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-50, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6790
UPDATE buybilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320.00, meanbuyprice_withTax = 320.00, lastbuyprice_withDiscountAndTax = 320.00
                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 = '0',meanbuyprice = '320.00',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='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 = '2285';
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2285;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3678';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2285', '1', '50', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '50', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15554
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-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6791
UPDATE buybilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380.00, meanbuyprice_withTax = 380.00, lastbuyprice_withDiscountAndTax = 380.00
                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 = '0',meanbuyprice = '380.00',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='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 = '2286';
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 2286;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3679';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2286', '1', '40', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15555
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-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6792
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 350.00
                where 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 = '0',meanbuyprice = '350.00',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='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 = '2287';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2287;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3680';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2287', '1', '36', '1', '274', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '36', '0', '1', '2026-10-20 18:31:10','0','0'); -- id=15556
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-21 10:54:08'   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', '122800.00', '122800.00', '1', 'حذف فاتورة مشتريات - للتعديل', '274', '0', '2026-10-20 18:31:10', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','122800','1','122800','122800','0','0',''); -- id=787
UPDATE productserial SET del = 1
		 WHERE billid = 274;
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 ('06ad7893e25026', '2026-10-20 18:31:10', '199', '0.00', '119116', '3', '1', '122800.00', '119116.00', '0.00', '119116', '1', '2026-10-21 10:54:08', '', '1', '0', '', '1', '1','1','274','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=278
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', '278', '202', '2288', '40.00', '275', '11000.00', '0.00', '', '2026-10-21 10:54:08', '2288','','','0','0','0','0','0',null,'275','11000','0','0','0','0','0','0','0','0','1'); -- id=1556
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
                    , 266.75, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 266.75,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6784
UPDATE product SET  productBuyPrice = "275" WHERE productId = 2288 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1556 ;
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 = '266.75',meanbuyprice = '275',meanbuyprice_withDiscount = '270.88' , 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='137.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='266.75',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 = 266.75, meanbuyprice_withDiscount = 270.88
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 137.5, lastbuyprice_withDiscountAndTax = 266.75
                where buybilldetailid = 1556;
UPDATE productunit SET proUnitBuyPrice  = 275 * productnumber WHERE productid = 2288;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3681';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2288', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15557
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', '278', '202', '2280', '40.00', '260', '10400.00', '0.00', '', '2026-10-21 10:54:08', '2280','','','0','0','0','0','0',null,'260','10400','0','0','0','0','0','0','0','0','1'); -- id=1557
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
                    , 252.2, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 252.2,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6785
UPDATE product SET  productBuyPrice = "260" WHERE productId = 2280 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1557 ;
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 = '252.2',meanbuyprice = '260',meanbuyprice_withDiscount = '256.1' , 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='130',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='252.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 = '2280';
UPDATE buybilldetail SET  lastbuyprice = 260 , meanbuyprice = 260, lastbuyprice_withDiscount = 252.2, meanbuyprice_withDiscount = 256.1
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 252.2
                where buybilldetailid = 1557;
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2280;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3673';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2280', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15558
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', '278', '202', '2281', '40.00', '370', '14800.00', '0.00', '', '2026-10-21 10:54:08', '2281','','','0','0','0','0','0',null,'370','14800','0','0','0','0','0','0','0','0','1'); -- id=1558
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
                    , 358.9, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 358.9,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6786
UPDATE product SET  productBuyPrice = "370" WHERE productId = 2281 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1558 ;
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 = '358.9',meanbuyprice = '370',meanbuyprice_withDiscount = '364.45' , 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='185',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='358.9',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 = 358.9, meanbuyprice_withDiscount = 364.45
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 358.9
                where buybilldetailid = 1558;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 2281;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3674';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2281', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15559
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', '278', '202', '2282', '40.00', '360', '14400.00', '0.00', '', '2026-10-21 10:54:08', '2282','','','0','0','0','0','0',null,'360','14400','0','0','0','0','0','0','0','0','1'); -- id=1559
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
                    , 349.2, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 349.2,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6787
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2282 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1559 ;
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 = '349.2',meanbuyprice = '360',meanbuyprice_withDiscount = '354.6' , 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='180',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='349.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 = '2282';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 349.2, meanbuyprice_withDiscount = 354.6
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 349.2
                where buybilldetailid = 1559;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2282;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2282', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15560
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', '278', '202', '2283', '40.00', '360', '14400.00', '0.00', '', '2026-10-21 10:54:08', '2283','','','0','0','0','0','0',null,'360','14400','0','0','0','0','0','0','0','0','1'); -- id=1560
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
                    , 349.2, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 349.2,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6788
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2283 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1560 ;
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 = '349.2',meanbuyprice = '360',meanbuyprice_withDiscount = '354.6' , 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='180',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='349.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 = '2283';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 349.2, meanbuyprice_withDiscount = 354.6
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 349.2
                where buybilldetailid = 1560;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2283;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2283', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15561
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', '278', '202', '2284', '40.00', '350', '14000.00', '0.00', '', '2026-10-21 10:54:08', '2284','','','0','0','0','0','0',null,'350','14000','0','0','0','0','0','0','0','0','1'); -- id=1561
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
                    , 339.5, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 339.5,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6789
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2284 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1561 ;
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 = '339.5',meanbuyprice = '350',meanbuyprice_withDiscount = '344.75' , 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='175',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='339.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 = '2284';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 339.5, meanbuyprice_withDiscount = 344.75
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 339.5
                where buybilldetailid = 1561;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2284;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3677';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2284', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15562
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', '278', '202', '2285', '50.00', '320', '16000.00', '0.00', '', '2026-10-21 10:54:08', '2285','','','0','0','0','0','0',null,'320','16000','0','0','0','0','0','0','0','0','1'); -- id=1562
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
                    , 310.4, 50, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 310.4,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6790
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2285 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1562 ;
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 = '310.4',meanbuyprice = '320',meanbuyprice_withDiscount = '315.2' , 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='160',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='310.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 = '2285';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 310.4, meanbuyprice_withDiscount = 315.2
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 310.4
                where buybilldetailid = 1562;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2285;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3678';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2285', '1', '50', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '1', '2026-10-20 18:31:10','0','0'); -- id=15563
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', '278', '202', '2286', '40.00', '380', '15200.00', '0.00', '', '2026-10-21 10:54:08', '2286','','','0','0','0','0','0',null,'380','15200','0','0','0','0','0','0','0','0','1'); -- id=1563
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
                    , 368.6, 40, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 368.6,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6791
UPDATE product SET  productBuyPrice = "380" WHERE productId = 2286 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1563 ;
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 = '368.6',meanbuyprice = '380',meanbuyprice_withDiscount = '374.3' , 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='190',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='368.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 = '2286';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 368.6, meanbuyprice_withDiscount = 374.3
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 368.6
                where buybilldetailid = 1563;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 2286;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3679';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2286', '1', '40', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15564
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', '278', '202', '2287', '36.00', '350', '12600.00', '0.00', '', '2026-10-21 10:54:08', '2287','','','0','0','0','0','0',null,'350','12600','0','0','0','0','0','0','0','0','1'); -- id=1564
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
                    , 339.5, 36, 0, 0, 1, '2026-10-21 10:54:09')
                ON DUPLICATE KEY UPDATE buyprice = 339.5,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 10:54:09' ; -- id=6792
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2287 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1564 ;
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 = '339.5',meanbuyprice = '350',meanbuyprice_withDiscount = '344.75' , 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='175',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='339.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 = '2287';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 339.5, meanbuyprice_withDiscount = 344.75
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 339.5
                where buybilldetailid = 1564;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2287;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3680';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2287', '1', '36', '0', '278', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-20 18:31:10','0','0'); -- id=15565
DELETE FROM productserial WHERE billid = 274
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '119116',suppliercurrentDebtInCurrency= '119116' , userid = '1', supplierdate = '2026-10-21 10:54:08'   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', '119116', '0', 'اضافة فاتورة مشتريات', '278', '119116', '2026-10-21 10:54:08', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','122800','1','0','119116','119116','0',''); -- id=788
UPDATE dailyentry SET totalcreditor = '122800.00', totaldebtor = '122800.00', thedate = '2026-10-20', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-20 18:33:55', entryComment = 'اضافة فاتورة مشتريات رقم 274', fromFlag = '1',related='0',isopeningentry='0',operationId='274',operationDetailLink='buyBillController.php?do=details&id=274' WHERE id = '4011';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '122800.00', '122800.00', '2026-10-21', '1', '0', '4011', '2026-10-21 10:54:09','تم عكس القيد رقم 4011 ','1','0','0','0','0',''); -- id=4046
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4046', '382', '122800.00', '','0'); -- id=4048
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24632991.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4046', '686', '122800.00', '','0'); -- id=4152
UPDATE accountstree SET name = 'نيو تومي', customName = 'نيو تومي', customNameEn = 'نيو تومي', nameEn = 'نيو تومي', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-20 18:31:28' WHERE id = '686';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '119116', '119116', '2026-10-21', '1', '0', '0', '2026-10-21 10:54:09','اضافة فاتورة مشتريات رقم 278','1','0',null,'0','278','buyBillController.php?do=details&id=278'); -- id=4047
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4047', '382', '119116', '','0'); -- id=4153
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24752107.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 ('4047', '686', '119116', '','0'); -- id=4049
UPDATE accountstree SET name = 'نيو تومي', customName = 'نيو تومي', customNameEn = 'نيو تومي', nameEn = 'نيو تومي', parent = '81', accountNature = '1', theValue = '119116', 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='4047,0' where buybillid=278;
UPDATE product SET overAllAveragePrice = 252.2 WHERE productId = 2280;UPDATE product SET overAllAveragePrice = 358.9 WHERE productId = 2281;UPDATE product SET overAllAveragePrice = 349.2 WHERE productId = 2282;UPDATE product SET overAllAveragePrice = 349.2 WHERE productId = 2283;UPDATE product SET overAllAveragePrice = 339.5 WHERE productId = 2284;UPDATE product SET overAllAveragePrice = 310.4 WHERE productId = 2285;UPDATE product SET overAllAveragePrice = 368.6 WHERE productId = 2286;UPDATE product SET overAllAveragePrice = 339.5 WHERE productId = 2287;UPDATE product SET overAllAveragePrice = 266.75 WHERE productId = 2288;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:54:09', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=278'); -- id=16064
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:54:15', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16065
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-21 07:24:15";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:54:16', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16066
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 10:54:25', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=16067
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:24:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:54:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:54:41', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:25:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:55:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 10:55:00', '7', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=16069
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-21','','41', '7','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=204
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (204, 1,'2026-10-21 10:55:00',7)
                ON DUPLICATE KEY UPDATE catid = 204, edited = 1, sysdate = '2026-10-21 10:55:00', userid = 7; -- id=219
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '204', '1', '2026-10-21', '7', '0'); -- id=96
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:25:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:55:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 10:55:00', '7', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=16070
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:25:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:55:02", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 10:55:02', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=16071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:25:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:55:18", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:55:18', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16072
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:25:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:55:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:55:22', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:27:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:57:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:57:01', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16074
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 ('شروال  فيوتشر','','204','280','300','0','0','2026-10-21','0','7','0','','0','0','0','0','0','280','280','280','280','280','0','7.14','0','0','.','0','0','0','280','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','280','280','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','280','0','0','0','0','0','0','','','0','0','0','0'); -- id=2307
UPDATE product SET productName = 'شروال  فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '280', productSellAllPrice = '300', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02307',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '280',meanbuyprice_withDiscount = '280' , productbuypricereal = '280' , buypricereal_precentage = '0' , buytotal_precentage = '7.14' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',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='280',meanbuyprice_withTax='280',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2307';
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', '2307', '1.00', '2026-10-21', '7', '0','0230701','300','0','0','280','','0','0','0','0','0','0','0','0','0','0'); -- id=2307
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2307', '1', '0', '7', '2026-10-21'); -- id=3700
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2307', '1', '0', '0', '2307', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15566
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2307, 1,'2026-10-21 10:57:01',7)
                ON DUPLICATE KEY UPDATE productid = 2307, edited = 1, sysdate = '2026-10-21 10:57:01', userid = 7; -- id=3386
UPDATE product SET productName = 'شروال  فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '280.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02307',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '280',meanbuyprice_withDiscount = '280' , productbuypricereal = '280' , buypricereal_precentage = '0' , buytotal_precentage = '7.14' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',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='280',meanbuyprice_withTax='280',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2307';
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 ('نص سوستة فيوتشر','','204','260','260','0','0','2026-10-21','0','7','0','','0','0','0','0','0','260','260','260','260','260','0','0','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=2308
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '260', productSellAllPrice = '260', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02308',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 = '0' , 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 = '2308';
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', '2308', '1.00', '2026-10-21', '7', '0','0230801','260','0','0','260','','0','0','0','0','0','0','0','0','0','0'); -- id=2308
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2308', '1', '0', '7', '2026-10-21'); -- id=3701
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '0', '0', '2308', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15567
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2308, 1,'2026-10-21 10:57:01',7)
                ON DUPLICATE KEY UPDATE productid = 2308, edited = 1, sysdate = '2026-10-21 10:57:01', userid = 7; -- id=3387
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '260.00', productSellAllPrice = '260.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02308',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 = '0' , 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 = '2308';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:27:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:57:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:57:03', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16075
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:27:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:57:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:57:05', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:28:09";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:28:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:58:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 10:58:13', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16077
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-21 07:28:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 10:58:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 10:58:13', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:28:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:58:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:58:15', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:28:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:58:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:58:18', '2', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1130'); -- id=16080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:28:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:58:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:58:21', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:59:12', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16082

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8709d4eb47
-- ----------------------------------------------------------------------------------------------------

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-21 10:59:12', '06ad8709d4eb47', '1', '0.00', '0', '0', '1', '5325.00', '5325', '5325', '0', '1', '2026-10-21 10:59:12', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','5325','0','','0','0','5325','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1135
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','اضافة فاتورة مبيعات','1135', '0', '2026-10-21 10:59:12', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5325', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 10:59:12','0','0','',''); -- id=1356
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 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', '1135', '40', '1133', '5', '295', '1475', '0', '', '0', '2026-10-21 10:59:12', '1133', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6711-5,','1','1','0','0','295','1475','0','','0','0.00','0','0','0','0'); -- id=4548
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 = 4548;
 INSERT INTO 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-21', 1475, 1325, 1325
                    , 1327.4, 1325, 1327.4, 1325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1325, 1327.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1475, sellCostBuyPrice =sellCostBuyPrice+1325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1327.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1327.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1327.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1475, 1325, 1325
                    , 1327.4, 1325, 1327.4, 1325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1325, 1327.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1475, sellCostBuyPrice =sellCostBuyPrice+1325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1327.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1327.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1327.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '790', userid = '2', storedetaildate = '2026-10-21 10:59:12' WHERE storedetailid = '1133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1133', '1', '5', '1', '1135', 'اضافة فاتورة مبيعات', 'sellbillController.php', '795', '790', '2', '2026-10-21 10:59:12','0','0'); -- id=15568
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09511', '1135', '19', '841', '5', '450', '2250', '0', '', '0', '2026-10-21 10:59:12', '841', '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=4549
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 = 4549;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (841, '2026-10-21', 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-21', 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-21 10:59:12' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '5', '1', '1135', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '40', '2', '2026-10-21 10:59:12','0','0'); -- id=15569
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6710;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','05291', '1135', '40', '1125', '5', '320', '1600', '0', '', '0', '2026-10-21 10:59:12', '1125', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6710-5,','1','1','0','0','320','1600','0','','0','0.00','0','0','0','0'); -- id=4550
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.32, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.32
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280.32, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 4550;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1125, '2026-10-21', 1600, 1400, 1400
                    , 1401.6, 1400, 1401.6, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1400, 1401.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1401.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1401.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1401.6
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1600, 1400, 1400
                    , 1401.6, 1400, 1401.6, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1400, 1401.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1401.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1401.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1401.6
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '727', userid = '2', storedetaildate = '2026-10-21 10:59:12' WHERE storedetailid = '1125';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '1', '5', '1', '1135', 'اضافة فاتورة مبيعات', 'sellbillController.php', '732', '727', '2', '2026-10-21 10:59:12','0','0'); -- id=15570
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6863408.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 ('6858083.5','5325', '0', '2', 'اضافة فاتورة مبيعات', '1135', '6863408.5', '2026-10-21 10:59:12', '2',  'sellbillController.php','1','','0'); -- id=1412
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5325', '5325', '2026-10-21', '2', '0', '0', '2026-10-21 10:59:12','اضافة فاتورة مبيعات رقم 1135','1','0',null,'0','1135','sellbillController.php?do=showDetail&sellbillid=1135'); -- id=4048
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4048', '419', '5325', '','0'); -- id=4154
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6863408', 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 ('4048', '143', '5325', '','0'); -- id=4050
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12777555', 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 ( '4875', '4875', '2026-10-21', '2', '0', '0', '2026-10-21 10:59:12','اضافة فاتورة مبيعات رقم 1135 - صرف البضاعة من المخزن','1','0',null,'0','1135','sellbillController.php?do=showDetail&sellbillid=1135'); -- id=4049
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4049', '402', '4875', '','0'); -- id=4155
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11823422.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 ('4049', '382', '4875', '','0'); -- id=4051
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24747232.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='4048,0,4049' where sellbillid=1135;
 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-21', 5325, 4875, 4875
                    , 4879, 4875, 4879, 4875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4875, 4879, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+4875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4879
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4879
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4879
                        , returnSellVal = returnSellVal+0, 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-21', 5325, 4875, 4875
                    , 4879, 4875, 4879, 4875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4875, 4879, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+4875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4879
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4879
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4879
                        , returnSellVal = returnSellVal+0, 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, 5325, 4875, 4875
                    , 4879, 4875, 4879, 4875, 4875, 4879)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5325, netSellCostBuyPrice = netSellCostBuyPrice+4875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4879
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4879
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4879;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8709d4eb47 and sellbillId = 1135 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 10:59:12', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16083
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:59:31', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16084
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 ('06ad87051f0301', '2026-10-21 10:57:05', '177', '27680.00', '110080', '0', '0', '82400.00',  '82400.00', '0', '82400', '1', '2026-10-21 10:59:31', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=279
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 ('02307', '279', '204', '2307', '144', '280', '40320.00', '0', '', '2026-10-21 10:59:31', '2307','','','0','0','0','0','0',null,'280','40320','0','0','0','0','0','0','0','0','1'); -- id=1565
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2307, 0, 0
                    , 280, 144, 0, 0, 7, '2026-10-21 10:59:31')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:59:31' ; -- id=6846
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2307', '280', '144', '0', 'buyBillController.php', '1565', '', '0', '0'); -- id=1149
UPDATE product SET  productBuyPrice = "280" WHERE productId = 2307 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1565 ;
UPDATE product SET productName = 'شروال  فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '280.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02307',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '280',meanbuyprice_withDiscount = '280' , productbuypricereal = '280.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.14' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',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='280',meanbuyprice_withTax='280',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2307';
UPDATE buybilldetail SET  lastbuyprice = 280 , meanbuyprice = 280, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 280
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 1565;
UPDATE productunit SET proUnitBuyPrice  = 280 * productnumber WHERE productid = 2307;
UPDATE storedetail SET  productquantity = '144', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2307', '1', '144', '0', '279', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '144', '7', '2026-10-21 10:57:05','0','0'); -- id=15571
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 ('02308', '279', '204', '2308', '108', '260', '28080.00', '0', '', '2026-10-21 10:59:31', '2308','','','0','0','0','0','0',null,'260','28080','0','0','0','0','0','0','0','0','1'); -- id=1566
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2308, 0, 0
                    , 260, 108, 0, 0, 7, '2026-10-21 10:59:31')
                ON DUPLICATE KEY UPDATE buyprice = 260,
                        buyQuantity =buyQuantity+108, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:59:31' ; -- id=6847
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2308', '260', '108', '0', 'buyBillController.php', '1566', '', '0', '0'); -- id=1150
UPDATE product SET  productBuyPrice = "260" WHERE productId = 2308 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1566 ;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '260.00', productSellAllPrice = '260.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02308',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 = '0.00' , 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 = '2308';
UPDATE buybilldetail SET  lastbuyprice = 260 , meanbuyprice = 260, lastbuyprice_withDiscount = 260, meanbuyprice_withDiscount = 260
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where buybilldetailid = 1566;
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2308;
UPDATE storedetail SET  productquantity = '108', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '108', '0', '279', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '108', '7', '2026-10-21 10:57:05','0','0'); -- id=15572
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 ('02057', '279', '169', '2057', '100', '140', '14000.00', '0', '', '2026-10-21 10:59:31', '2057','','','0','0','0','0','0',null,'140','14000','0','0','0','0','0','0','0','0','1'); -- id=1567
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2057, 0, 0
                    , 140, 100, 0, 0, 7, '2026-10-21 10:59:31')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 10:59:31' ; -- id=6848
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2057', '140', '100', '0', 'buyBillController.php', '1567', '', '0', '0'); -- id=1151
UPDATE product SET  productBuyPrice = "140" WHERE productId = 2057 ;
UPDATE buybilldetail SET  quantitybefore = 51 WHERE buybilldetailid = 1567 ;
UPDATE product SET productName = 'بدي قطن دريب فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '140.00', productSellAllPrice = '150.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02057',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140',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='140',meanbuyprice_withTax='140',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='140',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2057';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 140, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 140
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 1567;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 2057;
UPDATE storedetail SET  productquantity = '151', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2057', '1', '100', '0', '279', 'اضافة فاتورة مشتريات', 'buyBillController.php', '51', '151', '7', '2026-10-21 10:57:05','0','0'); -- id=15573
UPDATE supplier SET  suppliercurrentDebt = '110080',suppliercurrentDebtInCurrency= '110080' , userid = '7', supplierdate = '2026-10-21 10:59:31'   WHERE supplierid = '177';
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', '27680.00', '82400', '0', 'اضافة فاتورة مشتريات', '279', '110080', '2026-10-21 10:57:05', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','82400','1','27680','82400','110080','0',''); -- id=789
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82400', '82400', '2026-10-21', '7', '0', '0', '2026-10-21 10:59:31','اضافة فاتورة مشتريات رقم 279','1','0',null,'0','279','buyBillController.php?do=details&id=279'); -- id=4050
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4050', '382', '82400', '','0'); -- id=4156
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24829632.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 ('4050', '660', '82400', '','0'); -- id=4052
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '110080', 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';
update buybill set dailyentryid='4050,0' where buybillid=279;
COMMIT;
UPDATE product SET overAllAveragePrice = 140 WHERE productId = 2057;UPDATE product SET overAllAveragePrice = 280 WHERE productId = 2307;UPDATE product SET overAllAveragePrice = 260 WHERE productId = 2308;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 10:59:31', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=279'); -- id=16085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 10:59:39', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=279&type=2'); -- id=16086
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:29:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 10:59:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 10:59:47', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16087
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:35:05";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:36:38";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:36:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:06:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 11:06:50', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16088
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-21 07:36:51";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 11:06:51", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 11:06:51', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:36:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:06:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:06:52', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:37:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:07:48", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 11:07:48', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:37:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:07:49", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:07:49', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:37:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:07:55", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:07:55', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16093
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:44:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:14:06", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:14:06', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16094

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad872d5d6aca
-- ----------------------------------------------------------------------------------------------------

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-21 11:14:06', '06ad872d5d6aca', '1', '0.00', '0', '0', '1', '8940.00', '8940', '8940', '0', '1', '2026-10-21 11:14:06', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','8940','0','','0','0','8940','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1136
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','اضافة فاتورة مبيعات','1136', '0', '2026-10-21 11:14:06', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8940', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 11:14:06','0','0','',''); -- id=1357
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', '1136', '199', '2260', '3', '465', '1395', '0', '', '0', '2026-10-21 11:14:06', '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=4551
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 = 4551;
 INSERT INTO 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-21', 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-21', 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 = '33', userid = '6', storedetaildate = '2026-10-21 11:14:06' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '3', '1', '1136', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '33', '6', '2026-10-21 11:14:06','0','0'); -- id=15574
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', '1136', '191', '2252', '12', '370', '4440', '0', '', '0', '2026-10-21 11:14:06', '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=4552
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 = 4552;
 INSERT INTO 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-21', 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-21', 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 = '110', userid = '6', storedetaildate = '2026-10-21 11:14:06' WHERE storedetailid = '3643';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2252', '1', '12', '1', '1136', 'اضافة فاتورة مبيعات', 'sellbillController.php', '122', '110', '6', '2026-10-21 11:14:06','0','0'); -- id=15575
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1136', '191', '2203', '9', '345', '3105', '0', '', '0', '2026-10-21 11:14:06', '2203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6479-9,','1','1','0','0','345','3105','0','','0','0.00','0','0','0','0'); -- id=4553
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 = 4553;
 INSERT INTO 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-21', 3105, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3105, 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+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-21', 3105, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3105, 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 = '18', userid = '6', storedetaildate = '2026-10-21 11:14:06' WHERE storedetailid = '3592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2203', '1', '9', '1', '1136', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '18', '6', '2026-10-21 11:14:06','0','0'); -- id=15576
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '954385',  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 ('945445','8940', '0', '4', 'اضافة فاتورة مبيعات', '1136', '954385', '2026-10-21 11:14:06', '6',  'sellbillController.php','1','','0'); -- id=1413
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8940', '8940', '2026-10-21', '6', '0', '0', '2026-10-21 11:14:06','اضافة فاتورة مبيعات رقم 1136','1','0',null,'0','1136','sellbillController.php?do=showDetail&sellbillid=1136'); -- id=4051
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4051', '568', '8940', '','0'); -- id=4157
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '954385', 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 ('4051', '143', '8940', '','0'); -- id=4053
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12786495', 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 ( '7470', '7470', '2026-10-21', '6', '0', '0', '2026-10-21 11:14:06','اضافة فاتورة مبيعات رقم 1136 - صرف البضاعة من المخزن','1','0',null,'0','1136','sellbillController.php?do=showDetail&sellbillid=1136'); -- id=4052
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4052', '402', '7470', '','0'); -- id=4158
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11830892.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 ('4052', '382', '7470', '','0'); -- id=4054
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24822162.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='4051,0,4052' where sellbillid=1136;
 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-21', 8940, 7470, 7470
                    , 7470, 7470, 7470, 7470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7470, 7470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8940, sellCostBuyPrice =sellCostBuyPrice+7470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7470
                        , returnSellVal = returnSellVal+0, 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-21', 8940, 7470, 7470
                    , 7470, 7470, 7470, 7470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7470, 7470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8940, sellCostBuyPrice =sellCostBuyPrice+7470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7470
                        , returnSellVal = returnSellVal+0, 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, 8940, 7470, 7470
                    , 7470, 7470, 7470, 7470, 7470, 7470)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8940, netSellCostBuyPrice = netSellCostBuyPrice+7470
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7470
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7470
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7470
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7470
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7470
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7470
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7470;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad872d5d6aca and sellbillId = 1136 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:44:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:14:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:14:07', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16095
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:55:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:25:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:25:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16096
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:56:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:26:52", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:26:52', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16097

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad86f9a853b5
-- ----------------------------------------------------------------------------------------------------

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-21 11:26:52', '06ad86f9a853b5', '1', '0.00', '0', '0', '1', '2975.00', '2975', '2975', '0', '1', '2026-10-21 11:26:52', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2975','0','','0','0','2975','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1137
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','اضافة فاتورة مبيعات','1137', '0', '2026-10-21 11:26:52', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2975', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 11:26:52','0','0','',''); -- id=1358
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1137', '175', '2088', '5', '595', '2975', '0', '', '0', '2026-10-21 11:26:52', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-5,','1','1','0','0','595','2975','0','','0','0.00','0','0','0','0'); -- id=4554
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 = 4554;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1141', userid = '6', storedetaildate = '2026-10-21 11:26:52' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '5', '1', '1137', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1146', '1141', '6', '2026-10-21 11:26:52','0','0'); -- id=15577
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '957360',  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 ('954385','2975', '0', '4', 'اضافة فاتورة مبيعات', '1137', '957360', '2026-10-21 11:26:52', '6',  'sellbillController.php','1','','0'); -- id=1414
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2975', '2975', '2026-10-21', '6', '0', '0', '2026-10-21 11:26:52','اضافة فاتورة مبيعات رقم 1137','1','0',null,'0','1137','sellbillController.php?do=showDetail&sellbillid=1137'); -- id=4053
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4053', '568', '2975', '','0'); -- id=4159
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '957360', 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 ('4053', '143', '2975', '','0'); -- id=4055
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12789470', 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 ( '2300', '2300', '2026-10-21', '6', '0', '0', '2026-10-21 11:26:52','اضافة فاتورة مبيعات رقم 1137 - صرف البضاعة من المخزن','1','0',null,'0','1137','sellbillController.php?do=showDetail&sellbillid=1137'); -- id=4054
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4054', '402', '2300', '','0'); -- id=4160
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11833192.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 ('4054', '382', '2300', '','0'); -- id=4056
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24819862.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='4053,0,4054' where sellbillid=1137;
 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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, 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300, 2300, 2300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2975, netSellCostBuyPrice = netSellCostBuyPrice+2300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad86f9a853b5 and sellbillId = 1137 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:56:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:26:52", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:26:52', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16098
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:57:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:27:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 11:27:00', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16099
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-21 07:57:00";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 11:27:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 11:27:00', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16100
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 07:57:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:27:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:27:02', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:01:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:31:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:31:40', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16102
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:02:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:32:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:32:08', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16103
UPDATE productunit SET proUnitSellAllPrice  = 28000 * productnumber  WHERE productid = 2308;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '260.00', productSellAllPrice = '28000', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02308',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.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='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 = '2308';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2308, 1,'2026-10-21 11:32:22',7)
                ON DUPLICATE KEY UPDATE productid = 2308, edited = 1, sysdate = '2026-10-21 11:32:22', userid = 7; -- id=3387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:02:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:32:27", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:32:27', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16104
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:03:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:33:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:33:09', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16105
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:03:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:33:18", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:33:18', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16106
UPDATE productunit SET proUnitSellAllPrice  = 280.00 * productnumber  WHERE productid = 2308;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '260.00', productSellAllPrice = '280.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02308',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.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='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 = '2308';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2308, 1,'2026-10-21 11:33:27',7)
                ON DUPLICATE KEY UPDATE productid = 2308, edited = 1, sysdate = '2026-10-21 11:33:27', userid = 7; -- id=3387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:03:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:33:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:33:32', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:03:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:33:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:33:57', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:08:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:38:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:38:11', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:09:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:39:20", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:39:20', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16110
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:16:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:46:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:46:22', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=276&type=2'); -- id=16111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:18:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:48:15", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:48:15', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16112
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:18:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:48:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:48:30', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:18:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:48:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:48:40', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16114
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1684, 1,'2026-10-21 11:51:38',7)
                ON DUPLICATE KEY UPDATE productid = 1684, edited = 1, sysdate = '2026-10-21 11:51:38', userid = 7; -- id=2523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:21:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:51:56", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:51:56', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16115
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:22:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:52:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 11:52:26', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16116
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-21 08:22:26";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 11:52:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 11:52:26', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:22:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:52:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:52:28', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:22:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:52:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:52:37', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16119
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 ('شروال ميلتون الدولي','','68','360','375','0','0','2026-10-21','0','7','0','','0','0','0','0','0','360','360','360','360','360','0','4.17','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','0','0','0','0','0','-1','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=2309
UPDATE product SET productName = 'شروال ميلتون الدولي', productDescription = '', productCatId = '68', productBuyPrice = '360', productSellAllPrice = '375', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02309',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 = '4.17' , 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='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 = '2309';
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', '2309', '1', '2026-10-21', '7', '0','0230901','375','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2309
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2309', '1', '0', '7', '2026-10-21'); -- id=3702
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2309', '1', '0', '0', '2309', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15578
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2309, 1,'2026-10-21 11:52:37',7)
                ON DUPLICATE KEY UPDATE productid = 2309, edited = 1, sysdate = '2026-10-21 11:52:37', userid = 7; -- id=3391
UPDATE product SET productName = 'شروال ميلتون الدولي', productDescription = '', productCatId = '68', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02309',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 = '4.17' , 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='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 = '2309';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:22:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:52:38", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:52:38', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:22:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:52:41", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 11:52:41', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16121
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:24:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:54:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:54:11', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:24:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:54:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:54:19', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16123
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1684, 1,'2026-10-21 11:55:03',7)
                ON DUPLICATE KEY UPDATE productid = 1684, edited = 1, sysdate = '2026-10-21 11:55:03', userid = 7; -- id=2523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:25:22";
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-21 08:25:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:55:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 11:55:24', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16124
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-21 08:25:24";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 11:55:24', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16125
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:25:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:55:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 11:55:26', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16126
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1684, 1,'2026-10-21 11:55:32',7)
                ON DUPLICATE KEY UPDATE productid = 1684, edited = 1, sysdate = '2026-10-21 11:55:32', userid = 7; -- id=2523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:25:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:55:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 11:55:32', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16127
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1684, 1,'2026-10-21 11:55:49',7)
                ON DUPLICATE KEY UPDATE productid = 1684, edited = 1, sysdate = '2026-10-21 11:55:49', userid = 7; -- id=2523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:25:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:55:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 11:55:59', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16128
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 ('06ad87d5968d4c', '2026-10-21 11:52:41', '7', '217745.00', '242925', '0', '0', '25180.00',  '25180.00', '0', '25180', '1', '2026-10-21 11:55:59', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=280
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 ('02309', '280', '68', '2309', '36', '360', '12960.00', '0', '', '2026-10-21 11:55:59', '2309','','','0','0','0','0','0',null,'360','12960','0','0','0','0','0','0','0','0','1'); -- id=1568
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 11:52:41', 1, 2309, 0, 0
                    , 360, 36, 0, 0, 7, '2026-10-21 11:55:59')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 11:55:59' ; -- id=6849
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2309', '360', '36', '0', 'buyBillController.php', '1568', '', '0', '0'); -- id=1152
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2309 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1568 ;
UPDATE product SET productName = 'شروال ميلتون الدولي', productDescription = '', productCatId = '68', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02309',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 = '4.17' , 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='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 = '2309';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1568;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2309;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3702';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2309', '1', '36', '0', '280', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 11:52:41','0','0'); -- id=15579
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 ('01684', '280', '68', '1684', '28', '235', '6580.00', '0', '', '2026-10-21 11:55:59', '1684','','','0','0','0','0','0',null,'235','6580','0','0','0','0','0','0','0','0','1'); -- id=1569
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 11:52:41', 1, 1684, 0, 0
                    , 235, 28, 0, 0, 7, '2026-10-21 11:55:59')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 11:55:59' ; -- id=6850
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1684', '235', '28', '0', 'buyBillController.php', '1569', '', '0', '0'); -- id=1153
UPDATE product SET  productBuyPrice = "235" WHERE productId = 1684 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1569 ;
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 1569;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 1684;
UPDATE storedetail SET  productquantity = '28', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2696';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1684', '1', '28', '0', '280', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '7', '2026-10-21 11:52:41','0','0'); -- id=15580
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 ('01684', '280', '68', '1684', '24', '235', '5640.00', '0', '', '2026-10-21 11:55:59', '1684','','','0','0','0','0','0',null,'235','5640','0','0','0','0','0','0','0','0','1'); -- id=1570
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 11:52:41', 1, 1684, 0, 0
                    , 235, 24, 0, 0, 7, '2026-10-21 11:55:59')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 11:55:59' ; -- id=6850
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1684', '235', '24', '0', 'buyBillController.php', '1570', '', '0', '0'); -- id=1154
UPDATE product SET  productBuyPrice = "235" WHERE productId = 1684 ;
UPDATE buybilldetail SET  quantitybefore = 28 WHERE buybilldetailid = 1570 ;
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 1570;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 1684;
UPDATE storedetail SET  productquantity = '52', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2696';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1684', '1', '24', '0', '280', 'اضافة فاتورة مشتريات', 'buyBillController.php', '28', '52', '7', '2026-10-21 11:52:41','0','0'); -- id=15581
UPDATE supplier SET  suppliercurrentDebt = '242925',suppliercurrentDebtInCurrency= '242925' , userid = '7', supplierdate = '2026-10-21 11:55:59'   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', '25180', '0', 'اضافة فاتورة مشتريات', '280', '242925', '2026-10-21 11:52:41', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','25180','1','217745','25180','242925','0',''); -- id=790
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '25180', '25180', '2026-10-21', '7', '0', '0', '2026-10-21 11:55:59','اضافة فاتورة مشتريات رقم 280','1','0',null,'0','280','buyBillController.php?do=details&id=280'); -- id=4055
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4055', '382', '25180', '','0'); -- id=4161
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24845042.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 ('4055', '426', '25180', '','0'); -- id=4057
UPDATE accountstree SET name = 'خالد الدولي - مورد', customName = 'خالد الدولي - مورد', customNameEn = 'خالد الدولي - مورد', nameEn = 'خالد الدولي - مورد', parent = '81', accountNature = '1', theValue = '54280', 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='4055,0' where buybillid=280;
COMMIT;
UPDATE product SET overAllAveragePrice = 235 WHERE productId = 1684;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2309;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:25:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:55:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 11:55:59', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=280'); -- id=16129
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 11:56:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=16130
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:05', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=280&type=2'); -- id=16131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:09', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16132
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:18', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:23', '1', 'edit', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=2308'); -- id=16134
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:37', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=16135
BEGIN;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '169', productBuyPrice = '260', productSellAllPrice = '280', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02308',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '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='0',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 = '2308';
UPDATE product SET treeId = 0 WHERE productId = 2308;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 2308;
UPDATE productunit SET unitid = '1', productid = '2308', productnumber = '1.00', productunitdate = '2026-10-21', userid = '1', conditions = '0',proUnitParcode='0230801',proUnitSellAllPrice='280',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='260',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '2308';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2308, 1,'2026-10-21 11:56:37',1)
                ON DUPLICATE KEY UPDATE productid = 2308, edited = 1, sysdate = '2026-10-21 11:56:37', userid = 1; -- id=3387
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:56:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16136
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-21 11:56:46', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php'); -- id=16137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:56:58', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16138

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8478d5b782
-- ----------------------------------------------------------------------------------------------------

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-21 11:56:58', '06ad8478d5b782', '1', '0.00', '0', '0', '1', '14855.00', '14855', '14855', '0', '1', '2026-10-21 11:56:58', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '34' ,'0','','','','','-1','0','0','0','0','0','14855','0','','0','0','14855','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1138
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','اضافة فاتورة مبيعات','1138', '0', '2026-10-21 11:56:58', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '14855', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 11:56:58','0','0','',''); -- id=1359
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('435','09714', '1138', '11', '770', '5', '455', '2275', '0', '', '0', '2026-10-21 11:56:58', '770', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','455','2275','0','','0','0.00','0','0','0','0'); -- id=4555
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 4555;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (770, '2026-10-21', 2275, 2175, 2175
                    , 2175, 2175, 2175, 2175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2175, 2175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2275, sellCostBuyPrice =sellCostBuyPrice+2175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2275, 2175, 2175
                    , 2175, 2175, 2175, 2175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2175, 2175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2275, sellCostBuyPrice =sellCostBuyPrice+2175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '279', userid = '2', storedetaildate = '2026-10-21 11:56:58' WHERE storedetailid = '770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('770', '1', '5', '1', '1138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '284', '279', '2', '2026-10-21 11:56:58','0','0'); -- id=15582
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','09752', '1138', '28', '950', '5', '590', '2950', '0', '', '0', '2026-10-21 11:56:58', '950', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','590','2950','0','','0','0.00','0','0','0','0'); -- id=4556
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4556;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (950, '2026-10-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 11:56:58' WHERE storedetailid = '950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('950', '1', '5', '1', '1138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 11:56:58','0','0'); -- id=15583
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', '1138', '179', '2104', '9', '360', '3240', '0', '', '0', '2026-10-21 11:56:58', '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=4557
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 = 4557;
 INSERT INTO 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-21', 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-21', 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 = '108', userid = '2', storedetaildate = '2026-10-21 11:56:58' WHERE storedetailid = '3463';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2104', '1', '9', '1', '1138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '117', '108', '2', '2026-10-21 11:56:58','0','0'); -- id=15584
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6794;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02290', '1138', '179', '2290', '9', '390', '3510', '0', '', '0', '2026-10-21 11:56:58', '2290', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6794-9,','1','1','0','0','390','3510','0','','0','0.00','0','0','0','0'); -- id=4558
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 358.80, meanbuyprice_withDiscount = 358.80
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 358.8
                where sellbilldetailid = 4558;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2290, '2026-10-21', 3510, 3510, 3510
                    , 3510, 3229.2, 3229.2, 3229.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3510, 3510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3229.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3229.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3510, 3510, 3510
                    , 3510, 3229.2, 3229.2, 3229.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3510, 3510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3229.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3229.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 11:56:58' WHERE storedetailid = '3683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '9', '1', '1138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '27', '2', '2026-10-21 11:56:58','0','0'); -- id=15585
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6192;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01665', '1138', '124', '1665', '6', '480', '2880', '0', '', '0', '2026-10-21 11:56:58', '1665', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6192-6,','1','1','0','0','480','2880','0','','0','0.00','0','0','0','0'); -- id=4559
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 441.60
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 4559;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1665, '2026-10-21', 2880, 2880, 2880
                    , 2880, 2649.6, 2649.6, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2880, 2880, 2880
                    , 2880, 2649.6, 2649.6, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 11:56:58' WHERE storedetailid = '2677';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1665', '1', '6', '1', '1138', 'اضافة فاتورة مبيعات', 'sellbillController.php', '87', '81', '2', '2026-10-21 11:56:58','0','0'); -- id=15586
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6878263.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 ('6863408.5','14855', '0', '2', 'اضافة فاتورة مبيعات', '1138', '6878263.5', '2026-10-21 11:56:58', '2',  'sellbillController.php','1','','0'); -- id=1415
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '14855', '14855', '2026-10-21', '2', '0', '0', '2026-10-21 11:56:58','اضافة فاتورة مبيعات رقم 1138','1','0',null,'0','1138','sellbillController.php?do=showDetail&sellbillid=1138'); -- id=4056
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4056', '419', '14855', '','0'); -- id=4162
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6878263', 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 ('4056', '143', '14855', '','0'); -- id=4058
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12804325', 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 ( '13884.6', '13884.6', '2026-10-21', '2', '0', '0', '2026-10-21 11:56:58','اضافة فاتورة مبيعات رقم 1138 - صرف البضاعة من المخزن','1','0',null,'0','1138','sellbillController.php?do=showDetail&sellbillid=1138'); -- id=4057
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4057', '402', '13884.6', '','0'); -- id=4163
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11847077.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 ('4057', '382', '13884.6', '','0'); -- id=4059
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24831158.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='4056,0,4057' where sellbillid=1138;
 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-21', 14855, 14655, 14655
                    , 14655, 13884.6, 13884.6, 13884.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14655, 14655, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14855, sellCostBuyPrice =sellCostBuyPrice+14655
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14655, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14655
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13884.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13884.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13884.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14655
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14655
                        , returnSellVal = returnSellVal+0, 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-21', 14855, 14655, 14655
                    , 14655, 13884.6, 13884.6, 13884.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14655, 14655, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14855, sellCostBuyPrice =sellCostBuyPrice+14655
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14655, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14655
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13884.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13884.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13884.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14655
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14655
                        , returnSellVal = returnSellVal+0, 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, 14855, 14655, 14655
                    , 14655, 13884.6, 13884.6, 13884.6, 14655, 14655)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+14855, netSellCostBuyPrice = netSellCostBuyPrice+14655
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+14655
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+14655
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13884.6
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+13884.6
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+13884.6
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+14655
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14655;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8478d5b782 and sellbillId = 1138 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:26:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:56:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 11:56:59', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16139
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:27:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:57:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-21 11:57:03', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=add'); -- id=16140
BEGIN;
CALL insertUniqueOptNum(24,1,2,2305,24,'2026-10-21',1,0, '' , '' ,0,0,0,0,0,'2026-10-21 11:57:03',0,'',0,'','hide',0,@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3698';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21', 1, 2305, 0, 0
                    , 915.00, 24, 0, 0, 7, '2026-10-21 11:57:03')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 7,sysDate = '2026-10-21 11:57:03' ; -- id=6820
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2026-10-21*915.00," WHERE transferproductid = 1421;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2305', '1', '24', '1', '1421', 'تحويل منتجات من المخزن', 'storemovementController.php', '24', '0', '1', '2026-10-21','0','0'); -- id=15587
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2305', '2', '24', '1', '2026-10-21'); -- id=3703
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21', 2, 2305, 0, 0
                    , 915.00, 24, 0, 0, 1, '2026-10-21 11:57:03')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 11:57:03' ; -- id=6853
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2305', '2', '24', '0', '1421', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '24', '1', '2026-10-21','0','0'); -- id=15588
UPDATE storedetail SET inUse = 0 WHERE storedetailid=3698;
COMMIT;
BEGIN;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '21960', '21960', '2026-10-21', '1', '0', '0', '2026-10-21 11:57:03','تحويل من مخزن المخزن الرئيسي الى مخزن مخزن المحل','1','0',null,'0','24','storemovementController.php?do=show&operationnum=24'); -- id=4058
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4058', '492', '21960', '','0'); -- id=4164
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1598551', 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 ('4058', '382', '21960', '','0'); -- id=4060
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24809198.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';
COMMIT;
COMMIT;
UPDATE storemovement SET  dailyentryid =4058 WHERE operationnum = 24;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:27:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:57:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-21 11:57:03', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=sucess'); -- id=16141
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:27:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:57:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-21 11:57:05', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=16142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:27:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 11:57:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 11:57:54', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16143
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:30:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:00:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:00:29', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:30:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:00:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:00:39', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:36:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:06:55", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:06:55', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16146
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:38:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:08:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:08:23', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:38:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:08:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:08:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:38:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:08:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:08:29', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=279'); -- id=16149
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:38:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:08:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:08:45', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16150
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 279;
UPDATE buybill SET  buybillsysdate = '2026-10-21 12:08:45', userid = '7',delbyuserid = '1', conditions = '1' WHERE buybillid = '279';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2307, 0, 0
                    , 280, 144, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-144, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6846
UPDATE buybilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 280.00, meanbuyprice_withTax = 280.00, lastbuyprice_withDiscountAndTax = 280.00
                where buybilldetailid = 1565;
UPDATE product SET productName = 'شروال  فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '280.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02307',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '0',meanbuyprice = '280.00',meanbuyprice_withDiscount = '280' , productbuypricereal = '280.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.14' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',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='280',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 = '2307';
UPDATE productunit SET proUnitBuyPrice  = 280 * productnumber WHERE productid = 2307;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2307', '1', '144', '1', '279', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '144', '0', '1', '2026-10-21 10:57:05','0','0'); -- id=15589
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2308, 0, 0
                    , 260, 108, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-108, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6847
UPDATE buybilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260.00, meanbuyprice_withTax = 260.00, lastbuyprice_withDiscountAndTax = 260.00
                where buybilldetailid = 1566;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '169', productBuyPrice = '260.00', productSellAllPrice = '280.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02308',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260',lastbuyprice_withDiscount = '0',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='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='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='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 = '2308';
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2308;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '108', '1', '279', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '108', '0', '1', '2026-10-21 10:57:05','0','0'); -- id=15590
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2057, 0, 0
                    , 140, 100, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-100, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6848
UPDATE product SET productName = 'بدي قطن دريب فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '140.00', productSellAllPrice = '150.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02057',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140',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='140',meanbuyprice_withTax='140',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 = '2057';
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 2057;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2057', '1', '100', '1', '279', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '151', '51', '1', '2026-10-21 10:57:05','0','0'); -- id=15591
UPDATE supplier SET  suppliercurrentDebt = '27680',suppliercurrentDebtInCurrency= '27680' , userid = '1', supplierdate = '2026-10-21 12:08:45'   WHERE supplierid = '177';
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', '110080.00', '82400.00', '1', 'حذف فاتورة مشتريات - للتعديل', '279', '27680', '2026-10-21 10:57:05', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','82400','1','110080','82400','27680','0',''); -- id=791
UPDATE productserial SET del = 1
		 WHERE billid = 279;
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 ('06ad87051f0301', '2026-10-21 10:57:05', '177', '27680.00', '110080', '0', '0', '82400.00', '82400.00', '0.00', '82400', '1', '2026-10-21 12:08:45', '', '1', '0', '', '1', '1','1','279','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=281
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 ('02307', '281', '204', '2307', '144.00', '280', '40320.00', '0.00', '', '2026-10-21 12:08:45', '2307','','','0','0','0','0','0',null,'280','40320','0','0','0','0','0','0','0','0','1'); -- id=1571
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2307, 0, 0
                    , 280, 144, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6846
UPDATE product SET  productBuyPrice = "280" WHERE productId = 2307 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1571 ;
UPDATE product SET productName = 'شروال  فيوتشر', productDescription = '', productCatId = '204', productBuyPrice = '280.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02307',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '280',lastbuyprice_withDiscount = '280',meanbuyprice = '280',meanbuyprice_withDiscount = '280' , productbuypricereal = '280.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.14' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='280',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='280',meanbuyprice_withTax='140',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2307';
UPDATE buybilldetail SET  lastbuyprice = 280 , meanbuyprice = 280, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 280
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 1571;
UPDATE productunit SET proUnitBuyPrice  = 280 * productnumber WHERE productid = 2307;
UPDATE storedetail SET  productquantity = '144', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2307', '1', '144', '0', '281', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '144', '1', '2026-10-21 10:57:05','0','0'); -- id=15592
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 ('02308', '281', '169', '2308', '108.00', '260', '28080.00', '0.00', '', '2026-10-21 12:08:45', '2308','','','0','0','0','0','0',null,'260','28080','0','0','0','0','0','0','0','0','1'); -- id=1572
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2308, 0, 0
                    , 260, 108, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyprice = 260,
                        buyQuantity =buyQuantity+108, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6847
UPDATE product SET  productBuyPrice = "260" WHERE productId = 2308 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1572 ;
UPDATE product SET productName = 'نص سوستة فيوتشر', productDescription = '', productCatId = '169', productBuyPrice = '260.00', productSellAllPrice = '280.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02308',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260',lastbuyprice_withDiscount = '260',meanbuyprice = '260',meanbuyprice_withDiscount = '260' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='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='130',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='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 = '2308';
UPDATE buybilldetail SET  lastbuyprice = 260 , meanbuyprice = 260, lastbuyprice_withDiscount = 260, meanbuyprice_withDiscount = 260
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 260
                where buybilldetailid = 1572;
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2308;
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '108', '0', '281', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '108', '1', '2026-10-21 10:57:05','0','0'); -- id=15593
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 ('02057', '281', '169', '2057', '100.00', '140', '14000.00', '0.00', '', '2026-10-21 12:08:45', '2057','','','0','0','0','0','0',null,'140','14000','0','0','0','0','0','0','0','0','1'); -- id=1573
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 10:57:05', 1, 2057, 0, 0
                    , 140, 100, 0, 0, 1, '2026-10-21 12:08:45')
                ON DUPLICATE KEY UPDATE buyprice = 140,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:08:45' ; -- id=6848
UPDATE product SET  productBuyPrice = "140" WHERE productId = 2057 ;
UPDATE buybilldetail SET  quantitybefore = 51 WHERE buybilldetailid = 1573 ;
UPDATE product SET productName = 'بدي قطن دريب فيوتشر السلام', productDescription = '', productCatId = '169', productBuyPrice = '140.00', productSellAllPrice = '150.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02057',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '140',lastbuyprice_withDiscount = '140',meanbuyprice = '140',meanbuyprice_withDiscount = '140' , productbuypricereal = '120.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='140',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='140',meanbuyprice_withTax='140',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='140',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2057';
UPDATE buybilldetail SET  lastbuyprice = 140 , meanbuyprice = 140, lastbuyprice_withDiscount = 140, meanbuyprice_withDiscount = 140
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where buybilldetailid = 1573;
UPDATE productunit SET proUnitBuyPrice  = 140 * productnumber WHERE productid = 2057;
UPDATE storedetail SET  productquantity = '151', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2057', '1', '100', '0', '281', 'اضافة فاتورة مشتريات', 'buyBillController.php', '51', '151', '1', '2026-10-21 10:57:05','0','0'); -- id=15594
DELETE FROM productserial WHERE billid = 279
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '110080',suppliercurrentDebtInCurrency= '110080' , userid = '1', supplierdate = '2026-10-21 12:08:45'   WHERE supplierid = '177';
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', '27680.00', '82400', '0', 'اضافة فاتورة مشتريات', '281', '110080', '2026-10-21 12:08:45', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','82400','1','27680','82400','110080','0',''); -- id=792
UPDATE dailyentry SET totalcreditor = '82400.00', totaldebtor = '82400.00', thedate = '2026-10-21', userid = '7', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 10:59:31', entryComment = 'اضافة فاتورة مشتريات رقم 279', fromFlag = '1',related='0',isopeningentry='0',operationId='279',operationDetailLink='buyBillController.php?do=details&id=279' WHERE id = '4050';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82400.00', '82400.00', '2026-10-21', '1', '0', '4050', '2026-10-21 12:08:45','تم عكس القيد رقم 4050 ','1','0','0','0','0',''); -- id=4059
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4059', '382', '82400.00', '','0'); -- id=4061
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24726798.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4059', '660', '82400.00', '','0'); -- id=4165
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '27680', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82400', '82400', '2026-10-21', '1', '0', '0', '2026-10-21 12:08:45','اضافة فاتورة مشتريات رقم 281','1','0',null,'0','281','buyBillController.php?do=details&id=281'); -- id=4060
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4060', '382', '82400', '','0'); -- id=4166
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24809198.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 ('4060', '660', '82400', '','0'); -- id=4062
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '110080', 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';
update buybill set dailyentryid='4060,0' where buybillid=281;
UPDATE product SET overAllAveragePrice = 140 WHERE productId = 2057;UPDATE product SET overAllAveragePrice = 280 WHERE productId = 2307;UPDATE product SET overAllAveragePrice = 260 WHERE productId = 2308;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:38:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:08:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:08:45', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=281'); -- id=16151
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:51:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:21:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:21:30', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:52:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:22:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:22:57', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16153

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8841a166f4
-- ----------------------------------------------------------------------------------------------------

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-21 12:22:57', '06ad8841a166f4', '1', '0.00', '0', '0', '1', '560', '560', '-560', '0', '2', '2026-10-21 12:22:57', '', '4', '0', 'نقدي','3', '0', '5', '0', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-560','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=38
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','1','اضافة فاتورة مردوات مبيعات','38', '0', '2026-10-21 12:22:57', '4', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '560', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:22:57','0','0','',''); -- id=1360
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', '02096', '38', '177', '2096', '1', '560', '560', '0', '', '0', '0', '2096', '0.00', '-1','2','0','','','0','0','0','0','0','0','1','1','','0','0','560','560','0','','0'); -- id=56
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 = 56;
 INSERT INTO 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 560, 530, 530, 530
                    , 530, 530, 530, 0, 1, 0, 0, 530, 530)
                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+560, returnSellCostBuyPrice = returnSellCostBuyPrice+530, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+530
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+530, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+530
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+530
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+530
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+530
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+530
                        , 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 (2, '2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 560, 530, 530, 530
                    , 530, 530, 530, 0, 0, 530, 530)
                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+560, returnSellCostBuyPrice = returnSellCostBuyPrice+530, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+530
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+530, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+530
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+530
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+530
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+530
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+530;
UPDATE storedetail SET  productquantity = '1', userid = '4', storedetaildate = '2026-10-21 12:22:57' WHERE storedetailid = '3594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2096', '2', '1', '0', '38', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0', '1', '4', '2026-10-21 12:22:57','0','0'); -- id=15595
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1122832.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 ('1123392.875','-560', '1', '3', 'اضافة فاتورة مردوات مبيعات', '38', '1122832.875', '2026-10-21 12:22:57', '4',  'returnsellbillController.php','1','','0'); -- id=1416
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '560', '560', '2026-10-21', '4', '0', '0', '2026-10-21 12:22:57','اضافة فاتورة مردود مبيعات رقم 38','1','0',null,'0','38','returnsellbillController.php?do=showDetail&returnsellbillid=38'); -- id=4061
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4061', '143', '560', '','0'); -- id=4167
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12803765', 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 ('4061', '501', '560', '','0'); -- id=4063
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1122832.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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '530', '530', '2026-10-21', '4', '0', '0', '2026-10-21 12:22:57','اضافة فاتورة مردود مبيعات رقم 38 - صرف البضاعة من المخزن','1','0',null,'0','38','returnsellbillController.php?do=showDetail&returnsellbillid=38'); -- id=4062
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4062', '492', '530', '','0'); -- id=4168
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1599081', 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 ('4062', '402', '530', '','0'); -- id=4064
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11846547.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';
update returnsellbill set dailyentryid='4061,0,4062' where returnsellbillid=38;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 560, 530, 530, 530
                    , 530, 530, 530 ,0, 0, 530, 530)
                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+560, returnSellCostBuyPrice = returnSellCostBuyPrice+530, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+530
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+530, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+530
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+530
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+530
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+530
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+530;
 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 560, 530, 530, 530
                    , 530, 530, 530 ,0, 0, 530, 530)
                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+560, returnSellCostBuyPrice = returnSellCostBuyPrice+530, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+530
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+530, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+530
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+530
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+530
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+530
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+530;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -560, -530, -530
                    , -530, -530, -530, -530, -530, -530)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-560, netSellCostBuyPrice = netSellCostBuyPrice+-530
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-530
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-530
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-530
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-530
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-530
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-530
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-530;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:52:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:22:58", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:22:58', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:53:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:23:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:23:01', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:53:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:23:19", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:23:19', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16156

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8774cecd0a
-- ----------------------------------------------------------------------------------------------------

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-21 12:23:19', '06ad8774cecd0a', '1', '0.00', '0', '0', '1', '10000.00', '10000', '10000', '0', '1', '2026-10-21 12:23:19', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '19' ,'0','','','','','-1','0','0','0','0','0','10000','0','','0','0','10000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1139
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','اضافة فاتورة مبيعات','1139', '0', '2026-10-21 12:23:19', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:23:19','0','0','',''); -- id=1361
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1139', '175', '2088', '10', '595', '5950', '0', '', '0', '2026-10-21 12:23:19', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-10,','1','1','0','0','595','5950','0','','0','0.00','0','0','0','0'); -- id=4560
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 = 4560;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1131', userid = '6', storedetaildate = '2026-10-21 12:23:19' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '10', '1', '1139', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1141', '1131', '6', '2026-10-21 12:23:19','0','0'); -- id=15596
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6799;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02291', '1139', '203', '2291', '9', '450', '4050', '0', '', '0', '2026-10-21 12:23:19', '2291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6799-9,','1','1','0','0','450','4050','0','','0','0.00','0','0','0','0'); -- id=4561
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 = 4561;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2291, '2026-10-21', 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-21', 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 = '168', userid = '6', storedetaildate = '2026-10-21 12:23:19' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '9', '1', '1139', 'اضافة فاتورة مبيعات', 'sellbillController.php', '177', '168', '6', '2026-10-21 12:23:19','0','0'); -- id=15597
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '967360',  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 ('957360','10000', '0', '4', 'اضافة فاتورة مبيعات', '1139', '967360', '2026-10-21 12:23:19', '6',  'sellbillController.php','1','','0'); -- id=1417
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10000', '10000', '2026-10-21', '6', '0', '0', '2026-10-21 12:23:19','اضافة فاتورة مبيعات رقم 1139','1','0',null,'0','1139','sellbillController.php?do=showDetail&sellbillid=1139'); -- id=4063
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4063', '568', '10000', '','0'); -- id=4169
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '967360', 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 ('4063', '143', '10000', '','0'); -- id=4065
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12813765', 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 ( '8380', '8380', '2026-10-21', '6', '0', '0', '2026-10-21 12:23:19','اضافة فاتورة مبيعات رقم 1139 - صرف البضاعة من المخزن','1','0',null,'0','1139','sellbillController.php?do=showDetail&sellbillid=1139'); -- id=4064
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4064', '402', '8380', '','0'); -- id=4170
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11854927.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 ('4064', '382', '8380', '','0'); -- id=4066
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24800818.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='4063,0,4064' where sellbillid=1139;
 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-21', 10000, 8380, 8380
                    , 8380, 8380, 8380, 8380
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8380, 8380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+8380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8380
                        , returnSellVal = returnSellVal+0, 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-21', 10000, 8380, 8380
                    , 8380, 8380, 8380, 8380
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8380, 8380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+8380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8380
                        , returnSellVal = returnSellVal+0, 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, 10000, 8380, 8380
                    , 8380, 8380, 8380, 8380, 8380, 8380)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10000, netSellCostBuyPrice = netSellCostBuyPrice+8380
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8380
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8380
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8380
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8380
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8380
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8380
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8380;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8774cecd0a and sellbillId = 1139 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:53:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:23:20", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:23:20', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:00", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:24:00', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16158

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad88476197d6
-- ----------------------------------------------------------------------------------------------------

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-21 12:24:00', '06ad88476197d6', '1', '0.00', '0', '0', '1', '1260.00', '1260', '1260', '0', '2', '2026-10-21 12:24:00', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1260','0','','0','0','1260','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1140
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','اضافة فاتورة مبيعات','1140', '0', '2026-10-21 12:24:00', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1260', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:24:00','0','0','',''); -- id=1362
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6469;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02129', '1140', '182', '2129', '3', '420', '1260', '0', '', '0', '2026-10-21 12:24:00', '2129', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6469-3,','1','1','0','0','420','1260','0','','0','0.00','0','0','0','0'); -- id=4562
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 378.00, meanbuyprice_withDiscount = 378.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 378
                where sellbilldetailid = 4562;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2129, '2026-10-21', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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 (2, '2026-10-21', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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 = '21', userid = '4', storedetaildate = '2026-10-21 12:24:00' WHERE storedetailid = '3587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2129', '2', '3', '1', '1140', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '4', '2026-10-21 12:24:00','0','0'); -- id=15598
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1124092.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 ('1122832.875','1260', '0', '3', 'اضافة فاتورة مبيعات', '1140', '1124092.875', '2026-10-21 12:24:00', '4',  'sellbillController.php','1','','0'); -- id=1418
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1260', '1260', '2026-10-21', '4', '0', '0', '2026-10-21 12:24:00','اضافة فاتورة مبيعات رقم 1140','1','0',null,'0','1140','sellbillController.php?do=showDetail&sellbillid=1140'); -- id=4065
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4065', '501', '1260', '','0'); -- id=4171
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1124092.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 ('4065', '143', '1260', '','0'); -- id=4067
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12815025', 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 ( '1134', '1134', '2026-10-21', '4', '0', '0', '2026-10-21 12:24:00','اضافة فاتورة مبيعات رقم 1140 - صرف البضاعة من المخزن','1','0',null,'0','1140','sellbillController.php?do=showDetail&sellbillid=1140'); -- id=4066
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4066', '402', '1134', '','0'); -- id=4172
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11856061.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 ('4066', '492', '1134', '','0'); -- id=4068
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1597947', 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='4065,0,4066' where sellbillid=1140;
 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-21', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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;
 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-21', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134, 1260, 1260)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1260, netSellCostBuyPrice = netSellCostBuyPrice+1260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1134
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1134
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1134
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1260;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad88476197d6 and sellbillId = 1140 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:00", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:24:00', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16159
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:17", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 12:24:17', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 12:24:32', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16161
UPDATE product SET productName = 'موديلات الدولي 250', productDescription = '', productCatId = '68', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01684',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '235.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='235',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='235',meanbuyprice_withTax='235',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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1684';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1684, 1,'2026-10-21 12:24:34',7)
                ON DUPLICATE KEY UPDATE productid = 1684, edited = 1, sysdate = '2026-10-21 12:24:34', userid = 7; -- id=2523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:24:39', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:54:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:24:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 12:24:53', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=16163
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:55:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:25:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 12:25:33', '7', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=16164
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-21','','93', '7','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=205
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (205, 1,'2026-10-21 12:25:33',7)
                ON DUPLICATE KEY UPDATE catid = 205, edited = 1, sysdate = '2026-10-21 12:25:33', userid = 7; -- id=220
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '205', '1', '2026-10-21', '7', '0'); -- id=97
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:55:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:25:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 12:25:33', '7', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=16165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:55:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:25:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 12:25:35', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=16166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:55:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:25:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:25:37', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16167
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:56:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:26:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:26:23', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16168
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:58:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:28:44", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:28:44', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16169
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 ('موديلات 590 فلاش','','205','590','590','0','0','2026-10-21','0','7','0','','0','0','0','0','0','590','590','590','590','590','0','0','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=2310
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590', productSellAllPrice = '590', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',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 = '0' , 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 = '2310';
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', '2310', '1.00', '2026-10-21', '7', '0','0231001','590','0','0','590','','0','0','0','0','0','0','0','0','0','0'); -- id=2310
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2310', '1', '0', '7', '2026-10-21'); -- id=3704
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '0', '0', '2310', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15599
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2310, 1,'2026-10-21 12:28:44',7)
                ON DUPLICATE KEY UPDATE productid = 2310, edited = 1, sysdate = '2026-10-21 12:28:44', userid = 7; -- id=3397
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',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 = '0' , 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 = '2310';
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 ('موديلات 560 فلاش','','205','560','560','0','0','2026-10-21','0','7','0','','0','0','0','0','0','560','560','560','560','560','0','0','0','0','.','0','0','0','560','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','560','560','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','560','0','0','0','0','0','0','','','0','0','0','0'); -- id=2311
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560', productSellAllPrice = '560', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2311';
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', '2311', '1.00', '2026-10-21', '7', '0','0231101','560','0','0','560','','0','0','0','0','0','0','0','0','0','0'); -- id=2311
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2311', '1', '0', '7', '2026-10-21'); -- id=3705
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '0', '0', '2311', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15600
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2311, 1,'2026-10-21 12:28:44',7)
                ON DUPLICATE KEY UPDATE productid = 2311, edited = 1, sysdate = '2026-10-21 12:28:44', userid = 7; -- id=3398
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2311';
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 ('موديلات 490 فلاش','','205','490','490','0','0','2026-10-21','0','7','0','','0','0','0','0','0','490','490','490','490','490','0','0','0','0','.','0','0','0','490','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','490','490','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','490','0','0','0','0','0','0','','','0','0','0','0'); -- id=2312
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490', productSellAllPrice = '490', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2312';
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', '2312', '1.00', '2026-10-21', '7', '0','0231201','490','0','0','490','','0','0','0','0','0','0','0','0','0','0'); -- id=2312
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2312', '1', '0', '7', '2026-10-21'); -- id=3706
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '0', '0', '2312', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15601
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2312, 1,'2026-10-21 12:28:44',7)
                ON DUPLICATE KEY UPDATE productid = 2312, edited = 1, sysdate = '2026-10-21 12:28:44', userid = 7; -- id=3399
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2312';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:58:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:28:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:28:46', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:58:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:28:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:28:59', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16171
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', '7', '2026-10-21 12:29:10', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=201
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 ('201', '0', '', '0', 'إضافة مورد جديد', '201', '', '2026-10-21 12:29:10', '7', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=793
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', '', '7', '0', '2026-10-21 12:29:10'); -- id=688
UPDATE supplier SET suppliername = 'فلاش', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '7', supplierdate = '2026-10-21', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='688',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '201';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:59:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:29:38", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:29:38', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16172

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8848819657
-- ----------------------------------------------------------------------------------------------------

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-21 12:29:38', '06ad8848819657', '1', '0.00', '0', '0', '1', '2700.00', '2700', '2700', '0', '1', '2026-10-21 12:29:38', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2700','0','','0','0','2700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1141
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','اضافة فاتورة مبيعات','1141', '0', '2026-10-21 12:29:38', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2700', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:29:38','0','0','',''); -- id=1363
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6799;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02291', '1141', '203', '2291', '6', '450', '2700', '0', '', '0', '2026-10-21 12:29:38', '2291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6799-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4563
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 = 4563;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2291, '2026-10-21', 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-21', 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 = '162', userid = '6', storedetaildate = '2026-10-21 12:29:38' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '6', '1', '1141', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '162', '6', '2026-10-21 12:29:38','0','0'); -- id=15602
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '970060',  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 ('967360','2700', '0', '4', 'اضافة فاتورة مبيعات', '1141', '970060', '2026-10-21 12:29:38', '6',  'sellbillController.php','1','','0'); -- id=1419
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2700', '2700', '2026-10-21', '6', '0', '0', '2026-10-21 12:29:38','اضافة فاتورة مبيعات رقم 1141','1','0',null,'0','1141','sellbillController.php?do=showDetail&sellbillid=1141'); -- id=4067
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4067', '568', '2700', '','0'); -- id=4173
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '970060', 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 ('4067', '143', '2700', '','0'); -- id=4069
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12817725', 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 ( '2520', '2520', '2026-10-21', '6', '0', '0', '2026-10-21 12:29:38','اضافة فاتورة مبيعات رقم 1141 - صرف البضاعة من المخزن','1','0',null,'0','1141','sellbillController.php?do=showDetail&sellbillid=1141'); -- id=4068
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4068', '402', '2520', '','0'); -- id=4174
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11858581.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 ('4068', '382', '2520', '','0'); -- id=4070
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24798298.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='4067,0,4068' where sellbillid=1141;
 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-21', 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;
 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-21', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2700, 2520, 2520
                    , 2520, 2520, 2520, 2520, 2520, 2520)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2700, netSellCostBuyPrice = netSellCostBuyPrice+2520
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2520
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2520
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2520
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2520
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2520
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2520
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2520;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8848819657 and sellbillId = 1141 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 08:59:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:29:38", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:29:38', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:01:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:31:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:31:03', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:01:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:31:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:31:06', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16175
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:03:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:33:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:33:24', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16176
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 ('06ad8865a285da', '2026-10-21 12:31:06', '201', '0.00', '97317.6', '8', '1', '105780.00',  '97317.60', '0', '97317.6', '1', '2026-10-21 12:33:24', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=282
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 ('02310', '282', '205', '2310', '24', '590', '14160.00', '0', '', '2026-10-21 12:33:24', '2310','','','0','0','0','0','0',null,'590','14160','0','0','0','0','0','0','0','0','1'); -- id=1574
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 542.8, 24, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 542.8,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6860
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2310', '590', '24', '0', 'buyBillController.php', '1574', '', '0', '0'); -- id=1155
UPDATE product SET  productBuyPrice = "590" WHERE productId = 2310 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1574 ;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '542.8',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='590',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='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='542.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 = '2310';
UPDATE buybilldetail SET  lastbuyprice = 590 , meanbuyprice = 590, lastbuyprice_withDiscount = 542.8, meanbuyprice_withDiscount = 542.8
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 542.8
                where buybilldetailid = 1574;
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '24', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 12:31:06','0','0'); -- id=15603
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 ('02311', '282', '205', '2311', '30', '560', '16800.00', '0', '', '2026-10-21 12:33:24', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1575
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6861
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2311', '560', '30', '0', 'buyBillController.php', '1575', '', '0', '0'); -- id=1156
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1575 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1575;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 12:31:06','0','0'); -- id=15604
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 ('02310', '282', '205', '2310', '30', '590', '17700.00', '0', '', '2026-10-21 12:33:24', '2310','','','0','0','0','0','0',null,'590','17700','0','0','0','0','0','0','0','0','1'); -- id=1576
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 542.8, 30, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 542.8,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6860
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2310', '590', '30', '0', 'buyBillController.php', '1576', '', '0', '0'); -- id=1157
UPDATE product SET  productBuyPrice = "590" WHERE productId = 2310 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1576 ;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '542.8',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='590',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='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='542.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 = '2310';
UPDATE buybilldetail SET  lastbuyprice = 590 , meanbuyprice = 590, lastbuyprice_withDiscount = 542.8, meanbuyprice_withDiscount = 542.8
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 542.8
                where buybilldetailid = 1576;
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '54', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '30', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '54', '7', '2026-10-21 12:31:06','0','0'); -- id=15605
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 ('02311', '282', '205', '2311', '30', '560', '16800.00', '0', '', '2026-10-21 12:33:24', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1577
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6861
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2311', '560', '30', '0', 'buyBillController.php', '1577', '', '0', '0'); -- id=1158
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 30 WHERE buybilldetailid = 1577 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1577;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '60', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '30', '60', '7', '2026-10-21 12:31:06','0','0'); -- id=15606
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 ('02311', '282', '205', '2311', '30', '560', '16800.00', '0', '', '2026-10-21 12:33:24', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1578
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6861
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2311', '560', '30', '0', 'buyBillController.php', '1578', '', '0', '0'); -- id=1159
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1578 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1578;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '90', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '90', '7', '2026-10-21 12:31:06','0','0'); -- id=15607
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 ('02312', '282', '205', '2312', '24', '490', '11760.00', '0', '', '2026-10-21 12:33:24', '2312','','','0','0','0','0','0',null,'490','11760','0','0','0','0','0','0','0','0','1'); -- id=1579
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 450.8, 24, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6865
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2312', '490', '24', '0', 'buyBillController.php', '1579', '', '0', '0'); -- id=1160
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2312 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1579 ;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='490',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='490',meanbuyprice_withTax='490',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.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 = '2312';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1579;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '24', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 12:31:06','0','0'); -- id=15608
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 ('02312', '282', '205', '2312', '24', '490', '11760.00', '0', '', '2026-10-21 12:33:24', '2312','','','0','0','0','0','0',null,'490','11760','0','0','0','0','0','0','0','0','1'); -- id=1580
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 450.8, 24, 0, 0, 7, '2026-10-21 12:33:24')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:33:24' ; -- id=6865
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2312', '490', '24', '0', 'buyBillController.php', '1580', '', '0', '0'); -- id=1161
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2312 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1580 ;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='490',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='490',meanbuyprice_withTax='490',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.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 = '2312';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1580;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '24', '0', '282', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '48', '7', '2026-10-21 12:31:06','0','0'); -- id=15609
UPDATE supplier SET  suppliercurrentDebt = '97317.6',suppliercurrentDebtInCurrency= '97317.6' , userid = '7', supplierdate = '2026-10-21 12:33:24'   WHERE supplierid = '201';
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 ('201', '0.00', '97317.6', '0', 'اضافة فاتورة مشتريات', '282', '97317.6', '2026-10-21 12:31:06', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','97317.6','1','0','97317.6','97317.6','0',''); -- id=794
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97317.6', '97317.6', '2026-10-21', '7', '0', '0', '2026-10-21 12:33:24','اضافة فاتورة مشتريات رقم 282','1','0',null,'0','282','buyBillController.php?do=details&id=282'); -- id=4069
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4069', '382', '97317.6', '','0'); -- id=4175
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24895615.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 ('4069', '688', '97317.6', '','0'); -- id=4071
UPDATE accountstree SET name = 'فلاش', customName = 'فلاش', customNameEn = 'فلاش', nameEn = 'فلاش', parent = '81', accountNature = '1', theValue = '97317.6', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '7', del = '0', sysdate = '2026-10-21 12:29:10' WHERE id = '688';
update buybill set dailyentryid='4069,0' where buybillid=282;
COMMIT;
UPDATE product SET overAllAveragePrice = 542.8 WHERE productId = 2310;UPDATE product SET overAllAveragePrice = 515.2 WHERE productId = 2311;UPDATE product SET overAllAveragePrice = 450.8 WHERE productId = 2312;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:03:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:33:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:33:24', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=282'); -- id=16177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:03:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:33:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:33:29', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=282&type=2'); -- id=16178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:05:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:35:57", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:35:57', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16179

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad886026ebb3
-- ----------------------------------------------------------------------------------------------------

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-21 12:35:57', '06ad886026ebb3', '1', '0.00', '0', '0', '1', '12690.00', '12690', '12690', '0', '1', '2026-10-21 12:35:57', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','12690','0','','0','0','12690','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1142
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','اضافة فاتورة مبيعات','1142', '0', '2026-10-21 12:35:57', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12690', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:35:57','0','0','',''); -- id=1364
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('675','01491', '1142', '108', '1491', '3', '700', '2100', '0', '', '0', '2026-10-21 12:35:57', '1491', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','948-3,','1','1','0','0','700','2100','0','','0','0.00','0','0','0','0'); -- id=4564
UPDATE sellbilldetail SET  lastbuyprice = 675.00 , meanbuyprice = 675.00, lastbuyprice_withDiscount = 675.00, meanbuyprice_withDiscount = 675.00
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where sellbilldetailid = 4564;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1491, '2026-10-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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
                        , 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-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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;
UPDATE storedetail SET  productquantity = '45', userid = '6', storedetaildate = '2026-10-21 12:35:57' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '3', '1', '1142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '45', '6', '2026-10-21 12:35:57','0','0'); -- id=15610
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6112;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02070', '1142', '170', '2070', '3', '450', '1350', '0', '', '0', '2026-10-21 12:35:57', '2070', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6112-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4565
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 = 4565;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2070, '2026-10-21', 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-21', 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 = '19', userid = '6', storedetaildate = '2026-10-21 12:35:57' WHERE storedetailid = '3429';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2070', '1', '3', '1', '1142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '19', '6', '2026-10-21 12:35:57','0','0'); -- id=15611
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', '1142', '143', '1851', '4', '770', '3080', '0', '', '0', '2026-10-21 12:35:57', '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=4566
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 = 4566;
 INSERT INTO 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-21', 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-21', 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 = '16', userid = '6', storedetaildate = '2026-10-21 12:35:57' WHERE storedetailid = '2868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '4', '1', '1142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '16', '6', '2026-10-21 12:35:57','0','0'); -- id=15612
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 889;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01842', '1142', '143', '1842', '4', '770', '3080', '0', '', '0', '2026-10-21 12:35:57', '1842', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','889-4,','1','1','0','0','770','3080','0','','0','0.00','0','0','0','0'); -- id=4567
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 = 4567;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1842, '2026-10-21', 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-21', 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-21 12:35:57' WHERE storedetailid = '2859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1842', '1', '4', '1', '1142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '6', '2026-10-21 12:35:57','0','0'); -- id=15613
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 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', '1142', '143', '1850', '4', '770', '3080', '0', '', '0', '2026-10-21 12:35:57', '1850', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','897-4,','1','1','0','0','770','3080','0','','0','0.00','0','0','0','0'); -- id=4568
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 = 4568;
 INSERT INTO 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-21', 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-21', 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 = '0', userid = '6', storedetaildate = '2026-10-21 12:35:57' WHERE storedetailid = '2867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '4', '1', '1142', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '6', '2026-10-21 12:35:57','0','0'); -- id=15614
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '982750',  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 ('970060','12690', '0', '4', 'اضافة فاتورة مبيعات', '1142', '982750', '2026-10-21 12:35:57', '6',  'sellbillController.php','1','','0'); -- id=1420
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12690', '12690', '2026-10-21', '6', '0', '0', '2026-10-21 12:35:57','اضافة فاتورة مبيعات رقم 1142','1','0',null,'0','1142','sellbillController.php?do=showDetail&sellbillid=1142'); -- id=4070
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4070', '568', '12690', '','0'); -- id=4176
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '982750', 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 ('4070', '143', '12690', '','0'); -- id=4072
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12830415', 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 ( '12120', '12120', '2026-10-21', '6', '0', '0', '2026-10-21 12:35:57','اضافة فاتورة مبيعات رقم 1142 - صرف البضاعة من المخزن','1','0',null,'0','1142','sellbillController.php?do=showDetail&sellbillid=1142'); -- id=4071
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4071', '402', '12120', '','0'); -- id=4177
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11870701.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 ('4071', '382', '12120', '','0'); -- id=4073
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24883495.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='4070,0,4071' where sellbillid=1142;
 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-21', 12690, 12255, 12255
                    , 12255, 12120, 12120, 12120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12255, 7815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12690, sellCostBuyPrice =sellCostBuyPrice+12255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12255
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7815
                        , returnSellVal = returnSellVal+0, 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-21', 12690, 12255, 12255
                    , 12255, 12120, 12120, 12120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12255, 7815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12690, sellCostBuyPrice =sellCostBuyPrice+12255
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12255
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12255
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7815
                        , returnSellVal = returnSellVal+0, 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, 12690, 12255, 12255
                    , 12255, 12120, 12120, 12120, 12255, 7815)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12690, netSellCostBuyPrice = netSellCostBuyPrice+12255
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+12255
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+12255
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+12120
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+12120
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+12120
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+12255
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7815;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad886026ebb3 and sellbillId = 1142 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:05:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:35:57", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:35:57', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:07:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:37:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:37:05', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=282'); -- id=16181
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:07:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:37:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:37:28', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:10:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:40:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:40:01', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16183
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:10:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:40:16", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:40:16', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:10:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:40:36", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:40:36', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:11:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:41:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:41:59', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16186
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:12:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:42:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 12:42:37', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16187
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-21 09:12:37";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 12:42:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 12:42:37', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:12:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:42:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:42:40', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:12:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:42:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:42:48', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16190

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad876df0e8c7
-- ----------------------------------------------------------------------------------------------------

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-21 12:42:48', '06ad876df0e8c7', '1', '0.00', '0', '0', '1', '79465.00', '79465', '79465', '0', '1', '2026-10-21 12:42:48', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '159' ,'0','','','','','-1','0','0','0','0','0','79465','0','','0','0','79465','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1143
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','اضافة فاتورة مبيعات','1143', '0', '2026-10-21 12:42:48', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '79465', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:42:48','0','0','',''); -- id=1365
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 1195;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('486','01986', '1143', '160', '1986', '9', '540', '4860', '0', '', '0', '2026-10-21 12:42:48', '1986', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1195-9,','1','1','0','0','540','4860','0','','0','0.00','0','0','0','0'); -- id=4569
UPDATE sellbilldetail SET  lastbuyprice = 540.00 , meanbuyprice = 540.00, lastbuyprice_withDiscount = 486.00, meanbuyprice_withDiscount = 486.00
        , lastbuyprice_withTax = 540, meanbuyprice_withTax = 540, lastbuyprice_withDiscountAndTax = 486
                where sellbilldetailid = 4569;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1986, '2026-10-21', 4860, 4860, 4860
                    , 4860, 4374, 4374, 4374
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4860, 4860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4860, sellCostBuyPrice =sellCostBuyPrice+4860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4374, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4374
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4374
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4860, 4860, 4860
                    , 4860, 4374, 4374, 4374
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4860, 4860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4860, sellCostBuyPrice =sellCostBuyPrice+4860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4374, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4374
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4374
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '3003';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1986', '1', '9', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '0', '2', '2026-10-21 12:42:48','0','0'); -- id=15615
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6683;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02250', '1143', '196', '2250', '6', '450', '2700', '0', '', '0', '2026-10-21 12:42:48', '2250', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6683-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4570
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 427.50
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 4570;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2250, '2026-10-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 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+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 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+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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 = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3641';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2250', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '2', '2026-10-21 12:42:48','0','0'); -- id=15616
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1143', '149', '1902', '6', '450', '2700', '0', '', '0', '2026-10-21 12:42:48', '1902', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','996-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4571
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 = 4571;
 INSERT INTO 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-21', 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-21', 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 = '9', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '2919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1902', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '9', '2', '2026-10-21 12:42:48','0','0'); -- id=15617
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', '1143', '94', '2193', '3', '430', '1290', '0', '', '0', '2026-10-21 12:42:48', '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=4572
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 = 4572;
 INSERT INTO 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-21', 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-21', 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 = '12', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3561';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2193', '1', '3', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '2', '2026-10-21 12:42:48','0','0'); -- id=15618
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 997;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01903', '1143', '149', '1903', '6', '460', '2760', '0', '', '0', '2026-10-21 12:42:48', '1903', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','997-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=4573
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 423.20, meanbuyprice_withDiscount = 441.60
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 423.2
                where sellbilldetailid = 4573;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1903, '2026-10-21', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , 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-21', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , 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 = '12', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '2920';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1903', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '2', '2026-10-21 12:42:48','0','0'); -- id=15619
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6639;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02238', '1143', '114', '2238', '8', '500', '4000', '0', '', '0', '2026-10-21 12:42:48', '2238', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6639-8,','1','1','0','0','500','4000','0','','0','0.00','0','0','0','0'); -- id=4574
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 = 4574;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2238, '2026-10-21', 4000, 4000, 4000
                    , 4000, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , 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+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-21', 4000, 4000, 4000
                    , 4000, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , 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 = '24', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3629';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2238', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '24', '2', '2026-10-21 12:42:48','0','0'); -- id=15620
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6257;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('548.7','02165', '1143', '189', '2165', '6', '590', '3540', '0', '', '0', '2026-10-21 12:42:48', '2165', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6257-6,','1','1','0','0','590','3540','0','','0','0.00','0','0','0','0'); -- id=4575
UPDATE sellbilldetail SET  lastbuyprice = 590.00 , meanbuyprice = 590.00, lastbuyprice_withDiscount = 548.70, meanbuyprice_withDiscount = 548.70
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 548.7
                where sellbilldetailid = 4575;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2165, '2026-10-21', 3540, 3540, 3540
                    , 3540, 3292.2, 3292.2, 3292.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3292.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3292.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3292.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3540, 3540, 3540
                    , 3540, 3292.2, 3292.2, 3292.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3292.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3292.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3292.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '3524';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2165', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '30', '2', '2026-10-21 12:42:48','0','0'); -- id=15621
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6248;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570.4','02156', '1143', '188', '2156', '6', '620', '3720', '0', '', '0', '2026-10-21 12:42:48', '2156', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6248-6,','1','1','0','0','620','3720','0','','0','0.00','0','0','0','0'); -- id=4576
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 570.40, meanbuyprice_withDiscount = 570.40
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 570.4
                where sellbilldetailid = 4576;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2156, '2026-10-21', 3720, 3720, 3720
                    , 3720, 3422.4, 3422.4, 3422.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3720, 3720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3720, sellCostBuyPrice =sellCostBuyPrice+3720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3422.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3422.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3422.4
                            , 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
                        , 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-21', 3720, 3720, 3720
                    , 3720, 3422.4, 3422.4, 3422.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3720, 3720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3720, sellCostBuyPrice =sellCostBuyPrice+3720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3422.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3422.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3422.4
                            , 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;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3515';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2156', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-21 12:42:48','0','0'); -- id=15622
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 674;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01760', '1143', '136', '1760', '8', '500', '4000', '0', '', '0', '2026-10-21 12:42:48', '1760', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','674-8,','1','1','0','0','500','4000','0','','0','0.00','0','0','0','0'); -- id=4577
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 = 4577;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1760, '2026-10-21', 4000, 3680, 3680
                    , 3680, 3680, 3680, 3680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3680, 3680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+3680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4000, 3680, 3680
                    , 3680, 3680, 3680, 3680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3680, 3680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+3680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '2773';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1760', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '12', '2', '2026-10-21 12:42:48','0','0'); -- id=15623
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6238;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02145', '1143', '186', '2145', '8', '570', '4560', '0', '', '0', '2026-10-21 12:42:48', '2145', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6238-8,','1','1','0','0','570','4560','0','','0','0.00','0','0','0','0'); -- id=4578
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 4578;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2145, '2026-10-21', 4560, 4240, 4240
                    , 4240, 4240, 4240, 4240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4240, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+4240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4240
                            , 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+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-21', 4560, 4240, 4240
                    , 4240, 4240, 4240, 4240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4240, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+4240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4240
                            , 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 = '16', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3504';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2145', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '16', '2', '2026-10-21 12:42:48','0','0'); -- id=15624
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6249;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('598','02157', '1143', '188', '2157', '3', '650', '1950', '0', '', '0', '2026-10-21 12:42:48', '2157', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6249-3,','1','1','0','0','650','1950','0','','0','0.00','0','0','0','0'); -- id=4579
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 598.00, meanbuyprice_withDiscount = 598.00
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 598
                where sellbilldetailid = 4579;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2157, '2026-10-21', 1950, 1950, 1950
                    , 1950, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , 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+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-21', 1950, 1950, 1950
                    , 1950, 1794, 1794, 1794
                    , 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+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , 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 = '3', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2157', '1', '3', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '3', '2', '2026-10-21 12:42:48','0','0'); -- id=15625
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', '1143', '179', '2104', '9', '360', '3240', '0', '', '0', '2026-10-21 12:42:48', '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=4580
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 = 4580;
 INSERT INTO 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-21', 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-21', 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-21 12:42:48' WHERE storedetailid = '3463';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2104', '1', '9', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '108', '99', '2', '2026-10-21 12:42:48','0','0'); -- id=15626
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 825;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('585','01823', '1143', '140', '1823', '8', '650', '5200', '0', '', '0', '2026-10-21 12:42:48', '1823', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','825-8,','1','1','0','0','650','5200','0','','0','0.00','0','0','0','0'); -- id=4581
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 585.00, meanbuyprice_withDiscount = 617.50
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 585
                where sellbilldetailid = 4581;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1823, '2026-10-21', 5200, 5200, 5200
                    , 5200, 4680, 4940, 4680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 5200, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5200, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , 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+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-21', 5200, 5200, 5200
                    , 5200, 4680, 4940, 4680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5200, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5200, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , 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 = '4', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '2837';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1823', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '4', '2', '2026-10-21 12:42:48','0','0'); -- id=15627
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 823;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('459','01821', '1143', '140', '1821', '8', '510', '4080', '0', '', '0', '2026-10-21 12:42:48', '1821', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','823-8,','1','1','0','0','510','4080','0','','0','0.00','0','0','0','0'); -- id=4582
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 459.00, meanbuyprice_withDiscount = 484.50
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 459
                where sellbilldetailid = 4582;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1821, '2026-10-21', 4080, 4080, 4080
                    , 4080, 3672, 3876, 3672
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 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+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-21', 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 = '16', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '2835';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1821', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '16', '2', '2026-10-21 12:42:48','0','0'); -- id=15628
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 6025;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('515.2','02033', '1143', '166', '2033', '2', '560', '1120', '0', '', '0', '2026-10-21 12:42:48', '2033', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6025-2,','1','1','0','0','560','1120','0','','0','0.00','0','0','0','0'); -- id=4583
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 515.20, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where sellbilldetailid = 4583;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2033, '2026-10-21', 1120, 1120, 1120
                    , 1120, 1030.4, 1030.4, 1030.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 1120, 1120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+1120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1030.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1030.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1120, 1120, 1120
                    , 1120, 1030.4, 1030.4, 1030.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1120, 1120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1120, sellCostBuyPrice =sellCostBuyPrice+1120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1030.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1030.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1030.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '3392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2033', '1', '2', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '1', '2', '2026-10-21 12:42:48','0','0'); -- id=15629
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 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', '1143', '190', '2184', '8', '530', '4240', '0', '', '0', '2026-10-21 12:42:48', '2184', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6301-8,','1','1','0','0','530','4240','0','','0','0.00','0','0','0','0'); -- id=4584
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 = 4584;
 INSERT INTO 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-21', 4240, 4040, 4040
                    , 4040, 4040, 4040, 4040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4040, 2020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4240, sellCostBuyPrice =sellCostBuyPrice+4040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4240, 4040, 4040
                    , 4040, 4040, 4040, 4040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4040, 2020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4240, sellCostBuyPrice =sellCostBuyPrice+4040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '3544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2184', '1', '8', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '24', '2', '2026-10-21 12:42:48','0','0'); -- id=15630
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', '1143', '103', '1462', '6', '430', '2580', '0', '', '0', '2026-10-21 12:42:48', '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=4585
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 = 4585;
 INSERT INTO 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-21', 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-21', 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 = '168', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '6', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '174', '168', '2', '2026-10-21 12:42:48','0','0'); -- id=15631
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 1143;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01954', '1143', '158', '1954', '4', '650', '2600', '0', '', '0', '2026-10-21 12:42:48', '1954', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1143-4,','1','1','0','0','650','2600','0','','0','0.00','0','0','0','0'); -- id=4586
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 = 4586;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1954, '2026-10-21', 2600, 2480, 2480
                    , 2480, 2480, 2480, 2480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2480, 2480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2600, 2480, 2480
                    , 2480, 2480, 2480, 2480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2480, 2480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '4', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '36', '2', '2026-10-21 12:42:48','0','0'); -- id=15632
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09665', '1143', '30', '975', '10', '410', '4100', '0', '', '0', '2026-10-21 12:42:48', '975', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','410','4100','0','','0','0.00','0','0','0','0'); -- id=4587
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 = 4587;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (975, '2026-10-21', 4100, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4100, 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+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-21', 4100, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4100, 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 = '35', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '975';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('975', '1', '10', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '35', '2', '2026-10-21 12:42:48','0','0'); -- id=15633
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1143', '26', '902', '5', '450', '2250', '0', '', '0', '2026-10-21 12:42:48', '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=4588
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 = 4588;
 INSERT INTO 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-21', 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-21', 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 = '35', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '902';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('902', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '35', '2', '2026-10-21 12:42:48','0','0'); -- id=15634
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09818', '1143', '8', '759', '5', '600', '3000', '0', '', '0', '2026-10-21 12:42:48', '759', '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=4589
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 = 4589;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (759, '2026-10-21', 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-21', 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 = '5', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('759', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 12:42:48','0','0'); -- id=15635
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09162', '1143', '28', '933', '5', '460', '2300', '0', '', '0', '2026-10-21 12:42:48', '933', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','460','2300','0','','0','0.00','0','0','0','0'); -- id=4590
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 = 4590;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (933, '2026-10-21', 2300, 2200, 2200
                    , 2200, 2200, 2200, 2200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2200, 2200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2300, sellCostBuyPrice =sellCostBuyPrice+2200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2300, 2200, 2200
                    , 2200, 2200, 2200, 2200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2200, 2200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2300, sellCostBuyPrice =sellCostBuyPrice+2200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '933';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('933', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 12:42:48','0','0'); -- id=15636
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09127', '1143', '30', '973', '5', '450', '2250', '0', '', '0', '2026-10-21 12:42:48', '973', '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=4591
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 = 4591;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (973, '2026-10-21', 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-21', 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 = '25', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('973', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '25', '2', '2026-10-21 12:42:48','0','0'); -- id=15637
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','07967', '1143', '37', '1090', '5', '450', '2250', '0', '', '0', '2026-10-21 12:42:48', '1090', '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=4592
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 = 4592;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1090, '2026-10-21', 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-21', 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 = '0', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '1090';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1090', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 12:42:48','0','0'); -- id=15638
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','09586', '1143', '8', '736', '5', '590', '2950', '0', '', '0', '2026-10-21 12:42:48', '736', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','590','2950','0','','0','0.00','0','0','0','0'); -- id=4593
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4593;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (736, '2026-10-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:42:48' WHERE storedetailid = '736';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('736', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 12:42:48','0','0'); -- id=15639
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1143', '21', '858', '5', '245', '1225', '0', '', '0', '2026-10-21 12:42:48', '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=4594
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 = 4594;
 INSERT INTO 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-21', 1225, 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+1225, 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-21', 1225, 1125, 1125
                    , 1125, 1125, 1125, 1125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1125, 1125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1225, 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 = '105', userid = '2', storedetaildate = '2026-10-21 12:42:48' WHERE storedetailid = '858';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('858', '1', '5', '1', '1143', 'اضافة فاتورة مبيعات', 'sellbillController.php', '110', '105', '2', '2026-10-21 12:42:48','0','0'); -- id=15640
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6957728.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 ('6878263.5','79465', '0', '2', 'اضافة فاتورة مبيعات', '1143', '6957728.5', '2026-10-21 12:42:48', '2',  'sellbillController.php','1','','0'); -- id=1421
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '79465', '79465', '2026-10-21', '2', '0', '0', '2026-10-21 12:42:48','اضافة فاتورة مبيعات رقم 1143','1','0',null,'0','1143','sellbillController.php?do=showDetail&sellbillid=1143'); -- id=4072
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4072', '419', '79465', '','0'); -- id=4178
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6957728', 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 ('4072', '143', '79465', '','0'); -- id=4074
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12909880', 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 ( '73734', '73734', '2026-10-21', '2', '0', '0', '2026-10-21 12:42:48','اضافة فاتورة مبيعات رقم 1143 - صرف البضاعة من المخزن','1','0',null,'0','1143','sellbillController.php?do=showDetail&sellbillid=1143'); -- id=4073
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4073', '402', '73734', '','0'); -- id=4179
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11944435.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 ('4073', '382', '73734', '','0'); -- id=4075
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24809761.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='4072,0,4073' where sellbillid=1143;
 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-21', 79465, 77305, 77305
                    , 77305, 73734, 74551.4, 73734
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,77305, 64445, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+79465, sellCostBuyPrice =sellCostBuyPrice+77305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+77305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+77305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+73734, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+74551.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+73734
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+77305
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+64445
                        , returnSellVal = returnSellVal+0, 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-21', 79465, 77305, 77305
                    , 77305, 73734, 74551.4, 73734
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,77305, 64445, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+79465, sellCostBuyPrice =sellCostBuyPrice+77305
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+77305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+77305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+73734, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+74551.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+73734
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+77305
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+64445
                        , returnSellVal = returnSellVal+0, 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, 79465, 77305, 77305
                    , 77305, 73734, 74551.4, 73734, 77305, 64445)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+79465, netSellCostBuyPrice = netSellCostBuyPrice+77305
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+77305
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+77305
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+73734
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+74551.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+73734
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+77305
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+64445;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad876df0e8c7 and sellbillId = 1143 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:12:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:42:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:42:48', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:14:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:44:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:44:45', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16192
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 ('موديل 9037 كافاني','','2','400','415','0','0','2026-10-21','0','7','0','','0','0','0','0','0','400','400','400','400','400','0','3.75','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=2313
UPDATE product SET productName = 'موديل 9037 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '400', productSellAllPrice = '415', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02313',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 = '3.75' , 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 = '2313';
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', '2313', '1', '2026-10-21', '7', '0','0231301','415','0','0','400','','0','0','0','0','0','0','0','0','0','0'); -- id=2313
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2313', '1', '0', '7', '2026-10-21'); -- id=3707
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2313', '1', '0', '0', '2313', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15641
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2313, 1,'2026-10-21 12:44:45',7)
                ON DUPLICATE KEY UPDATE productid = 2313, edited = 1, sysdate = '2026-10-21 12:44:45', userid = 7; -- id=3400
UPDATE product SET productName = 'موديل 9037 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02313',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 = '3.75' , 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 = '2313';
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 ('موديل 9036 كافاني','','2','420','435','0','0','2026-10-21','0','7','0','','0','0','0','0','0','420','420','420','420','420','0','3.57','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=2314
UPDATE product SET productName = 'موديل 9036 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '420', productSellAllPrice = '435', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02314',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 = '3.57' , 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 = '2314';
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', '2314', '1', '2026-10-21', '7', '0','0231401','435','0','0','420','','0','0','0','0','0','0','0','0','0','0'); -- id=2314
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2314', '1', '0', '7', '2026-10-21'); -- id=3708
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2314', '1', '0', '0', '2314', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15642
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2314, 1,'2026-10-21 12:44:45',7)
                ON DUPLICATE KEY UPDATE productid = 2314, edited = 1, sysdate = '2026-10-21 12:44:45', userid = 7; -- id=3401
UPDATE product SET productName = 'موديل 9036 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '420.00', productSellAllPrice = '435.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02314',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 = '3.57' , 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 = '2314';
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 ('موديل 5065 كافاني','','2','515','530','0','0','2026-10-21','0','7','0','','0','0','0','0','0','515','515','515','515','515','0','2.91','0','0','.','0','0','0','515','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','515','515','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','515','0','0','0','0','0','0','','','0','0','0','0'); -- id=2315
UPDATE product SET productName = 'موديل 5065 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '515', productSellAllPrice = '530', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02315',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '2.91' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2315';
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', '2315', '1', '2026-10-21', '7', '0','0231501','530','0','0','515','','0','0','0','0','0','0','0','0','0','0'); -- id=2315
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2315', '1', '0', '7', '2026-10-21'); -- id=3709
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2315', '1', '0', '0', '2315', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15643
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2315, 1,'2026-10-21 12:44:45',7)
                ON DUPLICATE KEY UPDATE productid = 2315, edited = 1, sysdate = '2026-10-21 12:44:45', userid = 7; -- id=3402
UPDATE product SET productName = 'موديل 5065 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '515.00', productSellAllPrice = '530.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02315',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '2.91' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2315';
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 ('موديل 9038 كافاني','','2','470','485','0','0','2026-10-21','0','7','0','','0','0','0','0','0','470','470','470','470','470','0','3.19','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=2316
UPDATE product SET productName = 'موديل 9038 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '470', productSellAllPrice = '485', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02316',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '3.19' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2316';
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', '2316', '1', '2026-10-21', '7', '0','0231601','485','0','0','470','','0','0','0','0','0','0','0','0','0','0'); -- id=2316
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2316', '1', '0', '7', '2026-10-21'); -- id=3710
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2316', '1', '0', '0', '2316', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15644
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2316, 1,'2026-10-21 12:44:45',7)
                ON DUPLICATE KEY UPDATE productid = 2316, edited = 1, sysdate = '2026-10-21 12:44:45', userid = 7; -- id=3403
UPDATE product SET productName = 'موديل 9038 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02316',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '3.19' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2316';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:14:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:44:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:44:46', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:14:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:44:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:44:48', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:15:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:45:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:45:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16195
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:16:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:46:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:46:33', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16196
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 ('06ad889900c867', '2026-10-21 12:44:48', '50', '526705.00', '610715', '0', '0', '84010.00',  '84010.00', '0', '84010', '1', '2026-10-21 12:46:33', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=283
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 ('02313', '283', '2', '2313', '60', '400', '24000.00', '0', '', '2026-10-21 12:46:33', '2313','','','0','0','0','0','0',null,'400','24000','0','0','0','0','0','0','0','0','1'); -- id=1581
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:44:48', 1, 2313, 0, 0
                    , 400, 60, 0, 0, 7, '2026-10-21 12:46:33')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:46:33' ; -- id=6867
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2313', '400', '60', '0', 'buyBillController.php', '1581', '', '0', '0'); -- id=1162
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2313 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1581 ;
UPDATE product SET productName = 'موديل 9037 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02313',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 = '3.75' , 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 = '2313';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 1581;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2313;
UPDATE storedetail SET  productquantity = '60', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2313', '1', '60', '0', '283', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '7', '2026-10-21 12:44:48','0','0'); -- id=15645
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 ('02314', '283', '2', '2314', '48', '420', '20160.00', '0', '', '2026-10-21 12:46:33', '2314','','','0','0','0','0','0',null,'420','20160','0','0','0','0','0','0','0','0','1'); -- id=1582
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:44:48', 1, 2314, 0, 0
                    , 420, 48, 0, 0, 7, '2026-10-21 12:46:33')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:46:33' ; -- id=6868
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2314', '420', '48', '0', 'buyBillController.php', '1582', '', '0', '0'); -- id=1163
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2314 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1582 ;
UPDATE product SET productName = 'موديل 9036 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '420.00', productSellAllPrice = '435.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02314',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 = '3.57' , 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 = '2314';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1582;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2314;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3708';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2314', '1', '48', '0', '283', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '7', '2026-10-21 12:44:48','0','0'); -- id=15646
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 ('02315', '283', '2', '2315', '50', '515', '25750.00', '0', '', '2026-10-21 12:46:33', '2315','','','0','0','0','0','0',null,'515','25750','0','0','0','0','0','0','0','0','1'); -- id=1583
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:44:48', 1, 2315, 0, 0
                    , 515, 50, 0, 0, 7, '2026-10-21 12:46:33')
                ON DUPLICATE KEY UPDATE buyprice = 515,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:46:33' ; -- id=6869
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2315', '515', '50', '0', 'buyBillController.php', '1583', '', '0', '0'); -- id=1164
UPDATE product SET  productBuyPrice = "515" WHERE productId = 2315 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1583 ;
UPDATE product SET productName = 'موديل 5065 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '515.00', productSellAllPrice = '530.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02315',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.91' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515',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='515',meanbuyprice_withTax='515',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='515',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2315';
UPDATE buybilldetail SET  lastbuyprice = 515 , meanbuyprice = 515, lastbuyprice_withDiscount = 515, meanbuyprice_withDiscount = 515
        , lastbuyprice_withTax = 515, meanbuyprice_withTax = 515, lastbuyprice_withDiscountAndTax = 515
                where buybilldetailid = 1583;
UPDATE productunit SET proUnitBuyPrice  = 515 * productnumber WHERE productid = 2315;
UPDATE storedetail SET  productquantity = '50', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3709';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2315', '1', '50', '0', '283', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '7', '2026-10-21 12:44:48','0','0'); -- id=15647
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 ('02316', '283', '2', '2316', '30', '470', '14100.00', '0', '', '2026-10-21 12:46:33', '2316','','','0','0','0','0','0',null,'470','14100','0','0','0','0','0','0','0','0','1'); -- id=1584
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:44:48', 1, 2316, 0, 0
                    , 470, 30, 0, 0, 7, '2026-10-21 12:46:33')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 12:46:33' ; -- id=6870
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2316', '470', '30', '0', 'buyBillController.php', '1584', '', '0', '0'); -- id=1165
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2316 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1584 ;
UPDATE product SET productName = 'موديل 9038 كافاني', productDescription = '', productCatId = '2', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02316',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.19' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2316';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 1584;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2316;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2316', '1', '30', '0', '283', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 12:44:48','0','0'); -- id=15648
UPDATE supplier SET  suppliercurrentDebt = '610715',suppliercurrentDebtInCurrency= '610715' , userid = '7', supplierdate = '2026-10-21 12:46:33'   WHERE supplierid = '50';
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 ('50', '526705.00', '84010', '0', 'اضافة فاتورة مشتريات', '283', '610715', '2026-10-21 12:44:48', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','84010','1','526705','84010','610715','0',''); -- id=795
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '84010', '84010', '2026-10-21', '7', '0', '0', '2026-10-21 12:46:33','اضافة فاتورة مشتريات رقم 283','1','0',null,'0','283','buyBillController.php?do=details&id=283'); -- id=4074
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4074', '382', '84010', '','0'); -- id=4180
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24893771.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 ('4074', '469', '84010', '','0'); -- id=4076
UPDATE accountstree SET name = 'كافاني - مورد', customName = 'كافاني - مورد', customNameEn = 'كافاني - مورد', nameEn = 'كافاني - مورد', parent = '81', accountNature = '1', theValue = '135265', 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 = '469';
update buybill set dailyentryid='4074,0' where buybillid=283;
COMMIT;
UPDATE product SET overAllAveragePrice = 400 WHERE productId = 2313;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 2314;UPDATE product SET overAllAveragePrice = 515 WHERE productId = 2315;UPDATE product SET overAllAveragePrice = 470 WHERE productId = 2316;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:16:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:46:34", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:46:34', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=283'); -- id=16197
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:16:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:46:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:46:37', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16198

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad88918b1d91
-- ----------------------------------------------------------------------------------------------------

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-21 12:46:37', '06ad88918b1d91', '1', '0.00', '0', '0', '1', '14220.00', '14220', '14220', '0', '1', '2026-10-21 12:46:37', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '31' ,'0','','','','','-1','0','0','0','0','0','14220','0','','0','0','14220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1144
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','اضافة فاتورة مبيعات','1144', '0', '2026-10-21 12:46:37', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '14220', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:46:37','0','0','',''); -- id=1366
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09511', '1144', '19', '841', '5', '450', '2250', '0', '', '0', '2026-10-21 12:46:37', '841', '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=4595
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 = 4595;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (841, '2026-10-21', 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-21', 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 = '35', userid = '2', storedetaildate = '2026-10-21 12:46:37' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '5', '1', '1144', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '35', '2', '2026-10-21 12:46:37','0','0'); -- id=15649
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','07429', '1144', '19', '833', '5', '450', '2250', '0', '', '0', '2026-10-21 12:46:37', '833', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','7-5,','1','1','0','0','450','2250','0','','0','0.00','0','0','0','0'); -- id=4596
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 = 4596;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (833, '2026-10-21', 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-21', 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 = '70', userid = '2', storedetaildate = '2026-10-21 12:46:37' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '5', '1', '1144', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '70', '2', '2026-10-21 12:46:37','0','0'); -- id=15650
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1144', '104', '2202', '12', '450', '5400', '0', '', '0', '2026-10-21 12:46:37', '2202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6476-12,','1','1','0','0','450','5400','0','','0','0.00','0','0','0','0'); -- id=4597
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 = 4597;
 INSERT INTO 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-21', 5400, 4590, 4590
                    , 4590, 4590, 4590, 4590
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4590, 4590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5400, sellCostBuyPrice =sellCostBuyPrice+4590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4590
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5400, 4590, 4590
                    , 4590, 4590, 4590, 4590
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4590, 4590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5400, sellCostBuyPrice =sellCostBuyPrice+4590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4590
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '389', userid = '2', storedetaildate = '2026-10-21 12:46:37' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '12', '1', '1144', 'اضافة فاتورة مبيعات', 'sellbillController.php', '401', '389', '2', '2026-10-21 12:46:37','0','0'); -- id=15651
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', '1144', '103', '2237', '9', '480', '4320', '0', '', '0', '2026-10-21 12:46:37', '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=4598
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 = 4598;
 INSERT INTO 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-21', 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-21', 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 = '45', userid = '2', storedetaildate = '2026-10-21 12:46:37' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '9', '1', '1144', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '45', '2', '2026-10-21 12:46:37','0','0'); -- id=15652
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6971948.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 ('6957728.5','14220', '0', '2', 'اضافة فاتورة مبيعات', '1144', '6971948.5', '2026-10-21 12:46:37', '2',  'sellbillController.php','1','','0'); -- id=1422
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '14220', '14220', '2026-10-21', '2', '0', '0', '2026-10-21 12:46:37','اضافة فاتورة مبيعات رقم 1144','1','0',null,'0','1144','sellbillController.php?do=showDetail&sellbillid=1144'); -- id=4075
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4075', '419', '14220', '','0'); -- id=4181
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6971948', 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 ('4075', '143', '14220', '','0'); -- id=4077
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12924100', 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 ( '13030', '13030', '2026-10-21', '2', '0', '0', '2026-10-21 12:46:37','اضافة فاتورة مبيعات رقم 1144 - صرف البضاعة من المخزن','1','0',null,'0','1144','sellbillController.php?do=showDetail&sellbillid=1144'); -- id=4076
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4076', '402', '13030', '','0'); -- id=4182
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11957465.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 ('4076', '382', '13030', '','0'); -- id=4078
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24880741.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='4075,0,4076' where sellbillid=1144;
 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-21', 14220, 13030, 13030
                    , 13030, 13030, 13030, 13030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13030, 13030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14220, sellCostBuyPrice =sellCostBuyPrice+13030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13030
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13030
                        , returnSellVal = returnSellVal+0, 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-21', 14220, 13030, 13030
                    , 13030, 13030, 13030, 13030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13030, 13030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14220, sellCostBuyPrice =sellCostBuyPrice+13030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13030
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13030
                        , returnSellVal = returnSellVal+0, 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, 14220, 13030, 13030
                    , 13030, 13030, 13030, 13030, 13030, 13030)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+14220, netSellCostBuyPrice = netSellCostBuyPrice+13030
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+13030
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+13030
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13030
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+13030
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+13030
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+13030
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+13030;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad88918b1d91 and sellbillId = 1144 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:16:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:46:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:46:38', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:17:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:47:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:47:07', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=283&type=2'); -- id=16200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:17:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:47:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:47:15', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16201
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:17:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:47:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:47:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16202
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:20:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:50:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:50:24', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:20:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:50:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:50:58', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16204
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 ('الدولي جينز 627','','8','617','645','0','0','2026-10-21','0','1','0','','0','0','0','0','0','617','617','617','617','617','0','4.54','0','0','.','0','0','0','617','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','617','617','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','617','0','0','0','0','0','0','','','0','0','0','0'); -- id=2317
UPDATE product SET productName = 'الدولي جينز 627', productDescription = '', productCatId = '8', productBuyPrice = '617', productSellAllPrice = '645', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02317',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '617',lastbuyprice_withDiscount = '617',meanbuyprice = '617',meanbuyprice_withDiscount = '617' , productbuypricereal = '617' , buypricereal_precentage = '0' , buytotal_precentage = '4.54' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='617',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='617',meanbuyprice_withTax='617',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='617',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2317';
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', '2317', '1', '2026-10-21', '1', '0','0231701','645','0','0','617','','0','0','0','0','0','0','0','0','0','0'); -- id=2317
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2317', '1', '0', '1', '2026-10-21'); -- id=3711
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2317', '1', '0', '0', '2317', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15653
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2317, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2317, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3404
UPDATE product SET productName = 'الدولي جينز 627', productDescription = '', productCatId = '8', productBuyPrice = '617.00', productSellAllPrice = '645.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02317',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '617',lastbuyprice_withDiscount = '617',meanbuyprice = '617',meanbuyprice_withDiscount = '617' , productbuypricereal = '617' , buypricereal_precentage = '0' , buytotal_precentage = '4.54' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='617',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='617',meanbuyprice_withTax='617',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='617',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2317';
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 ('الدولي جينز 628','','8','517','545','0','0','2026-10-21','0','1','0','','0','0','0','0','0','517','517','517','517','517','0','5.42','0','0','.','0','0','0','517','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','517','517','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','517','0','0','0','0','0','0','','','0','0','0','0'); -- id=2318
UPDATE product SET productName = 'الدولي جينز 628', productDescription = '', productCatId = '8', productBuyPrice = '517', productSellAllPrice = '545', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '16607',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517' , buypricereal_precentage = '0' , buytotal_precentage = '5.42' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2318';
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', '2318', '1', '2026-10-21', '1', '0','0231801','545','0','0','517','','0','0','0','0','0','0','0','0','0','0'); -- id=2318
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2318', '1', '0', '1', '2026-10-21'); -- id=3712
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2318', '1', '0', '0', '2318', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15654
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2318, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2318, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3405
UPDATE product SET productName = 'الدولي جينز 628', productDescription = '', productCatId = '8', productBuyPrice = '517.00', productSellAllPrice = '545.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '16607',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517' , buypricereal_precentage = '0' , buytotal_precentage = '5.42' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2318';
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 ('الدولي جينز 629','','8','512','540','0','0','2026-10-21','0','1','0','','0','0','0','0','0','512','512','512','512','512','0','5.47','0','0','.','0','0','0','512','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','512','512','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','512','0','0','0','0','0','0','','','0','0','0','0'); -- id=2319
UPDATE product SET productName = 'الدولي جينز 629', productDescription = '', productCatId = '8', productBuyPrice = '512', productSellAllPrice = '540', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02319',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '512',lastbuyprice_withDiscount = '512',meanbuyprice = '512',meanbuyprice_withDiscount = '512' , productbuypricereal = '512' , buypricereal_precentage = '0' , buytotal_precentage = '5.47' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='512',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='512',meanbuyprice_withTax='512',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='512',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2319';
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', '2319', '1', '2026-10-21', '1', '0','0231901','540','0','0','512','','0','0','0','0','0','0','0','0','0','0'); -- id=2319
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2319', '1', '0', '1', '2026-10-21'); -- id=3713
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '0', '0', '2319', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15655
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2319, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2319, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3406
UPDATE product SET productName = 'الدولي جينز 629', productDescription = '', productCatId = '8', productBuyPrice = '512.00', productSellAllPrice = '540.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02319',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '512',lastbuyprice_withDiscount = '512',meanbuyprice = '512',meanbuyprice_withDiscount = '512' , productbuypricereal = '512' , buypricereal_precentage = '0' , buytotal_precentage = '5.47' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='512',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='512',meanbuyprice_withTax='512',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='512',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2319';
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 ('الدولي جينز 632','','8','657','685','0','0','2026-10-21','0','1','0','','0','0','0','0','0','657','657','657','657','657','0','4.26','0','0','.','0','0','0','657','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','657','657','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','657','0','0','0','0','0','0','','','0','0','0','0'); -- id=2320
UPDATE product SET productName = 'الدولي جينز 632', productDescription = '', productCatId = '8', productBuyPrice = '657', productSellAllPrice = '685', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02320',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '657',lastbuyprice_withDiscount = '657',meanbuyprice = '657',meanbuyprice_withDiscount = '657' , productbuypricereal = '657' , buypricereal_precentage = '0' , buytotal_precentage = '4.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='657',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='657',meanbuyprice_withTax='657',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='657',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2320';
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', '2320', '1', '2026-10-21', '1', '0','0232001','685','0','0','657','','0','0','0','0','0','0','0','0','0','0'); -- id=2320
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2320', '1', '0', '1', '2026-10-21'); -- id=3714
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2320', '1', '0', '0', '2320', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15656
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2320, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2320, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3407
UPDATE product SET productName = 'الدولي جينز 632', productDescription = '', productCatId = '8', productBuyPrice = '657.00', productSellAllPrice = '685.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02320',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '657',lastbuyprice_withDiscount = '657',meanbuyprice = '657',meanbuyprice_withDiscount = '657' , productbuypricereal = '657' , buypricereal_precentage = '0' , buytotal_precentage = '4.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='657',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='657',meanbuyprice_withTax='657',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='657',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2320';
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 ('الدولي جينز 634','','8','522','550','0','0','2026-10-21','0','1','0','','0','0','0','0','0','522','522','522','522','522','0','5.36','0','0','.','0','0','0','522','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','522','522','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','522','0','0','0','0','0','0','','','0','0','0','0'); -- id=2321
UPDATE product SET productName = 'الدولي جينز 634', productDescription = '', productCatId = '8', productBuyPrice = '522', productSellAllPrice = '550', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02321',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '522',lastbuyprice_withDiscount = '522',meanbuyprice = '522',meanbuyprice_withDiscount = '522' , productbuypricereal = '522' , buypricereal_precentage = '0' , buytotal_precentage = '5.36' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='522',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='522',meanbuyprice_withTax='522',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='522',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2321';
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', '2321', '1', '2026-10-21', '1', '0','0232101','550','0','0','522','','0','0','0','0','0','0','0','0','0','0'); -- id=2321
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2321', '1', '0', '1', '2026-10-21'); -- id=3715
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2321', '1', '0', '0', '2321', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15657
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2321, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2321, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3408
UPDATE product SET productName = 'الدولي جينز 634', productDescription = '', productCatId = '8', productBuyPrice = '522.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02321',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '522',lastbuyprice_withDiscount = '522',meanbuyprice = '522',meanbuyprice_withDiscount = '522' , productbuypricereal = '522' , buypricereal_precentage = '0' , buytotal_precentage = '5.36' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='522',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='522',meanbuyprice_withTax='522',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='522',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2321';
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 ('الدولي جينز 621','','8','557','585','0','0','2026-10-21','0','1','0','','0','0','0','0','0','557','557','557','557','557','0','5.03','0','0','.','0','0','0','557','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','557','557','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','557','0','0','0','0','0','0','','','0','0','0','0'); -- id=2322
UPDATE product SET productName = 'الدولي جينز 621', productDescription = '', productCatId = '8', productBuyPrice = '557', productSellAllPrice = '585', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02322',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '557',lastbuyprice_withDiscount = '557',meanbuyprice = '557',meanbuyprice_withDiscount = '557' , productbuypricereal = '557' , buypricereal_precentage = '0' , buytotal_precentage = '5.03' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='557',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='557',meanbuyprice_withTax='557',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='557',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2322';
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', '2322', '1', '2026-10-21', '1', '0','0232201','585','0','0','557','','0','0','0','0','0','0','0','0','0','0'); -- id=2322
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2322', '1', '0', '1', '2026-10-21'); -- id=3716
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2322', '1', '0', '0', '2322', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15658
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2322, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2322, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3409
UPDATE product SET productName = 'الدولي جينز 621', productDescription = '', productCatId = '8', productBuyPrice = '557.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02322',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '557',lastbuyprice_withDiscount = '557',meanbuyprice = '557',meanbuyprice_withDiscount = '557' , productbuypricereal = '557' , buypricereal_precentage = '0' , buytotal_precentage = '5.03' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='557',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='557',meanbuyprice_withTax='557',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='557',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2322';
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 ('الدولي جينز 635','','8','652','680','0','0','2026-10-21','0','1','0','','0','0','0','0','0','652','652','652','652','652','0','4.29','0','0','.','0','0','0','652','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','652','652','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','652','0','0','0','0','0','0','','','0','0','0','0'); -- id=2323
UPDATE product SET productName = 'الدولي جينز 635', productDescription = '', productCatId = '8', productBuyPrice = '652', productSellAllPrice = '680', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '652',lastbuyprice_withDiscount = '652',meanbuyprice = '652',meanbuyprice_withDiscount = '652' , productbuypricereal = '652' , buypricereal_precentage = '0' , buytotal_precentage = '4.29' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='652',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='652',meanbuyprice_withTax='652',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='652',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2323';
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', '2323', '1', '2026-10-21', '1', '0','0232301','680','0','0','652','','0','0','0','0','0','0','0','0','0','0'); -- id=2323
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2323', '1', '0', '1', '2026-10-21'); -- id=3717
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '0', '0', '2323', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15659
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2323, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2323, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3410
UPDATE product SET productName = 'الدولي جينز 635', productDescription = '', productCatId = '8', productBuyPrice = '652.00', productSellAllPrice = '680.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '652',lastbuyprice_withDiscount = '652',meanbuyprice = '652',meanbuyprice_withDiscount = '652' , productbuypricereal = '652' , buypricereal_precentage = '0' , buytotal_precentage = '4.29' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='652',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='652',meanbuyprice_withTax='652',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='652',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2323';
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 ('الدولي جينز 631','','8','517','545','0','0','2026-10-21','0','1','0','','0','0','0','0','0','517','517','517','517','517','0','5.42','0','0','.','0','0','0','517','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','517','517','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','517','0','0','0','0','0','0','','','0','0','0','0'); -- id=2324
UPDATE product SET productName = 'الدولي جينز 631', productDescription = '', productCatId = '8', productBuyPrice = '517', productSellAllPrice = '545', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02324',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517' , buypricereal_precentage = '0' , buytotal_precentage = '5.42' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2324';
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', '2324', '1', '2026-10-21', '1', '0','0232401','545','0','0','517','','0','0','0','0','0','0','0','0','0','0'); -- id=2324
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2324', '1', '0', '1', '2026-10-21'); -- id=3718
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2324', '1', '0', '0', '2324', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15660
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2324, 1,'2026-10-21 12:50:58',1)
                ON DUPLICATE KEY UPDATE productid = 2324, edited = 1, sysdate = '2026-10-21 12:50:58', userid = 1; -- id=3411
UPDATE product SET productName = 'الدولي جينز 631', productDescription = '', productCatId = '8', productBuyPrice = '517.00', productSellAllPrice = '545.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02324',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517' , buypricereal_precentage = '0' , buytotal_precentage = '5.42' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2324';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:21:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:51:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:51:00', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16205
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:21:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:51:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:51:02', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:22:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:52:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:52:43', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16207
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 ('06ad88b061934e', '2026-10-21 12:51:02', '26', '834170.00', '938115', '0', '0', '103945.00',  '103945.00', '0', '103945', '1', '2026-10-21 12:52:43', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=284
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 ('02317', '284', '8', '2317', '20', '617', '12340.00', '0', '', '2026-10-21 12:52:43', '2317','','','0','0','0','0','0',null,'617','12340','0','0','0','0','0','0','0','0','1'); -- id=1585
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2317, 0, 0
                    , 617, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 617,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6871
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2317', '617', '20', '0', 'buyBillController.php', '1585', '', '0', '0'); -- id=1166
UPDATE product SET  productBuyPrice = "617" WHERE productId = 2317 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1585 ;
UPDATE product SET productName = 'الدولي جينز 627', productDescription = '', productCatId = '8', productBuyPrice = '617.00', productSellAllPrice = '645.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02317',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '617',lastbuyprice_withDiscount = '617',meanbuyprice = '617',meanbuyprice_withDiscount = '617' , productbuypricereal = '617.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.54' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='617',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='617',meanbuyprice_withTax='617',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='617',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2317';
UPDATE buybilldetail SET  lastbuyprice = 617 , meanbuyprice = 617, lastbuyprice_withDiscount = 617, meanbuyprice_withDiscount = 617
        , lastbuyprice_withTax = 617, meanbuyprice_withTax = 617, lastbuyprice_withDiscountAndTax = 617
                where buybilldetailid = 1585;
UPDATE productunit SET proUnitBuyPrice  = 617 * productnumber WHERE productid = 2317;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3711';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2317', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15661
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 ('16607', '284', '8', '2318', '20', '517', '10340.00', '0', '', '2026-10-21 12:52:43', '2318','','','0','0','0','0','0',null,'517','10340','0','0','0','0','0','0','0','0','1'); -- id=1586
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2318, 0, 0
                    , 517, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 517,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6872
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2318', '517', '20', '0', 'buyBillController.php', '1586', '', '0', '0'); -- id=1167
UPDATE product SET  productBuyPrice = "517" WHERE productId = 2318 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1586 ;
UPDATE product SET productName = 'الدولي جينز 628', productDescription = '', productCatId = '8', productBuyPrice = '517.00', productSellAllPrice = '545.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '16607',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.42' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2318';
UPDATE buybilldetail SET  lastbuyprice = 517 , meanbuyprice = 517, lastbuyprice_withDiscount = 517, meanbuyprice_withDiscount = 517
        , lastbuyprice_withTax = 517, meanbuyprice_withTax = 517, lastbuyprice_withDiscountAndTax = 517
                where buybilldetailid = 1586;
UPDATE productunit SET proUnitBuyPrice  = 517 * productnumber WHERE productid = 2318;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3712';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2318', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15662
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 ('02319', '284', '8', '2319', '20', '512', '10240.00', '0', '', '2026-10-21 12:52:43', '2319','','','0','0','0','0','0',null,'512','10240','0','0','0','0','0','0','0','0','1'); -- id=1587
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2319, 0, 0
                    , 512, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 512,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6873
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2319', '512', '20', '0', 'buyBillController.php', '1587', '', '0', '0'); -- id=1168
UPDATE product SET  productBuyPrice = "512" WHERE productId = 2319 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1587 ;
UPDATE product SET productName = 'الدولي جينز 629', productDescription = '', productCatId = '8', productBuyPrice = '512.00', productSellAllPrice = '540.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02319',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '512',lastbuyprice_withDiscount = '512',meanbuyprice = '512',meanbuyprice_withDiscount = '512' , productbuypricereal = '512.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.47' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='512',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='512',meanbuyprice_withTax='512',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='512',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2319';
UPDATE buybilldetail SET  lastbuyprice = 512 , meanbuyprice = 512, lastbuyprice_withDiscount = 512, meanbuyprice_withDiscount = 512
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where buybilldetailid = 1587;
UPDATE productunit SET proUnitBuyPrice  = 512 * productnumber WHERE productid = 2319;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15663
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 ('02320', '284', '8', '2320', '20', '657', '13140.00', '0', '', '2026-10-21 12:52:43', '2320','','','0','0','0','0','0',null,'657','13140','0','0','0','0','0','0','0','0','1'); -- id=1588
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2320, 0, 0
                    , 657, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 657,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6874
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2320', '657', '20', '0', 'buyBillController.php', '1588', '', '0', '0'); -- id=1169
UPDATE product SET  productBuyPrice = "657" WHERE productId = 2320 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1588 ;
UPDATE product SET productName = 'الدولي جينز 632', productDescription = '', productCatId = '8', productBuyPrice = '657.00', productSellAllPrice = '685.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02320',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '657',lastbuyprice_withDiscount = '657',meanbuyprice = '657',meanbuyprice_withDiscount = '657' , productbuypricereal = '657.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='657',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='657',meanbuyprice_withTax='657',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='657',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2320';
UPDATE buybilldetail SET  lastbuyprice = 657 , meanbuyprice = 657, lastbuyprice_withDiscount = 657, meanbuyprice_withDiscount = 657
        , lastbuyprice_withTax = 657, meanbuyprice_withTax = 657, lastbuyprice_withDiscountAndTax = 657
                where buybilldetailid = 1588;
UPDATE productunit SET proUnitBuyPrice  = 657 * productnumber WHERE productid = 2320;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2320', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15664
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 ('02321', '284', '8', '2321', '20', '522', '10440.00', '0', '', '2026-10-21 12:52:43', '2321','','','0','0','0','0','0',null,'522','10440','0','0','0','0','0','0','0','0','1'); -- id=1589
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2321, 0, 0
                    , 522, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 522,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6875
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2321', '522', '20', '0', 'buyBillController.php', '1589', '', '0', '0'); -- id=1170
UPDATE product SET  productBuyPrice = "522" WHERE productId = 2321 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1589 ;
UPDATE product SET productName = 'الدولي جينز 634', productDescription = '', productCatId = '8', productBuyPrice = '522.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02321',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '522',lastbuyprice_withDiscount = '522',meanbuyprice = '522',meanbuyprice_withDiscount = '522' , productbuypricereal = '522.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.36' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='522',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='522',meanbuyprice_withTax='522',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='522',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2321';
UPDATE buybilldetail SET  lastbuyprice = 522 , meanbuyprice = 522, lastbuyprice_withDiscount = 522, meanbuyprice_withDiscount = 522
        , lastbuyprice_withTax = 522, meanbuyprice_withTax = 522, lastbuyprice_withDiscountAndTax = 522
                where buybilldetailid = 1589;
UPDATE productunit SET proUnitBuyPrice  = 522 * productnumber WHERE productid = 2321;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3715';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2321', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15665
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 ('02322', '284', '8', '2322', '20', '557', '11140.00', '0', '', '2026-10-21 12:52:43', '2322','','','0','0','0','0','0',null,'557','11140','0','0','0','0','0','0','0','0','1'); -- id=1590
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2322, 0, 0
                    , 557, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 557,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6876
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2322', '557', '20', '0', 'buyBillController.php', '1590', '', '0', '0'); -- id=1171
UPDATE product SET  productBuyPrice = "557" WHERE productId = 2322 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1590 ;
UPDATE product SET productName = 'الدولي جينز 621', productDescription = '', productCatId = '8', productBuyPrice = '557.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02322',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '557',lastbuyprice_withDiscount = '557',meanbuyprice = '557',meanbuyprice_withDiscount = '557' , productbuypricereal = '557.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.03' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='557',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='557',meanbuyprice_withTax='557',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='557',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2322';
UPDATE buybilldetail SET  lastbuyprice = 557 , meanbuyprice = 557, lastbuyprice_withDiscount = 557, meanbuyprice_withDiscount = 557
        , lastbuyprice_withTax = 557, meanbuyprice_withTax = 557, lastbuyprice_withDiscountAndTax = 557
                where buybilldetailid = 1590;
UPDATE productunit SET proUnitBuyPrice  = 557 * productnumber WHERE productid = 2322;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3716';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2322', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15666
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 ('02323', '284', '8', '2323', '20', '652', '13040.00', '0', '', '2026-10-21 12:52:43', '2323','','','0','0','0','0','0',null,'652','13040','0','0','0','0','0','0','0','0','1'); -- id=1591
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2323, 0, 0
                    , 652, 20, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 652,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6877
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2323', '652', '20', '0', 'buyBillController.php', '1591', '', '0', '0'); -- id=1172
UPDATE product SET  productBuyPrice = "652" WHERE productId = 2323 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1591 ;
UPDATE product SET productName = 'الدولي جينز 635', productDescription = '', productCatId = '8', productBuyPrice = '652.00', productSellAllPrice = '680.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '652',lastbuyprice_withDiscount = '652',meanbuyprice = '652',meanbuyprice_withDiscount = '652' , productbuypricereal = '652.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.29' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='652',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='652',meanbuyprice_withTax='652',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='652',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2323';
UPDATE buybilldetail SET  lastbuyprice = 652 , meanbuyprice = 652, lastbuyprice_withDiscount = 652, meanbuyprice_withDiscount = 652
        , lastbuyprice_withTax = 652, meanbuyprice_withTax = 652, lastbuyprice_withDiscountAndTax = 652
                where buybilldetailid = 1591;
UPDATE productunit SET proUnitBuyPrice  = 652 * productnumber WHERE productid = 2323;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '20', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 12:51:02','0','0'); -- id=15667
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 ('02324', '284', '8', '2324', '45', '517', '23265.00', '0', '', '2026-10-21 12:52:43', '2324','','','0','0','0','0','0',null,'517','23265','0','0','0','0','0','0','0','0','1'); -- id=1592
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:51:02', 1, 2324, 0, 0
                    , 517, 45, 0, 0, 1, '2026-10-21 12:52:43')
                ON DUPLICATE KEY UPDATE buyprice = 517,
                        buyQuantity =buyQuantity+45, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:52:43' ; -- id=6878
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2324', '517', '45', '0', 'buyBillController.php', '1592', '', '0', '0'); -- id=1173
UPDATE product SET  productBuyPrice = "517" WHERE productId = 2324 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1592 ;
UPDATE product SET productName = 'الدولي جينز 631', productDescription = '', productCatId = '8', productBuyPrice = '517.00', productSellAllPrice = '545.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02324',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '517',lastbuyprice_withDiscount = '517',meanbuyprice = '517',meanbuyprice_withDiscount = '517' , productbuypricereal = '517.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.42' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='517',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='517',meanbuyprice_withTax='517',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='517',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2324';
UPDATE buybilldetail SET  lastbuyprice = 517 , meanbuyprice = 517, lastbuyprice_withDiscount = 517, meanbuyprice_withDiscount = 517
        , lastbuyprice_withTax = 517, meanbuyprice_withTax = 517, lastbuyprice_withDiscountAndTax = 517
                where buybilldetailid = 1592;
UPDATE productunit SET proUnitBuyPrice  = 517 * productnumber WHERE productid = 2324;
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3718';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2324', '1', '45', '0', '284', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '45', '1', '2026-10-21 12:51:02','0','0'); -- id=15668
UPDATE supplier SET  suppliercurrentDebt = '938115',suppliercurrentDebtInCurrency= '938115' , userid = '1', supplierdate = '2026-10-21 12:52:43'   WHERE supplierid = '26';
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 ('26', '834170.00', '103945', '0', 'اضافة فاتورة مشتريات', '284', '938115', '2026-10-21 12:51:02', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','103945','1','834170','103945','938115','0',''); -- id=796
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '103945', '103945', '2026-10-21', '1', '0', '0', '2026-10-21 12:52:43','اضافة فاتورة مشتريات رقم 284','1','0',null,'0','284','buyBillController.php?do=details&id=284'); -- id=4077
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4077', '382', '103945', '','0'); -- id=4183
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24984686.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 ('4077', '445', '103945', '','0'); -- id=4079
UPDATE accountstree SET name = 'الدولي - مورد', customName = 'الدولي - مورد', customNameEn = 'الدولي - مورد', nameEn = 'الدولي - مورد', parent = '81', accountNature = '1', theValue = '129320', 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 = '445';
update buybill set dailyentryid='4077,0' where buybillid=284;
COMMIT;
UPDATE product SET overAllAveragePrice = 617 WHERE productId = 2317;UPDATE product SET overAllAveragePrice = 517 WHERE productId = 2318;UPDATE product SET overAllAveragePrice = 512 WHERE productId = 2319;UPDATE product SET overAllAveragePrice = 657 WHERE productId = 2320;UPDATE product SET overAllAveragePrice = 522 WHERE productId = 2321;UPDATE product SET overAllAveragePrice = 557 WHERE productId = 2322;UPDATE product SET overAllAveragePrice = 652 WHERE productId = 2323;UPDATE product SET overAllAveragePrice = 517 WHERE productId = 2324;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:22:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:52:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:52:43', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=284'); -- id=16208
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:22:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:52:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:52:47', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=284&type=2'); -- id=16209
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:23:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:53:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 12:53:01', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16210
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-21 09:23:01";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 12:53:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 12:53:01', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16211
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:23:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:53:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:53:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16212
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:23:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:53:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:53:09', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16213

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad889fe2d489
-- ----------------------------------------------------------------------------------------------------

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-21 12:53:09', '06ad889fe2d489', '1', '0.00', '0', '5', '1', '37905.00', '37900', '37900', '0', '1', '2026-10-21 12:53:09', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '86' ,'0','','','','','-1','0','0','0','0','0','37900','0','','0','0','37900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1145
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','اضافة فاتورة مبيعات','1145', '0', '2026-10-21 12:53:09', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '37900', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 12:53:09','0','0','',''); -- id=1367
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 358;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01549', '1145', '11', '1549', '5', '500', '2500', '0', '', '0', '2026-10-21 12:53:09', '1549', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','358-5,','1','1','0','0','500','2500','0','','0','0.00','0','0','0','0'); -- id=4599
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 4599;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1549, '2026-10-21', 2499.6702282021, 2425, 2425
                    , 2425, 2425, 2425, 2425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2425, 2425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2499.6702282021, sellCostBuyPrice =sellCostBuyPrice+2425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2499.6702282021, 2425, 2425
                    , 2425, 2425, 2425, 2425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2425, 2425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2499.6702282021, sellCostBuyPrice =sellCostBuyPrice+2425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:53:09' WHERE storedetailid = '1574';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1549', '1', '5', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 12:53:09','0','0'); -- id=15669
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1145', '5', '659', '5', '600', '3000', '0', '', '0', '2026-10-21 12:53:09', '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=4600
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 = 4600;
 INSERT INTO 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-21', 2999.6042738425, 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+2999.6042738425, 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-21', 2999.6042738425, 2900, 2900
                    , 2900, 2900, 2900, 2900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2900, 2900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2999.6042738425, 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 = '15', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('659', '1', '5', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 12:53:09','0','0'); -- id=15670
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 509;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01682', '1145', '2', '1682', '12', '520', '6240', '0', '', '0', '2026-10-21 12:53:09', '1682', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','509-12,','1','1','0','0','520','6240','0','','0','0.00','0','0','0','0'); -- id=4601
UPDATE sellbilldetail SET  lastbuyprice = 505.00 , meanbuyprice = 505.00, lastbuyprice_withDiscount = 505.00, meanbuyprice_withDiscount = 505.00
        , lastbuyprice_withTax = 505, meanbuyprice_withTax = 505, lastbuyprice_withDiscountAndTax = 505
                where sellbilldetailid = 4601;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1682, '2026-10-21', 6239.1768895924, 6060, 6060
                    , 6060, 6060, 6060, 6060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6060, 6060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6239.1768895924, sellCostBuyPrice =sellCostBuyPrice+6060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6060
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6239.1768895924, 6060, 6060
                    , 6060, 6060, 6060, 6060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6060, 6060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6239.1768895924, sellCostBuyPrice =sellCostBuyPrice+6060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6060
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:53:09' WHERE storedetailid = '2694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1682', '1', '12', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '24', '2', '2026-10-21 12:53:09','0','0'); -- id=15671
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6163;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02103', '1145', '134', '2103', '12', '490', '5880', '0', '', '0', '2026-10-21 12:53:09', '2103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6163-12,','1','1','0','0','490','5880','0','','0','0.00','0','0','0','0'); -- id=4602
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 = 4602;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2103, '2026-10-21', 5879.2243767313, 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+5879.2243767313, 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-21', 5879.2243767313, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5879.2243767313, 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 = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '3462';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2103', '1', '12', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '12', '2', '2026-10-21 12:53:09','0','0'); -- id=15672
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 442;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('377.2','01590', '1145', '116', '1590', '4', '410', '1640', '0', '', '0', '2026-10-21 12:53:09', '1590', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','442-4,','1','1','0','0','410','1640','0','','0','0.00','0','0','0','0'); -- id=4603
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 377.20, meanbuyprice_withDiscount = 377.20
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 377.2
                where sellbilldetailid = 4603;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1590, '2026-10-21', 1639.7836697006, 1640, 1640
                    , 1640, 1508.8, 1508.8, 1508.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1640, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1639.7836697006, sellCostBuyPrice =sellCostBuyPrice+1640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1508.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1508.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1508.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 1639.7836697006, 1640, 1640
                    , 1640, 1508.8, 1508.8, 1508.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1640, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1639.7836697006, sellCostBuyPrice =sellCostBuyPrice+1640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1508.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1508.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1508.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '1615';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1590', '1', '4', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '2', '2026-10-21 12:53:09','0','0'); -- id=15673
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 985;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('364','01891', '1145', '147', '1891', '9', '395', '3555', '0', '', '0', '2026-10-21 12:53:09', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-9,','1','1','0','0','395','3555','0','','0','0.00','0','0','0','0'); -- id=4604
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 4604;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-21', 3554.5310645034, 3276, 3276
                    , 3276, 3276, 3276, 3276
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3276, 3276, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3554.5310645034, sellCostBuyPrice =sellCostBuyPrice+3276
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3276, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3276, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3276
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3276
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3276
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3554.5310645034, 3276, 3276
                    , 3276, 3276, 3276, 3276
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3276, 3276, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3554.5310645034, sellCostBuyPrice =sellCostBuyPrice+3276
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3276, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3276
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3276, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3276
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3276
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3276
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3276
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '210', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '9', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '219', '210', '2', '2026-10-21 12:53:09','0','0'); -- id=15674
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6794;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02290', '1145', '179', '2290', '9', '390', '3510', '0', '', '0', '2026-10-21 12:53:09', '2290', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6794-9,','1','1','0','0','390','3510','0','','0','0.00','0','0','0','0'); -- id=4605
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 358.80, meanbuyprice_withDiscount = 358.80
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 358.8
                where sellbilldetailid = 4605;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2290, '2026-10-21', 3509.5370003957, 3510, 3510
                    , 3510, 3229.2, 3229.2, 3229.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3510, 3510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3509.5370003957, sellCostBuyPrice =sellCostBuyPrice+3510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3229.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3229.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3509.5370003957, 3510, 3510
                    , 3510, 3229.2, 3229.2, 3229.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3510, 3510, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3509.5370003957, sellCostBuyPrice =sellCostBuyPrice+3510
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3510
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3229.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3229.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3510
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3510
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 12:53:09' WHERE storedetailid = '3683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '9', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '18', '2', '2026-10-21 12:53:09','0','0'); -- id=15675
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1145', '196', '2246', '9', '400', '3600', '0', '', '0', '2026-10-21 12:53:09', '2246', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6679-9,','1','1','0','0','400','3600','0','','0','0.00','0','0','0','0'); -- id=4606
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 = 4606;
 INSERT INTO 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-21', 3599.525128611, 3600, 3600
                    , 3600, 3240, 3420, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3599.525128611, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , 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-21', 3599.525128611, 3600, 3600
                    , 3600, 3240, 3420, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3599.525128611, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , 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 = '13', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '3637';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2246', '1', '9', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '13', '2', '2026-10-21 12:53:09','0','0'); -- id=15676
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 757;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01783', '1145', '138', '1783', '9', '380', '3420', '0', '', '0', '2026-10-21 12:53:09', '1783', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','757-9,','1','1','0','0','380','3420','0','','0','0.00','0','0','0','0'); -- id=4607
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 = 4607;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1783, '2026-10-21', 3419.5488721805, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3419.5488721805, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3419.5488721805, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3419.5488721805, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '2796';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1783', '1', '9', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '12', '2', '2026-10-21 12:53:09','0','0'); -- id=15677
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', '1145', '154', '1924', '6', '295', '1770', '0', '', '0', '2026-10-21 12:53:09', '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=4608
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 = 4608;
 INSERT INTO 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-21', 1769.7665215671, 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+1769.7665215671, 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-21', 1769.7665215671, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1769.7665215671, 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 = '66', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '6', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '66', '2', '2026-10-21 12:53:09','0','0'); -- id=15678
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 575;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01712', '1145', '128', '1712', '6', '465', '2790', '0', '', '0', '2026-10-21 12:53:09', '1712', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','575-6,','1','1','0','0','465','2790','0','','0','0.00','0','0','0','0'); -- id=4609
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 = 4609;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1712, '2026-10-21', 2789.6319746735, 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+2789.6319746735, 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-21', 2789.6319746735, 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+2789.6319746735, 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 = '9', userid = '2', storedetaildate = '2026-10-21 12:53:09' WHERE storedetailid = '2724';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1712', '1', '6', '1', '1145', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '9', '2', '2026-10-21 12:53:09','0','0'); -- id=15679
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7009848.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 ('6971948.5','37900', '0', '2', 'اضافة فاتورة مبيعات', '1145', '7009848.5', '2026-10-21 12:53:09', '2',  'sellbillController.php','1','','0'); -- id=1423
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '37905', '37905', '2026-10-21', '2', '0', '0', '2026-10-21 12:53:09','اضافة فاتورة مبيعات رقم 1145','1','0',null,'0','1145','sellbillController.php?do=showDetail&sellbillid=1145'); -- id=4078
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4078', '419', '37900', '','0'); -- id=4184
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7009848', 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 ('4078', '398', '5', '','0'); -- id=4185
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510164.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 ('4078', '143', '37905', '','0'); -- id=4080
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12962005', 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 ( '35645.8', '35645.8', '2026-10-21', '2', '0', '0', '2026-10-21 12:53:09','اضافة فاتورة مبيعات رقم 1145 - صرف البضاعة من المخزن','1','0',null,'0','1145','sellbillController.php?do=showDetail&sellbillid=1145'); -- id=4079
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4079', '402', '35645.8', '','0'); -- id=4186
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11993111.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 ('4079', '382', '35645.8', '','0'); -- id=4081
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24949041.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='4078,0,4079' where sellbillid=1145;
 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-21', 37900, 36641, 36641
                    , 36641, 35645.8, 35937.4, 35645.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,36641, 33446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+37900, sellCostBuyPrice =sellCostBuyPrice+36641
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+36641, sellCostMeanBuyPrice = sellCostMeanBuyPrice+36641
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35645.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35937.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35645.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+36641
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+33446
                        , returnSellVal = returnSellVal+0, 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-21', 37900, 36641, 36641
                    , 36641, 35645.8, 35937.4, 35645.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,36641, 33446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+37900, sellCostBuyPrice =sellCostBuyPrice+36641
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+36641, sellCostMeanBuyPrice = sellCostMeanBuyPrice+36641
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35645.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35937.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35645.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+36641
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+33446
                        , returnSellVal = returnSellVal+0, 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, 37900, 36641, 36641
                    , 36641, 35645.8, 35937.4, 35645.8, 36641, 33446)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+37900, netSellCostBuyPrice = netSellCostBuyPrice+36641
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+36641
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+36641
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+35645.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+35937.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+35645.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+36641
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+33446;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad889fe2d489 and sellbillId = 1145 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:23:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:53:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 12:53:09', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:24:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:54:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 12:54:40', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16215
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:26:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:56:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:56:07', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16216
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:26:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:56:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:56:12', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=282'); -- id=16217
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:27:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:57:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:57:08', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16218
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 282;
UPDATE buybill SET  buybillsysdate = '2026-10-21 12:57:08', userid = '7',delbyuserid = '1', conditions = '1' WHERE buybillid = '282';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 590, 24, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6860
UPDATE buybilldetail SET  lastbuyprice = 590.00 , meanbuyprice = 590.00, lastbuyprice_withDiscount = 542.80, meanbuyprice_withDiscount = 542.80
        , lastbuyprice_withTax = 590.00, meanbuyprice_withTax = 590.00, lastbuyprice_withDiscountAndTax = 542.80
                where buybilldetailid = 1574;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '0',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='542.8',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='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='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 = '2310';
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '24', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '54', '30', '1', '2026-10-21 12:31:06','0','0'); -- id=15680
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 560, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE buybilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 515.20, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560.00, meanbuyprice_withTax = 560.00, lastbuyprice_withDiscountAndTax = 515.20
                where buybilldetailid = 1575;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '0',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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 = '2311';
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '90', '60', '1', '2026-10-21 12:31:06','0','0'); -- id=15681
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 590, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6860
UPDATE buybilldetail SET  lastbuyprice = 590.00 , meanbuyprice = 590.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 542.80
        , lastbuyprice_withTax = 590.00, meanbuyprice_withTax = 590.00, lastbuyprice_withDiscountAndTax = 0.00
                where buybilldetailid = 1576;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '0',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='542.8',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='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='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 = '2310';
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '30', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '30', '0', '1', '2026-10-21 12:31:06','0','0'); -- id=15682
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 560, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE buybilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560.00, meanbuyprice_withTax = 560.00, lastbuyprice_withDiscountAndTax = 0.00
                where buybilldetailid = 1577;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '0',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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 = '2311';
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '60', '30', '1', '2026-10-21 12:31:06','0','0'); -- id=15683
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 560, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE buybilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560.00, meanbuyprice_withTax = 560.00, lastbuyprice_withDiscountAndTax = 0.00
                where buybilldetailid = 1578;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '0',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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 = '2311';
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '30', '0', '1', '2026-10-21 12:31:06','0','0'); -- id=15684
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 490, 24, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6865
UPDATE buybilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 450.80, meanbuyprice_withDiscount = 450.80
        , lastbuyprice_withTax = 490.00, meanbuyprice_withTax = 490.00, lastbuyprice_withDiscountAndTax = 450.80
                where buybilldetailid = 1579;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '0',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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 = '2312';
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '24', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '48', '24', '1', '2026-10-21 12:31:06','0','0'); -- id=15685
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 490, 24, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6865
UPDATE buybilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 450.80
        , lastbuyprice_withTax = 490.00, meanbuyprice_withTax = 490.00, lastbuyprice_withDiscountAndTax = 0.00
                where buybilldetailid = 1580;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '0',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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 = '2312';
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '24', '1', '282', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-21 12:31:06','0','0'); -- id=15686
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-21 12:57:08'   WHERE supplierid = '201';
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 ('201', '97317.60', '97317.60', '1', 'حذف فاتورة مشتريات - للتعديل', '282', '0', '2026-10-21 12:31:06', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','97317.6','1','97317.6','97317.6','0','0',''); -- id=797
UPDATE productserial SET del = 1
		 WHERE billid = 282;
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 ('06ad8865a285da', '2026-10-21 12:31:06', '201', '0.00', '94612.8', '8', '1', '102840.00', '94612.80', '0.00', '94612.8', '1', '2026-10-21 12:57:08', '', '1', '0', '', '1', '1','1','282','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=285
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 ('02310', '285', '205', '2310', '24.00', '590', '14160.00', '0.00', '', '2026-10-21 12:57:08', '2310','','','0','0','0','0','0',null,'590','14160','0','0','0','0','0','0','0','0','1'); -- id=1593
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 542.8, 24, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 542.8,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6860
UPDATE product SET  productBuyPrice = "590" WHERE productId = 2310 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1593 ;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '542.8',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='542.8',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='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='542.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 = '2310';
UPDATE buybilldetail SET  lastbuyprice = 590 , meanbuyprice = 590, lastbuyprice_withDiscount = 542.8, meanbuyprice_withDiscount = 542.8
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 542.8
                where buybilldetailid = 1593;
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '24', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 12:31:06','0','0'); -- id=15687
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 ('02311', '285', '205', '2311', '30.00', '560', '16800.00', '0.00', '', '2026-10-21 12:57:08', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1594
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1594 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1594;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 12:31:06','0','0'); -- id=15688
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 ('02310', '285', '205', '2310', '30.00', '590', '17700.00', '0.00', '', '2026-10-21 12:57:08', '2310','','','0','0','0','0','0',null,'590','17700','0','0','0','0','0','0','0','0','1'); -- id=1595
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2310, 0, 0
                    , 542.8, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 542.8,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6860
UPDATE product SET  productBuyPrice = "590" WHERE productId = 2310 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1595 ;
UPDATE product SET productName = 'موديلات 590 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02310',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '542.8',meanbuyprice = '590',meanbuyprice_withDiscount = '542.8' , productbuypricereal = '590.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='542.8',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='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='542.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 = '2310';
UPDATE buybilldetail SET  lastbuyprice = 590 , meanbuyprice = 590, lastbuyprice_withDiscount = 542.8, meanbuyprice_withDiscount = 542.8
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 542.8
                where buybilldetailid = 1595;
UPDATE productunit SET proUnitBuyPrice  = 590 * productnumber WHERE productid = 2310;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3704';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2310', '1', '30', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '54', '1', '2026-10-21 12:31:06','0','0'); -- id=15689
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 ('02311', '285', '205', '2311', '30.00', '560', '16800.00', '0.00', '', '2026-10-21 12:57:08', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1596
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 30 WHERE buybilldetailid = 1596 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1596;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '30', '60', '1', '2026-10-21 12:31:06','0','0'); -- id=15690
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 ('02311', '285', '205', '2311', '30.00', '560', '16800.00', '0.00', '', '2026-10-21 12:57:08', '2311','','','0','0','0','0','0',null,'560','16800','0','0','0','0','0','0','0','0','1'); -- id=1597
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2311, 0, 0
                    , 515.2, 30, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6861
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2311 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1597 ;
UPDATE product SET productName = 'موديلات 560 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02311',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='515.2',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='560',meanbuyprice_withTax='560',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='515.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 = '2311';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1597;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2311;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2311', '1', '30', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '90', '1', '2026-10-21 12:31:06','0','0'); -- id=15691
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 ('02312', '285', '205', '2312', '21.00', '490', '10290.00', '0.00', '', '2026-10-21 12:57:08', '2312','','','0','0','0','0','0',null,'490','10290','0','0','0','0','0','0','0','0','1'); -- id=1598
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 450.8, 21, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6865
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2312 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1598 ;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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.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 = '2312';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1598;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '21', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '21', '1', '2026-10-21 12:31:06','0','0'); -- id=15692
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 ('02312', '285', '205', '2312', '21.00', '490', '10290.00', '0.00', '', '2026-10-21 12:57:08', '2312','','','0','0','0','0','0',null,'490','10290','0','0','0','0','0','0','0','0','1'); -- id=1599
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 12:31:06', 1, 2312, 0, 0
                    , 450.8, 21, 0, 0, 1, '2026-10-21 12:57:08')
                ON DUPLICATE KEY UPDATE buyprice = 450.8,
                        buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 12:57:08' ; -- id=6865
UPDATE product SET  productBuyPrice = "490" WHERE productId = 2312 ;
UPDATE buybilldetail SET  quantitybefore = 21 WHERE buybilldetailid = 1599 ;
UPDATE product SET productName = 'موديلات 490 فلاش', productDescription = '', productCatId = '205', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02312',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '450.8',meanbuyprice = '490',meanbuyprice_withDiscount = '450.8' , productbuypricereal = '490.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='450.8',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='490',meanbuyprice_withTax='490',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.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 = '2312';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 450.8, meanbuyprice_withDiscount = 450.8
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where buybilldetailid = 1599;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 2312;
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3706';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2312', '1', '21', '0', '285', 'اضافة فاتورة مشتريات', 'buyBillController.php', '21', '42', '1', '2026-10-21 12:31:06','0','0'); -- id=15693
DELETE FROM productserial WHERE billid = 282
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '94612.8',suppliercurrentDebtInCurrency= '94612.8' , userid = '1', supplierdate = '2026-10-21 12:57:08'   WHERE supplierid = '201';
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 ('201', '0.00', '94612.8', '0', 'اضافة فاتورة مشتريات', '285', '94612.8', '2026-10-21 12:57:08', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','97317.6','1','0','94612.8','94612.8','0',''); -- id=798
UPDATE dailyentry SET totalcreditor = '97317.60', totaldebtor = '97317.60', thedate = '2026-10-21', userid = '7', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 12:33:24', entryComment = 'اضافة فاتورة مشتريات رقم 282', fromFlag = '1',related='0',isopeningentry='0',operationId='282',operationDetailLink='buyBillController.php?do=details&id=282' WHERE id = '4069';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97317.60', '97317.60', '2026-10-21', '1', '0', '4069', '2026-10-21 12:57:08','تم عكس القيد رقم 4069 ','1','0','0','0','0',''); -- id=4080
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4080', '382', '97317.60', '','0'); -- id=4082
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24851723.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4080', '688', '97317.60', '','0'); -- id=4187
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 = '7', del = '0', sysdate = '2026-10-21 12:29:10' WHERE id = '688';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '94612.8', '94612.8', '2026-10-21', '1', '0', '0', '2026-10-21 12:57:08','اضافة فاتورة مشتريات رقم 285','1','0',null,'0','285','buyBillController.php?do=details&id=285'); -- id=4081
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4081', '382', '94612.8', '','0'); -- id=4188
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24946336.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 ('4081', '688', '94612.8', '','0'); -- id=4083
UPDATE accountstree SET name = 'فلاش', customName = 'فلاش', customNameEn = 'فلاش', nameEn = 'فلاش', parent = '81', accountNature = '1', theValue = '94612.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '7', del = '0', sysdate = '2026-10-21 12:29:10' WHERE id = '688';
update buybill set dailyentryid='4081,0' where buybillid=285;
UPDATE product SET overAllAveragePrice = 542.8 WHERE productId = 2310;UPDATE product SET overAllAveragePrice = 515.2 WHERE productId = 2311;UPDATE product SET overAllAveragePrice = 450.8 WHERE productId = 2312;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:27:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 12:57:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 12:57:08', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=285'); -- id=16219
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:31:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:01:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:01:49', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16220
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:31:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:01:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 13:01:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16221
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:35:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:05:41', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16222
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-21 09:35:41";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:05:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:05:41', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16223
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:35:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:05:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:05:43', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16224
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:36:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:06:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:06:18', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16225

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad88b85bd3eb
-- ----------------------------------------------------------------------------------------------------

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-21 13:06:18', '06ad88b85bd3eb', '1', '0.00', '0', '0', '1', '15120.00', '15120', '15120', '0', '1', '2026-10-21 13:06:18', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '43' ,'0','','','','','-1','0','0','0','0','0','15120','0','','0','0','15120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1146
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','اضافة فاتورة مبيعات','1146', '0', '2026-10-21 13:06:18', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '15120', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:06:18','0','0','',''); -- id=1368
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6224;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02136', '1146', '183', '2136', '9', '420', '3780', '0', '', '0', '2026-10-21 13:06:18', '2136', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6224-9,','1','1','0','0','420','3780','0','','0','0.00','0','0','0','0'); -- id=4610
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 4610;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2136, '2026-10-21', 3780, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3420, 1710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1710
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3780, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3420, 1710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1710
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:06:18' WHERE storedetailid = '3495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2136', '1', '9', '1', '1146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '63', '2', '2026-10-21 13:06:18','0','0'); -- id=15694
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 6754;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02270', '1146', '71', '2270', '4', '330', '1320', '0', '', '0', '2026-10-21 13:06:18', '2270', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6754-4,','1','1','0','0','330','1320','0','','0','0.00','0','0','0','0'); -- id=4611
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 303.60
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 4611;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2270, '2026-10-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1320, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1214.4
                            , 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+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-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1320, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1214.4
                            , 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 = '120', userid = '2', storedetaildate = '2026-10-21 13:06:18' WHERE storedetailid = '3663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2270', '1', '4', '1', '1146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '124', '120', '2', '2026-10-21 13:06:18','0','0'); -- id=15695
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6339;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1146', '147', '1886', '9', '320', '2880', '0', '', '0', '2026-10-21 13:06:18', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6339-9,','1','1','0','0','320','2880','0','','0','0.00','0','0','0','0'); -- id=4612
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4612;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '109', userid = '2', storedetaildate = '2026-10-21 13:06:18' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '9', '1', '1146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '118', '109', '2', '2026-10-21 13:06:18','0','0'); -- id=15696
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1146', '147', '1884', '9', '460', '4140', '0', '', '0', '2026-10-21 13:06:18', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-9,','1','1','0','0','460','4140','0','','0','0.00','0','0','0','0'); -- id=4613
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 = 4613;
 INSERT INTO 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-21', 4140, 3861, 3861
                    , 3861, 3861, 3861, 3861
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3861, 3861, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+3861
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3861, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3861
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3861, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3861
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3861
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3861
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3861
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4140, 3861, 3861
                    , 3861, 3861, 3861, 3861
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3861, 3861, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+3861
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3861, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3861
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3861, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3861
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3861
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3861
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3861
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '297', userid = '2', storedetaildate = '2026-10-21 13:06:18' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '9', '1', '1146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '306', '297', '2', '2026-10-21 13:06:18','0','0'); -- id=15697
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1146', '142', '1841', '12', '250', '3000', '0', '', '0', '2026-10-21 13:06:18', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-12,','1','1','0','0','250','3000','0','','0','0.00','0','0','0','0'); -- id=4614
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 = 4614;
 INSERT INTO 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-21', 3000, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2820, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , 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-21', 3000, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , 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 = '262', userid = '2', storedetaildate = '2026-10-21 13:06:18' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '12', '1', '1146', 'اضافة فاتورة مبيعات', 'sellbillController.php', '274', '262', '2', '2026-10-21 13:06:18','0','0'); -- id=15698
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7024968.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 ('7009848.5','15120', '0', '2', 'اضافة فاتورة مبيعات', '1146', '7024968.5', '2026-10-21 13:06:18', '2',  'sellbillController.php','1','','0'); -- id=1424
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15120', '15120', '2026-10-21', '2', '0', '0', '2026-10-21 13:06:18','اضافة فاتورة مبيعات رقم 1146','1','0',null,'0','1146','sellbillController.php?do=showDetail&sellbillid=1146'); -- id=4082
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4082', '419', '15120', '','0'); -- id=4189
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7024968', 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 ('4082', '143', '15120', '','0'); -- id=4084
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12977125', 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 ( '13916.4', '13916.4', '2026-10-21', '2', '0', '0', '2026-10-21 13:06:18','اضافة فاتورة مبيعات رقم 1146 - صرف البضاعة من المخزن','1','0',null,'0','1146','sellbillController.php?do=showDetail&sellbillid=1146'); -- id=4083
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4083', '402', '13916.4', '','0'); -- id=4190
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12007027.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 ('4083', '382', '13916.4', '','0'); -- id=4085
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24932419.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='4082,0,4083' where sellbillid=1146;
 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-21', 15120, 14022, 14022
                    , 14022, 13916.4, 13916.4, 13916.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14022, 12252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15120, sellCostBuyPrice =sellCostBuyPrice+14022
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14022, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14022
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13916.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13916.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13916.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14022
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12252
                        , returnSellVal = returnSellVal+0, 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-21', 15120, 14022, 14022
                    , 14022, 13916.4, 13916.4, 13916.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14022, 12252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15120, sellCostBuyPrice =sellCostBuyPrice+14022
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14022, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14022
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13916.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13916.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13916.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14022
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12252
                        , returnSellVal = returnSellVal+0, 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, 15120, 14022, 14022
                    , 14022, 13916.4, 13916.4, 13916.4, 14022, 12252)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+15120, netSellCostBuyPrice = netSellCostBuyPrice+14022
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+14022
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+14022
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13916.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+13916.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+13916.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+14022
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+12252;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad88b85bd3eb and sellbillId = 1146 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:36:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:06:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:06:18', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16226
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:11:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:11:57', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16227

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad88e9ae1d77
-- ----------------------------------------------------------------------------------------------------

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-21 13:11:57', '06ad88e9ae1d77', '1', '0.00', '0', '15', '1', '33815.00', '33800', '33800', '0', '1', '2026-10-21 13:11:57', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '95' ,'0','','','','','-1','0','0','0','0','0','33800','0','','0','0','33800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1147
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','اضافة فاتورة مبيعات','1147', '0', '2026-10-21 13:11:57', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '33800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:11:57','0','0','',''); -- id=1369
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+42 where id = 865;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01840', '1147', '141', '1840', '42', '330', '13860', '0', '', '0', '2026-10-21 13:11:57', '1840', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','865-42,','1','1','0','0','330','13860','0','','0','0.00','0','0','0','0'); -- id=4615
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 313.50
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4615;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1840, '2026-10-21', 13853.851840899, 13860, 13860
                    , 13860, 12474, 13167, 12474
                    , 0, 0, 0, 0
                    , 0, 0, 0, 42, 0, 13860, 6930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13853.851840899, sellCostBuyPrice =sellCostBuyPrice+13860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12474, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13167
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12474
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+42
                        , netQuantityRet = netQuantityRet+0;
 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-21', 13853.851840899, 13860, 13860
                    , 13860, 12474, 13167, 12474
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13860, 6930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13853.851840899, sellCostBuyPrice =sellCostBuyPrice+13860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12474, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13167
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12474
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '48', userid = '2', storedetaildate = '2026-10-21 13:11:57' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '42', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '48', '2', '2026-10-21 13:11:57','0','0'); -- id=15699
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6299;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02182', '1147', '190', '2182', '12', '290', '3480', '0', '', '0', '2026-10-21 13:11:57', '2182', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6299-12,','1','1','0','0','290','3480','0','','0','0.00','0','0','0','0'); -- id=4616
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 137.5, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 4616;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2182, '2026-10-21', 3478.4563063729, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3300, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3478.4563063729, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , 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+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-21', 3478.4563063729, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3478.4563063729, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , 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 = '24', userid = '2', storedetaildate = '2026-10-21 13:11:57' WHERE storedetailid = '3542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2182', '1', '12', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '24', '2', '2026-10-21 13:11:57','0','0'); -- id=15700
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6846;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02307', '1147', '204', '2307', '12', '300', '3600', '0', '', '0', '2026-10-21 13:11:57', '2307', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6846-12,','1','1','0','0','300','3600','0','','0','0.00','0','0','0','0'); -- id=4617
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 4617;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2307, '2026-10-21', 3598.4030755582, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3360, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3598.4030755582, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , 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+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-21', 3598.4030755582, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3598.4030755582, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , 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 = '132', userid = '2', storedetaildate = '2026-10-21 13:11:57' WHERE storedetailid = '3700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2307', '1', '12', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '132', '2', '2026-10-21 13:11:57','0','0'); -- id=15701
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6295;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02179', '1147', '190', '2179', '8', '400', '3200', '0', '', '0', '2026-10-21 13:11:57', '2179', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6295-8,','1','1','0','0','400','3200','0','','0','0.00','0','0','0','0'); -- id=4618
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 4618;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2179, '2026-10-21', 3198.5805116073, 3040, 3040
                    , 3040, 3040, 3040, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3040, 1520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3198.5805116073, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3198.5805116073, 3040, 3040
                    , 3040, 3040, 3040, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3040, 1520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3198.5805116073, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:11:57' WHERE storedetailid = '3539';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2179', '1', '8', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '4', '2', '2026-10-21 13:11:57','0','0'); -- id=15702
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1147', '104', '2202', '12', '450', '5400', '0', '', '0', '2026-10-21 13:11:57', '2202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6476-12,','1','1','0','0','450','5400','0','','0','0.00','0','0','0','0'); -- id=4619
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 = 4619;
 INSERT INTO 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-21', 5397.6046133373, 4590, 4590
                    , 4590, 4590, 4590, 4590
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4590, 4590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5397.6046133373, sellCostBuyPrice =sellCostBuyPrice+4590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4590
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5397.6046133373, 4590, 4590
                    , 4590, 4590, 4590, 4590
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4590, 4590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5397.6046133373, sellCostBuyPrice =sellCostBuyPrice+4590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4590
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '377', userid = '2', storedetaildate = '2026-10-21 13:11:57' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '12', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '389', '377', '2', '2026-10-21 13:11:57','0','0'); -- id=15703
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 763;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('445','01789', '1147', '138', '1789', '9', '475', '4275', '0', '', '0', '2026-10-21 13:11:57', '1789', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','763-9,','1','1','0','0','475','4275','0','','0','0.00','0','0','0','0'); -- id=4620
UPDATE sellbilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 445.00
        , lastbuyprice_withTax = 445, meanbuyprice_withTax = 445, lastbuyprice_withDiscountAndTax = 445
                where sellbilldetailid = 4620;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1789, '2026-10-21', 4273.1036522253, 4005, 4005
                    , 4005, 4005, 4005, 4005
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4005, 4005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4273.1036522253, sellCostBuyPrice =sellCostBuyPrice+4005
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4005, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4005
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4005, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4005
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4005
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4005
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4273.1036522253, 4005, 4005
                    , 4005, 4005, 4005, 4005
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4005, 4005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4273.1036522253, sellCostBuyPrice =sellCostBuyPrice+4005
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4005, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4005
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4005, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4005
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4005
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4005
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:11:57' WHERE storedetailid = '2802';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1789', '1', '9', '1', '1147', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '21', '2', '2026-10-21 13:11:57','0','0'); -- id=15704
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7058768.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 ('7024968.5','33800', '0', '2', 'اضافة فاتورة مبيعات', '1147', '7058768.5', '2026-10-21 13:11:57', '2',  'sellbillController.php','1','','0'); -- id=1425
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '33815', '33815', '2026-10-21', '2', '0', '0', '2026-10-21 13:11:57','اضافة فاتورة مبيعات رقم 1147','1','0',null,'0','1147','sellbillController.php?do=showDetail&sellbillid=1147'); -- id=4084
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4084', '419', '33800', '','0'); -- id=4191
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7058768', 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 ('4084', '398', '15', '','0'); -- id=4192
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510179.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 ('4084', '143', '33815', '','0'); -- id=4086
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13010940', 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 ( '30769', '30769', '2026-10-21', '2', '0', '0', '2026-10-21 13:11:57','اضافة فاتورة مبيعات رقم 1147 - صرف البضاعة من المخزن','1','0',null,'0','1147','sellbillController.php?do=showDetail&sellbillid=1147'); -- id=4085
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4085', '402', '30769', '','0'); -- id=4193
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12037796.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 ('4085', '382', '30769', '','0'); -- id=4087
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24901650.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='4084,0,4085' where sellbillid=1147;
 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-21', 33800, 32155, 32155
                    , 32155, 30769, 31462, 30769
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,32155, 20375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+33800, sellCostBuyPrice =sellCostBuyPrice+32155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+32155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+32155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30769, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+31462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30769
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+32155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20375
                        , returnSellVal = returnSellVal+0, 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-21', 33800, 32155, 32155
                    , 32155, 30769, 31462, 30769
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,32155, 20375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+33800, sellCostBuyPrice =sellCostBuyPrice+32155
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+32155, sellCostMeanBuyPrice = sellCostMeanBuyPrice+32155
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30769, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+31462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30769
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+32155
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20375
                        , returnSellVal = returnSellVal+0, 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, 33800, 32155, 32155
                    , 32155, 30769, 31462, 30769, 32155, 20375)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+33800, netSellCostBuyPrice = netSellCostBuyPrice+32155
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+32155
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+32155
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+30769
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+31462
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+30769
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+32155
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+20375;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad88e9ae1d77 and sellbillId = 1147 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:11:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:11:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16228
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:47:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:17:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:17:11', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16229
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:47:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:17:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:17:15', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16230
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:47:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:17:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:17:19', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=192'); -- id=16231
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:48:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:18:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:18:03', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16232

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad88fed84386
-- ----------------------------------------------------------------------------------------------------

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-21 13:18:03', '06ad88fed84386', '1', '0.00', '0', '5', '1', '17505.00', '17500', '17500', '0', '1', '2026-10-21 13:18:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '51' ,'0','','','','','-1','0','0','0','0','0','17500','0','','0','0','17500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1148
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','اضافة فاتورة مبيعات','1148', '0', '2026-10-21 13:18:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '17500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:18:03','0','0','',''); -- id=1370
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1148', '173', '2197', '6', '460', '2760', '0', '', '0', '2026-10-21 13:18:03', '2197', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6420-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=4621
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 = 4621;
 INSERT INTO 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-21', 2759.2116538132, 2760, 2760
                    , 2760, 2539.2, 2539.2, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2759.2116538132, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2539.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , 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+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-21', 2759.2116538132, 2760, 2760
                    , 2760, 2539.2, 2539.2, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2759.2116538132, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2539.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , 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 = '160', userid = '2', storedetaildate = '2026-10-21 13:18:03' WHERE storedetailid = '3566';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2197', '1', '6', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '166', '160', '2', '2026-10-21 13:18:03','0','0'); -- id=15705
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1148', '187', '2148', '6', '395', '2370', '0', '', '0', '2026-10-21 13:18:03', '2148', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6512-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=4622
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 = 4622;
 INSERT INTO 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-21', 2369.323050557, 2370, 2370
                    , 2370, 2180.4, 2180.4, 2180.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2370, 2370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2369.323050557, sellCostBuyPrice =sellCostBuyPrice+2370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2180.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2180.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2180.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2369.323050557, 2370, 2370
                    , 2370, 2180.4, 2180.4, 2180.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2370, 2370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2369.323050557, sellCostBuyPrice =sellCostBuyPrice+2370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2180.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2180.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2180.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:18:03' WHERE storedetailid = '3507';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2148', '1', '6', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '57', '51', '2', '2026-10-21 13:18:03','0','0'); -- id=15706
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1148', '115', '2018', '3', '430', '1290', '0', '', '0', '2026-10-21 13:18:03', '2018', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5985-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4623
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 = 4623;
 INSERT INTO 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-21', 1289.6315338475, 1290, 1290
                    , 1290, 1199.7, 1199.7, 1199.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1290, 1290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1289.6315338475, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1199.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1199.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1199.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1289.6315338475, 1290, 1290
                    , 1290, 1199.7, 1199.7, 1199.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1290, 1290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1289.6315338475, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1199.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1199.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1199.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:18:03' WHERE storedetailid = '3377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2018', '1', '3', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '2', '2026-10-21 13:18:03','0','0'); -- id=15707
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1148', '154', '1924', '3', '295', '885', '0', '', '0', '2026-10-21 13:18:03', '1924', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1085-3,','1','1','0','0','295','885','0','','0','0.00','0','0','0','0'); -- id=4624
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 = 4624;
 INSERT INTO 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-21', 884.74721508141, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+884.74721508141, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 884.74721508141, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+884.74721508141, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:18:03' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '3', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '63', '2', '2026-10-21 13:18:03','0','0'); -- id=15708
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 983;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('319','01889', '1148', '147', '1889', '12', '350', '4200', '0', '', '0', '2026-10-21 13:18:03', '1889', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','983-12,','1','1','0','0','350','4200','0','','0','0.00','0','0','0','0'); -- id=4625
UPDATE sellbilldetail SET  lastbuyprice = 319.00 , meanbuyprice = 319.00, lastbuyprice_withDiscount = 319.00, meanbuyprice_withDiscount = 319.00
        , lastbuyprice_withTax = 319, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 319
                where sellbilldetailid = 4625;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1889, '2026-10-21', 4198.8003427592, 3828, 3828
                    , 3828, 3828, 3828, 3828
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3828, 3828, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4198.8003427592, sellCostBuyPrice =sellCostBuyPrice+3828
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3828, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3828
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3828, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3828
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3828
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3828
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3828
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4198.8003427592, 3828, 3828
                    , 3828, 3828, 3828, 3828
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3828, 3828, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4198.8003427592, sellCostBuyPrice =sellCostBuyPrice+3828
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3828, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3828
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3828, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3828
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3828
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3828
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3828
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '153', userid = '2', storedetaildate = '2026-10-21 13:18:03' WHERE storedetailid = '2906';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1889', '1', '12', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '165', '153', '2', '2026-10-21 13:18:03','0','0'); -- id=15709
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6847;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02308', '1148', '169', '2308', '6', '280', '1680', '0', '', '0', '2026-10-21 13:18:03', '2308', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6847-6,','1','1','0','0','280','1680','0','','0','0.00','0','0','0','0'); -- id=4626
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4626;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2308, '2026-10-21', 1679.5201371037, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1560, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1679.5201371037, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1679.5201371037, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1679.5201371037, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '102', userid = '2', storedetaildate = '2026-10-21 13:18:03' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '6', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '108', '102', '2', '2026-10-21 13:18:03','0','0'); -- id=15710
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1148', '142', '1841', '9', '250', '2250', '0', '', '0', '2026-10-21 13:18:03', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-9,','1','1','0','0','250','2250','0','','0','0.00','0','0','0','0'); -- id=4627
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 = 4627;
 INSERT INTO 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-21', 2249.3573264781, 2115, 2115
                    , 2115, 2115, 2115, 2115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2115, 2070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2249.3573264781, sellCostBuyPrice =sellCostBuyPrice+2115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2115
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2249.3573264781, 2115, 2115
                    , 2115, 2115, 2115, 2115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2115, 2070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2249.3573264781, sellCostBuyPrice =sellCostBuyPrice+2115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2115
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '253', userid = '2', storedetaildate = '2026-10-21 13:18:03' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '9', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '262', '253', '2', '2026-10-21 13:18:03','0','0'); -- id=15711
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 984;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('314','01890', '1148', '147', '1890', '6', '345', '2070', '0', '', '0', '2026-10-21 13:18:03', '1890', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','984-6,','1','1','0','0','345','2070','0','','0','0.00','0','0','0','0'); -- id=4628
UPDATE sellbilldetail SET  lastbuyprice = 314.00 , meanbuyprice = 314.00, lastbuyprice_withDiscount = 314.00, meanbuyprice_withDiscount = 314.00
        , lastbuyprice_withTax = 314, meanbuyprice_withTax = 314, lastbuyprice_withDiscountAndTax = 314
                where sellbilldetailid = 4628;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1890, '2026-10-21', 2069.4087403599, 1884, 1884
                    , 1884, 1884, 1884, 1884
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1884, 1884, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2069.4087403599, sellCostBuyPrice =sellCostBuyPrice+1884
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1884, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1884, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1884
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1884
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1884
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2069.4087403599, 1884, 1884
                    , 1884, 1884, 1884, 1884
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1884, 1884, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2069.4087403599, sellCostBuyPrice =sellCostBuyPrice+1884
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1884, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1884
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1884, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1884
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1884
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1884
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1884
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '378', userid = '2', storedetaildate = '2026-10-21 13:18:03' WHERE storedetailid = '2907';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1890', '1', '6', '1', '1148', 'اضافة فاتورة مبيعات', 'sellbillController.php', '384', '378', '2', '2026-10-21 13:18:03','0','0'); -- id=15712
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7076268.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 ('7058768.5','17500', '0', '2', 'اضافة فاتورة مبيعات', '1148', '7076268.5', '2026-10-21 13:18:03', '2',  'sellbillController.php','1','','0'); -- id=1426
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '17505', '17505', '2026-10-21', '2', '0', '0', '2026-10-21 13:18:03','اضافة فاتورة مبيعات رقم 1148','1','0',null,'0','1148','sellbillController.php?do=showDetail&sellbillid=1148'); -- id=4086
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4086', '419', '17500', '','0'); -- id=4194
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7076268', 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 ('4086', '398', '5', '','0'); -- id=4195
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510184.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 ('4086', '143', '17505', '','0'); -- id=4088
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13028445', 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 ( '16131.3', '16131.3', '2026-10-21', '2', '0', '0', '2026-10-21 13:18:03','اضافة فاتورة مبيعات رقم 1148 - صرف البضاعة من المخزن','1','0',null,'0','1148','sellbillController.php?do=showDetail&sellbillid=1148'); -- id=4087
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4087', '402', '16131.3', '','0'); -- id=4196
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12053927.71', 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 ('4087', '382', '16131.3', '','0'); -- id=4089
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24885519.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='4086,0,4087' where sellbillid=1148;
 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-21', 17500, 16632, 16632
                    , 16632, 16131.3, 16131.3, 16131.3
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16632, 15807, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17500, sellCostBuyPrice =sellCostBuyPrice+16632
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16632, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16632
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16131.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16131.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16131.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16632
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15807
                        , returnSellVal = returnSellVal+0, 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-21', 17500, 16632, 16632
                    , 16632, 16131.3, 16131.3, 16131.3
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16632, 15807, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17500, sellCostBuyPrice =sellCostBuyPrice+16632
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16632, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16632
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16131.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16131.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16131.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16632
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15807
                        , returnSellVal = returnSellVal+0, 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, 17500, 16632, 16632
                    , 16632, 16131.3, 16131.3, 16131.3, 16632, 15807)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+17500, netSellCostBuyPrice = netSellCostBuyPrice+16632
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+16632
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+16632
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+16131.3
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+16131.3
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+16131.3
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+16632
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+15807;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad88fed84386 and sellbillId = 1148 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:48:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:18:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:18:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16233
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:48:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:18:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:18:22', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16234
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:48:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:18:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:18:27', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16235
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:48:48";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:50:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:20:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 13:20:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16236
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:50:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:20:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 13:20:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=16237
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:51:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:21:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:21:10', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=989'); -- id=16238
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:51:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:21:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:21:33', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=987'); -- id=16239
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:52:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:22:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:22:19', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=986'); -- id=16240
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:53:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:23:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('billsettingsController.php', '2026-10-21 13:23:36', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/billsettingsController.php?do=show'); -- id=16241
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:53:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:23:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:23:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16242
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:53:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:23:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:23:53', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16243
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:24:07', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16244
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:24:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16245
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:24:32', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16246
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-21 09:54:32";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:24:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:24:32', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16247
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:24:32', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16248
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-21 09:54:33";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:24:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:24:33', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16249
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:24:35', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16250
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:54:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:24:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:24:42', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=986'); -- id=16251
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:55:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:25:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:25:15', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16252

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8915c07cbe
-- ----------------------------------------------------------------------------------------------------

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-21 13:25:15', '06ad8915c07cbe', '1', '0.00', '0', '0', '1', '14775.00', '14775', '14775', '0', '1', '2026-10-21 13:25:15', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '25' ,'0','','','','','-1','0','0','0','0','0','14775','0','','0','0','14775','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1149
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','اضافة فاتورة مبيعات','1149', '0', '2026-10-21 13:25:15', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '14775', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:25:15','0','0','',''); -- id=1371
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6873;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('512','02319', '1149', '8', '2319', '5', '540', '2700', '0', '', '0', '2026-10-21 13:25:15', '2319', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6873-5,','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=4629
UPDATE sellbilldetail SET  lastbuyprice = 512.00 , meanbuyprice = 512.00, lastbuyprice_withDiscount = 512.00, meanbuyprice_withDiscount = 512.00
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where sellbilldetailid = 4629;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2319, '2026-10-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:25:15' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '1', '1149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 13:25:15','0','0'); -- id=15713
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6878;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('517','02324', '1149', '8', '2324', '10', '545', '5450', '0', '', '0', '2026-10-21 13:25:15', '2324', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6878-10,','1','1','0','0','545','5450','0','','0','0.00','0','0','0','0'); -- id=4630
UPDATE sellbilldetail SET  lastbuyprice = 517.00 , meanbuyprice = 517.00, lastbuyprice_withDiscount = 517.00, meanbuyprice_withDiscount = 517.00
        , lastbuyprice_withTax = 517, meanbuyprice_withTax = 517, lastbuyprice_withDiscountAndTax = 517
                where sellbilldetailid = 4630;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2324, '2026-10-21', 5450, 5170, 5170
                    , 5170, 5170, 5170, 5170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5170, 5170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5450, sellCostBuyPrice =sellCostBuyPrice+5170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5450, 5170, 5170
                    , 5170, 5170, 5170, 5170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5170, 5170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5450, sellCostBuyPrice =sellCostBuyPrice+5170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 13:25:15' WHERE storedetailid = '3718';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2324', '1', '10', '1', '1149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '35', '2', '2026-10-21 13:25:15','0','0'); -- id=15714
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6877;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('652','02323', '1149', '8', '2323', '5', '680', '3400', '0', '', '0', '2026-10-21 13:25:15', '2323', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6877-5,','1','1','0','0','680','3400','0','','0','0.00','0','0','0','0'); -- id=4631
UPDATE sellbilldetail SET  lastbuyprice = 652.00 , meanbuyprice = 652.00, lastbuyprice_withDiscount = 652.00, meanbuyprice_withDiscount = 652.00
        , lastbuyprice_withTax = 652, meanbuyprice_withTax = 652, lastbuyprice_withDiscountAndTax = 652
                where sellbilldetailid = 4631;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2323, '2026-10-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:25:15' WHERE storedetailid = '3717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '5', '1', '1149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 13:25:15','0','0'); -- id=15715
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6871;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('617','02317', '1149', '8', '2317', '5', '645', '3225', '0', '', '0', '2026-10-21 13:25:15', '2317', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6871-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=4632
UPDATE sellbilldetail SET  lastbuyprice = 617.00 , meanbuyprice = 617.00, lastbuyprice_withDiscount = 617.00, meanbuyprice_withDiscount = 617.00
        , lastbuyprice_withTax = 617, meanbuyprice_withTax = 617, lastbuyprice_withDiscountAndTax = 617
                where sellbilldetailid = 4632;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2317, '2026-10-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:25:15' WHERE storedetailid = '3711';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2317', '1', '5', '1', '1149', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 13:25:15','0','0'); -- id=15716
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7091043.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 ('7076268.5','14775', '0', '2', 'اضافة فاتورة مبيعات', '1149', '7091043.5', '2026-10-21 13:25:15', '2',  'sellbillController.php','1','','0'); -- id=1427
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '14775', '14775', '2026-10-21', '2', '0', '0', '2026-10-21 13:25:15','اضافة فاتورة مبيعات رقم 1149','1','0',null,'0','1149','sellbillController.php?do=showDetail&sellbillid=1149'); -- id=4088
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4088', '419', '14775', '','0'); -- id=4197
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7091043', 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 ('4088', '143', '14775', '','0'); -- id=4090
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13043220', 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 ( '14075', '14075', '2026-10-21', '2', '0', '0', '2026-10-21 13:25:15','اضافة فاتورة مبيعات رقم 1149 - صرف البضاعة من المخزن','1','0',null,'0','1149','sellbillController.php?do=showDetail&sellbillid=1149'); -- id=4089
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4089', '402', '14075', '','0'); -- id=4198
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12068002.71', 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 ('4089', '382', '14075', '','0'); -- id=4091
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24871444.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='4088,0,4089' where sellbillid=1149;
 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-21', 14775, 14075, 14075
                    , 14075, 14075, 14075, 14075
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14075, 14075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14775, sellCostBuyPrice =sellCostBuyPrice+14075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14075
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14075
                        , returnSellVal = returnSellVal+0, 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-21', 14775, 14075, 14075
                    , 14075, 14075, 14075, 14075
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14075, 14075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14775, sellCostBuyPrice =sellCostBuyPrice+14075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14075
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14075
                        , returnSellVal = returnSellVal+0, 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, 14775, 14075, 14075
                    , 14075, 14075, 14075, 14075, 14075, 14075)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+14775, netSellCostBuyPrice = netSellCostBuyPrice+14075
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+14075
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+14075
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+14075
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+14075
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+14075
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+14075
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14075;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8915c07cbe and sellbillId = 1149 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 09:55:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:25:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:25:16', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:01:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:31:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:31:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:01:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:31:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:31:51', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=16255
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:02:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:32:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:32:49', '1', 'editsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=986'); -- id=16256
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:03:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:33:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:33:20', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16257
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-21 10:03:20";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:33:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:33:20', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16258
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:03:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:33:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:33:23', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16259
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:03:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:33:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:33:28', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16260

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8930c1dc64
-- ----------------------------------------------------------------------------------------------------

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-21 13:33:28', '06ad8930c1dc64', '1', '0.00', '0', '0', '1', '28650.00', '28650', '28650', '0', '1', '2026-10-21 13:33:28', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '81' ,'0','','','','','-1','0','0','0','0','0','28650','0','','0','0','28650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1150
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','اضافة فاتورة مبيعات','1150', '0', '2026-10-21 13:33:28', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '28650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:33:28','0','0','',''); -- id=1372
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', '1150', '72', '2243', '6', '350', '2100', '0', '', '0', '2026-10-21 13:33:28', '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=4633
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 = 4633;
 INSERT INTO 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-21', 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-21', 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 = '24', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '3634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2243', '1', '6', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-21 13:33:28','0','0'); -- id=15717
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02084', '1150', '43', '2084', '6', '360', '2160', '0', '', '0', '2026-10-21 13:33:28', '2084', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6131-6,','1','1','0','0','360','2160','0','','0','0.00','0','0','0','0'); -- id=4634
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 = 4634;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2084, '2026-10-21', 2160, 2160, 2160
                    , 2160, 1944, 1944, 1944
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1944, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1944
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1944
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2160, 2160, 2160
                    , 2160, 1944, 1944, 1944
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1944, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1944
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1944
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:33:28' WHERE storedetailid = '3443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2084', '1', '6', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '60', '2', '2026-10-21 13:33:28','0','0'); -- id=15718
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1150', '195', '2234', '6', '340', '2040', '0', '', '0', '2026-10-21 13:33:28', '2234', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6546-6,','1','1','0','0','340','2040','0','','0','0.00','0','0','0','0'); -- id=4635
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 = 4635;
 INSERT INTO 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-21', 2040, 2040, 2040
                    , 2040, 1876.8, 1876.8, 1876.8
                    , 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+1876.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1876.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1876.8
                            , 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-21', 2040, 2040, 2040
                    , 2040, 1876.8, 1876.8, 1876.8
                    , 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+1876.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1876.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1876.8
                            , 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 = '39', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '3625';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2234', '1', '6', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '39', '2', '2026-10-21 13:33:28','0','0'); -- id=15719
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6126;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02081', '1150', '43', '2081', '3', '370', '1110', '0', '', '0', '2026-10-21 13:33:28', '2081', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6126-3,','1','1','0','0','370','1110','0','','0','0.00','0','0','0','0'); -- id=4636
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 = 4636;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2081, '2026-10-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+999
                            , 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-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+999
                            , 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 = '3', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '3440';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2081', '1', '3', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '3', '2', '2026-10-21 13:33:28','0','0'); -- id=15720
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1150', '147', '1884', '9', '460', '4140', '0', '', '0', '2026-10-21 13:33:28', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-9,','1','1','0','0','460','4140','0','','0','0.00','0','0','0','0'); -- id=4637
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 = 4637;
 INSERT INTO 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-21', 4140, 3861, 3861
                    , 3861, 3861, 3861, 3861
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3861, 3861, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+3861
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3861, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3861
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3861, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3861
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3861
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3861
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3861
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4140, 3861, 3861
                    , 3861, 3861, 3861, 3861
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3861, 3861, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+3861
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3861, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3861
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3861, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3861
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3861
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3861
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3861
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '288', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '9', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '297', '288', '2', '2026-10-21 13:33:28','0','0'); -- id=15721
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6847;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02308', '1150', '169', '2308', '9', '280', '2520', '0', '', '0', '2026-10-21 13:33:28', '2308', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6847-9,','1','1','0','0','280','2520','0','','0','0.00','0','0','0','0'); -- id=4638
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4638;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2308, '2026-10-21', 2520, 2340, 2340
                    , 2340, 2340, 2340, 2340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2340, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , 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+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-21', 2520, 2340, 2340
                    , 2340, 2340, 2340, 2340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2340, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , 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 = '93', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '9', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '93', '2', '2026-10-21 13:33:28','0','0'); -- id=15722
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 983;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('319','01889', '1150', '147', '1889', '9', '350', '3150', '0', '', '0', '2026-10-21 13:33:28', '1889', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','983-9,','1','1','0','0','350','3150','0','','0','0.00','0','0','0','0'); -- id=4639
UPDATE sellbilldetail SET  lastbuyprice = 319.00 , meanbuyprice = 319.00, lastbuyprice_withDiscount = 319.00, meanbuyprice_withDiscount = 319.00
        , lastbuyprice_withTax = 319, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 319
                where sellbilldetailid = 4639;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1889, '2026-10-21', 3150, 2871, 2871
                    , 2871, 2871, 2871, 2871
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2871, 2871, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+2871
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2871, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2871
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2871, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2871
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2871
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2871
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2871
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3150, 2871, 2871
                    , 2871, 2871, 2871, 2871
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2871, 2871, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+2871
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2871, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2871
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2871, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2871
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2871
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2871
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2871
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '2906';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1889', '1', '9', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '153', '144', '2', '2026-10-21 13:33:28','0','0'); -- id=15723
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+13 where id = 6339;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1150', '147', '1886', '18', '320', '5760', '0', '', '0', '2026-10-21 13:33:28', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6339-13,6765-5,','1','1','0','0','320','5760','0','','0','0.00','0','0','0','0'); -- id=4640
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4640;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 5760, 5202, 5202
                    , 5202, 5202, 5202, 5202
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 5202, 5202, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5760, sellCostBuyPrice =sellCostBuyPrice+5202
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5202, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5202
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5202, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5202
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5202
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5202
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5202
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5760, 5202, 5202
                    , 5202, 5202, 5202, 5202
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5202, 5202, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5760, sellCostBuyPrice =sellCostBuyPrice+5202
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5202, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5202
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5202, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5202
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5202
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5202
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5202
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '91', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '18', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '109', '91', '2', '2026-10-21 13:33:28','0','0'); -- id=15724
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1150', '103', '2237', '6', '480', '2880', '0', '', '0', '2026-10-21 13:33:28', '2237', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6638-6,','1','1','0','0','480','2880','0','','0','0.00','0','0','0','0'); -- id=4641
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 = 4641;
 INSERT INTO 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-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, 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+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-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, 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 = '39', userid = '2', storedetaildate = '2026-10-21 13:33:28' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '6', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '39', '2', '2026-10-21 13:33:28','0','0'); -- id=15725
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6088;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02056', '1150', '169', '2056', '9', '310', '2790', '0', '', '0', '2026-10-21 13:33:28', '2056', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6088-9,','1','1','0','0','310','2790','0','','0','0.00','0','0','0','0'); -- id=4642
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 436.01, lastbuyprice_withDiscountAndTax = 290
                where sellbilldetailid = 4642;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2056, '2026-10-21', 2790, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2610, 3924.09, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3924.09
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2790, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2610, 3924.09, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3924.09
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:33:28' WHERE storedetailid = '3415';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2056', '1', '9', '1', '1150', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '42', '2', '2026-10-21 13:33:28','0','0'); -- id=15726
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7119693.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 ('7091043.5','28650', '0', '2', 'اضافة فاتورة مبيعات', '1150', '7119693.5', '2026-10-21 13:33:28', '2',  'sellbillController.php','1','','0'); -- id=1428
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28650', '28650', '2026-10-21', '2', '0', '0', '2026-10-21 13:33:28','اضافة فاتورة مبيعات رقم 1150','1','0',null,'0','1150','sellbillController.php?do=showDetail&sellbillid=1150'); -- id=4090
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4090', '419', '28650', '','0'); -- id=4199
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7119693', 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 ('4090', '143', '28650', '','0'); -- id=4092
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13071870', 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 ( '26353.8', '26353.8', '2026-10-21', '2', '0', '0', '2026-10-21 13:33:28','اضافة فاتورة مبيعات رقم 1150 - صرف البضاعة من المخزن','1','0',null,'0','1150','sellbillController.php?do=showDetail&sellbillid=1150'); -- id=4091
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4091', '402', '26353.8', '','0'); -- id=4200
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12094356.51', 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 ('4091', '382', '26353.8', '','0'); -- id=4093
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24845090.79', 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='4090,0,4091' where sellbillid=1150;
 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-21', 28650, 27054, 27054
                    , 27054, 26353.8, 26353.8, 26353.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27054, 27198.09, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28650, sellCostBuyPrice =sellCostBuyPrice+27054
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27054, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27054
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26353.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26353.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26353.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27054
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+27198.09
                        , returnSellVal = returnSellVal+0, 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-21', 28650, 27054, 27054
                    , 27054, 26353.8, 26353.8, 26353.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27054, 27198.09, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28650, sellCostBuyPrice =sellCostBuyPrice+27054
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27054, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27054
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26353.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26353.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26353.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27054
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+27198.09
                        , returnSellVal = returnSellVal+0, 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, 28650, 27054, 27054
                    , 27054, 26353.8, 26353.8, 26353.8, 27054, 27198.09)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+28650, netSellCostBuyPrice = netSellCostBuyPrice+27054
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+27054
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+27054
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26353.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+26353.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26353.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+27054
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+27198.09;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8930c1dc64 and sellbillId = 1150 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:03:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:33:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:33:29', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:04:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:34:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 13:34:11', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:04:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:34:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:34:42', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16263
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:05:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:35:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:35:25', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16264
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-21 10:05:25";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:35:25', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:05:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:35:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 13:35:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16266
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:05:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:35:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 13:35:36', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=16267
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:05:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:35:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:35:46', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=986'); -- id=16268
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:06:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:36:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:36:53', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=16269
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 986;
UPDATE sellbill SET  sellbillsysdate = '2026-10-21 13:36:53', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '986';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 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 = 3911;
 INSERT INTO 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-21', 5760, 5760, 5760
                    , 5760, 5184, 5184, 5184
                    , 0, 0, 0, 0
                    , 0, 0, 0,16,0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5760, sellCostBuyPrice =sellCostBuyPrice-5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5184
                            , 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-21', 5760, 5760, 5760
                    , 5760, 5184, 5184, 5184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5760, sellCostBuyPrice =sellCostBuyPrice-5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5184
                            , 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 = '64', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2159', '1', '16', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '48', '64', '1', '2026-10-17 17:14:15','0','0'); -- id=15727
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6246;
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 3912;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1518
                            , 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-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-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1518
                            , 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '3', '1', '2026-10-17 17:14:15','0','0'); -- id=15728
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-24 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 = 3913;
 INSERT INTO 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-21', 12000, 12000, 12000
                    , 12000, 10800, 10800, 10800
                    , 0, 0, 0, 0
                    , 0, 0, 0,24,0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12000, sellCostBuyPrice =sellCostBuyPrice-12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10800
                            , 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-24
                        , netQuantityRet = netQuantityRet-0;
 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-21', 12000, 12000, 12000
                    , 12000, 10800, 10800, 10800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12000, sellCostBuyPrice =sellCostBuyPrice-12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10800
                            , 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 = '88', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '24', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '64', '88', '1', '2026-10-17 17:14:15','0','0'); -- id=15729
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 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 = 3914;
 INSERT INTO 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-21', 5100, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5100, 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-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-21', 5100, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5100, 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 = '270', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '15', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '255', '270', '1', '2026-10-17 17:14:15','0','0'); -- id=15730
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 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 = 3915;
 INSERT INTO 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-21', 3480, 2624, 2624
                    , 2624, 2624, 2624, 2624
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 2624, 2624, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3480, sellCostBuyPrice =sellCostBuyPrice-2624
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2624, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2624
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2624, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2624
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2624
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2624
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2624
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 3480, 2624, 2624
                    , 2624, 2624, 2624, 2624
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2624, 2624, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3480, sellCostBuyPrice =sellCostBuyPrice-2624
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2624, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2624
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2624, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2624
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2624
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2624
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2624
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '568', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '560', '568', '1', '2026-10-17 17:14:15','0','0'); -- id=15731
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 670;
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 3916;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1756, '2026-10-21', 2040, 1960, 1960
                    , 1960, 1960, 1960, 1960
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1960, 980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2040, sellCostBuyPrice =sellCostBuyPrice-1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-980
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2040, 1960, 1960
                    , 1960, 1960, 1960, 1960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1960, 980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2040, sellCostBuyPrice =sellCostBuyPrice-1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-980
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2769';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1756', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '5', '1', '2026-10-17 17:14:15','0','0'); -- id=15732
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 5982;
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 372.00, meanbuyprice_withDiscount = 372.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where sellbilldetailid = 3917;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2015, '2026-10-21', 1200, 1200, 1200
                    , 1200, 1116, 1116, 1116
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1200, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1116, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1116
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1116
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , 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-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-21', 1200, 1200, 1200
                    , 1200, 1116, 1116, 1116
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1200, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1116, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1116
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1116
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , 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 = '21', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2015', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '21', '1', '2026-10-17 17:14:15','0','0'); -- id=15733
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 158;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 3918;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 2000, 2000, 2000
                    , 2000, 1999.96, 1999.96, 1999.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2000, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1999.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1999.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1999.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-21', 2000, 2000, 2000
                    , 2000, 1999.96, 1999.96, 1999.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2000, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1999.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1999.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1999.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '97', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '93', '97', '1', '2026-10-17 17:14:15','0','0'); -- id=15734
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 977;
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 3919;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1883, '2026-10-21', 1185, 1092, 1092
                    , 1092, 1092, 1092, 1092
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1092, 1092, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1185, sellCostBuyPrice =sellCostBuyPrice-1092
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1092, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1092, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1092
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1092
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1092
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1185, 1092, 1092
                    , 1092, 1092, 1092, 1092
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1092, 1092, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1185, sellCostBuyPrice =sellCostBuyPrice-1092
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1092, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1092, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1092
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1092
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1092
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '46', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '43', '46', '1', '2026-10-17 17:14:15','0','0'); -- id=15735
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 1141;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 3920;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1952, '2026-10-21', 4800, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, 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-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-21', 4800, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, 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 = '8', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2969';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1952', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '8', '1', '2026-10-17 17:14:15','0','0'); -- id=15736
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 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 = 3921;
 INSERT INTO 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-21', 2000, 2000, 2000
                    , 2000, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2000, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-21', 2000, 2000, 2000
                    , 2000, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2000, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '92', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '88', '92', '1', '2026-10-17 17:14:15','0','0'); -- id=15737
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6140;
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 = 3922;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2089, '2026-10-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1110, sellCostBuyPrice =sellCostBuyPrice-1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-999
                            , 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-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1110, sellCostBuyPrice =sellCostBuyPrice-1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-999
                            , 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3448';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2089', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15738
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 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 = 3923;
 INSERT INTO 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-21', 1740, 1312, 1312
                    , 1312, 1312, 1312, 1312
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1312, 1312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1312, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1312
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1740, 1312, 1312
                    , 1312, 1312, 1312, 1312
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1312, 1312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1312, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1312
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '568', '572', '1', '2026-10-17 17:14:15','0','0'); -- id=15739
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 3924;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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-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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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 = '465', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '461', '465', '1', '2026-10-17 17:14:15','0','0'); -- id=15740
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 = 3925;
 INSERT INTO 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-21', 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-21', 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 = '108', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '16', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '92', '108', '1', '2026-10-17 17:14:15','0','0'); -- id=15741
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 3926;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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-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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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 = '469', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '465', '469', '1', '2026-10-17 17:14:15','0','0'); -- id=15742
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 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 = 3927;
 INSERT INTO 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-21', 8700, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8700, 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-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-21', 8700, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8700, 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 = '592', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '20', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '572', '592', '1', '2026-10-17 17:14:15','0','0'); -- id=15743
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 3928;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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-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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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 = '473', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '469', '473', '1', '2026-10-17 17:14:15','0','0'); -- id=15744
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 736;
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 = 3929;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1778, '2026-10-21', 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-21', 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 = '48', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2791';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1778', '1', '16', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '32', '48', '1', '2026-10-17 17:14:15','0','0'); -- id=15745
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 6155;
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 = 3930;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2095, '2026-10-21', 5280, 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-5280, 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-21', 5280, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5280, 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2095', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15746
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 987;
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 = 3931;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1893, '2026-10-21', 5280, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5280, sellCostBuyPrice =sellCostBuyPrice-4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 5280, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5280, sellCostBuyPrice =sellCostBuyPrice-4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2910';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1893', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '24', '1', '2026-10-17 17:14:15','0','0'); -- id=15747
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-23 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 = 3932;
 INSERT INTO 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-21', 7820, 6348, 6348
                    , 6348, 6348, 6348, 6348
                    , 0, 0, 0, 0
                    , 0, 0, 0,23,0, 6348, 6348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7820, sellCostBuyPrice =sellCostBuyPrice-6348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6348, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6348
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-23
                        , netQuantityRet = netQuantityRet-0;
 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-21', 7820, 6348, 6348
                    , 6348, 6348, 6348, 6348
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6348, 6348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7820, sellCostBuyPrice =sellCostBuyPrice-6348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6348, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6348
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '293', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '23', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '270', '293', '1', '2026-10-17 17:14:15','0','0'); -- id=15748
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 865;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 313.50
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 3933;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1840, '2026-10-21', 5940, 5940, 5940
                    , 5940, 5346, 5643, 5346
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 5940, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5940, sellCostBuyPrice =sellCostBuyPrice-5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5346, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5643
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5346
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5940
                            , 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-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-21', 5940, 5940, 5940
                    , 5940, 5346, 5643, 5346
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5940, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5940, sellCostBuyPrice =sellCostBuyPrice-5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5346, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5643
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5346
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5940
                            , 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 = '66', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '18', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '48', '66', '1', '2026-10-17 17:14:15','0','0'); -- id=15749
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 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 = 3934;
 INSERT INTO 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-21', 1440, 1440, 1440
                    , 1440, 1324.8, 1365.57, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1440, 929.97, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1365.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1324.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-929.97
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1440, 1440, 1440
                    , 1440, 1324.8, 1365.57, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 929.97, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1365.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1324.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-929.97
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1702', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '39', '42', '1', '2026-10-17 17:14:15','0','0'); -- id=15750
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 574;
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 3935;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1590, sellCostBuyPrice =sellCostBuyPrice-1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-795
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1590, sellCostBuyPrice =sellCostBuyPrice-1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-795
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '9', '1', '2026-10-17 17:14:15','0','0'); -- id=15751
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6096;
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 = 3936;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2063, '2026-10-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, 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-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-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, 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 = '21', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2063', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '21', '1', '2026-10-17 17:14:15','0','0'); -- id=15752
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6265;
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 533.60, meanbuyprice_withDiscount = 556.80
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 533.6
                where sellbilldetailid = 3937;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2171, '2026-10-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-870
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-870
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2171', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15753
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6092;
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 = 3938;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2059, '2026-10-21', 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-21', 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2059', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15754
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 574;
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 3939;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 3180, 3180, 3180
                    , 3180, 2925.6, 3052.8, 2925.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 3180, 1590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3180, sellCostBuyPrice =sellCostBuyPrice-3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2925.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3052.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2925.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1590
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 3180, 3180, 3180
                    , 3180, 2925.6, 3052.8, 2925.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3180, 1590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3180, sellCostBuyPrice =sellCostBuyPrice-3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2925.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3052.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2925.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1590
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '15', '1', '2026-10-17 17:14:15','0','0'); -- id=15755
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-27 where id = 1085;
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 = 3940;
 INSERT INTO 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-21', 7965, 7425, 7425
                    , 7425, 7425, 7425, 7425
                    , 0, 0, 0, 0
                    , 0, 0, 0,27,0, 7425, 7425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7965, sellCostBuyPrice =sellCostBuyPrice-7425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7425, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7425
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 7965, 7425, 7425
                    , 7425, 7425, 7425, 7425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7425, 7425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7965, sellCostBuyPrice =sellCostBuyPrice-7425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7425, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7425
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '27', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '63', '90', '1', '2026-10-17 17:14:15','0','0'); -- id=15756
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 330;
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 = 3941;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 3420, 3240, 3240
                    , 3240, 3240, 3240, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3420, sellCostBuyPrice =sellCostBuyPrice-3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3240
                            , 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-21', 3420, 3240, 3240
                    , 3240, 3240, 3240, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3420, sellCostBuyPrice =sellCostBuyPrice-3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3240
                            , 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '9', '1', '2026-10-17 17:14:15','0','0'); -- id=15757
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 333;
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 = 3942;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1463, '2026-10-21', 1410, 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-1410, 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-21', 1410, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1410, 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 = '25', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1463', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '22', '25', '1', '2026-10-17 17:14:15','0','0'); -- id=15758
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 6282;
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 = 3943;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2173, '2026-10-21', 4230, 4230, 4230
                    , 4230, 3807, 3807, 3807
                    , 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-3807, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3807
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3807
                            , 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-21', 4230, 4230, 4230
                    , 4230, 3807, 3807, 3807
                    , 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-3807, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3807
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3807
                            , 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 = '13', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3533';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2173', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '13', '1', '2026-10-17 17:14:15','0','0'); -- id=15759
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 490
                where sellbilldetailid = 3944;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1865, '2026-10-21', 3570, 3570, 3430
                    , 3570, 3570, 3570, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0,7,0, 3430, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3570, sellCostBuyPrice =sellCostBuyPrice-3570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-7
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3570, 3570, 3430
                    , 3570, 3570, 3570, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3430, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3570, sellCostBuyPrice =sellCostBuyPrice-3570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2882';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '7', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '8', '1', '2026-10-17 17:14:15','0','0'); -- id=15760
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 546;
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 3945;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1644, '2026-10-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1380, sellCostBuyPrice =sellCostBuyPrice-1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1242
                            , 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-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1380, sellCostBuyPrice =sellCostBuyPrice-1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1242
                            , 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1644', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '3', '1', '2026-10-17 17:14:15','0','0'); -- id=15761
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 3946;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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-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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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 = '477', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '473', '477', '1', '2026-10-17 17:14:15','0','0'); -- id=15762
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6246;
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 3947;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1518
                            , 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-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-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1518
                            , 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15763
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 3948;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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-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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1680, sellCostBuyPrice =sellCostBuyPrice-1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1679.96
                            , 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 = '481', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '477', '481', '1', '2026-10-17 17:14:15','0','0'); -- id=15764
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 546;
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 3949;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1644, '2026-10-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1380, sellCostBuyPrice =sellCostBuyPrice-1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1242
                            , 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-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1380, sellCostBuyPrice =sellCostBuyPrice-1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1242
                            , 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1644', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15765
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 551;
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 377.20, meanbuyprice_withDiscount = 377.20
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 377.2
                where sellbilldetailid = 3950;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1687, '2026-10-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2460, sellCostBuyPrice =sellCostBuyPrice-2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2263.2
                            , 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-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2460, sellCostBuyPrice =sellCostBuyPrice-2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2263.2
                            , 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 = '27', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1687', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '21', '27', '1', '2026-10-17 17:14:15','0','0'); -- id=15766
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 790;
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 = 3951;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4050
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4050
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '10', '1', '2026-10-17 17:14:15','0','0'); -- id=15767
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 529;
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 = 3952;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1627, '2026-10-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2820, sellCostBuyPrice =sellCostBuyPrice-2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2820
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2820, sellCostBuyPrice =sellCostBuyPrice-2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2820
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '1652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1627', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15768
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 985;
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 3953;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4740, sellCostBuyPrice =sellCostBuyPrice-4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4368
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4740, sellCostBuyPrice =sellCostBuyPrice-4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4368
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '222', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '210', '222', '1', '2026-10-17 17:14:15','0','0'); -- id=15769
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 6339;
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 3954;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2880, sellCostBuyPrice =sellCostBuyPrice-2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2601
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2880, sellCostBuyPrice =sellCostBuyPrice-2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2601
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '100', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '91', '100', '1', '2026-10-17 17:14:15','0','0'); -- id=15770
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 534;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 303.60
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 3955;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1632, '2026-10-21', 3960, 3960, 3960
                    , 3960, 3643.2, 3643.2, 3643.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 3960, 3960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3960, sellCostBuyPrice =sellCostBuyPrice-3960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3643.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3643.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3643.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 3960, 3960, 3960
                    , 3960, 3643.2, 3643.2, 3643.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3960, 3960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3960, sellCostBuyPrice =sellCostBuyPrice-3960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3643.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3643.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3643.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '1657';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1632', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15771
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 574;
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 3956;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1590, sellCostBuyPrice =sellCostBuyPrice-1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-795
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1590, sellCostBuyPrice =sellCostBuyPrice-1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-795
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '18', '1', '2026-10-17 17:14:15','0','0'); -- id=15772
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 330;
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 = 3957;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 1140, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1080
                            , 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-21', 1140, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1080
                            , 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15773
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 534;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 303.60
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 3958;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1632, '2026-10-21', 1980, 1980, 1980
                    , 1980, 1821.6, 1821.6, 1821.6
                    , 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-1821.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1821.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1821.6
                            , 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-21', 1980, 1980, 1980
                    , 1980, 1821.6, 1821.6, 1821.6
                    , 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-1821.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1821.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1821.6
                            , 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 = '18', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1657';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1632', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '18', '1', '2026-10-17 17:14:15','0','0'); -- id=15774
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6093;
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 = 3959;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2060, '2026-10-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2880, 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-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-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2880, 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 = '15', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2060', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '15', '1', '2026-10-17 17:14:15','0','0'); -- id=15775
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 531;
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 = 3960;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1629, '2026-10-21', 2700, 2700, 2700
                    , 2700, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2700, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2484
                            , 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-21', 2700, 2700, 2700
                    , 2700, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2700, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2484
                            , 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 = '21', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1654';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1629', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '21', '1', '2026-10-17 17:14:15','0','0'); -- id=15776
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6092;
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 = 3961;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2059, '2026-10-21', 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-21', 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2059', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15777
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 158;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 3962;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 1500, 1500, 1500
                    , 1500, 1499.97, 1499.97, 1499.97
                    , 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-1499.97, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1499.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1499.97
                            , 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-21', 1500, 1500, 1500
                    , 1500, 1499.97, 1499.97, 1499.97
                    , 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-1499.97, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1499.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1499.97
                            , 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 = '100', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '97', '100', '1', '2026-10-17 17:14:15','0','0'); -- id=15778
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 541;
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 = 3963;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1639, '2026-10-21', 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-21', 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-21 13:36:53' WHERE storedetailid = '1664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1639', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15779
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 936;
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 = 3964;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1866, '2026-10-21', 3120, 3120, 3120
                    , 3120, 2870.4, 2995.2, 2870.4
                    , 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-2870.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2870.4
                            , 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-21', 3120, 3120, 3120
                    , 3120, 2870.4, 2995.2, 2870.4
                    , 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-2870.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2870.4
                            , 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 = '14', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2883';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1866', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '14', '1', '2026-10-17 17:14:15','0','0'); -- id=15780
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 6155;
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 = 3965;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2095, '2026-10-21', 5280, 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-5280, 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-21', 5280, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5280, 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 = '24', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2095', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '24', '1', '2026-10-17 17:14:15','0','0'); -- id=15781
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 732;
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 378.00, meanbuyprice_withDiscount = 378.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 378
                where sellbilldetailid = 3966;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1774, '2026-10-21', 5040, 5040, 5040
                    , 5040, 4536, 4536, 4536
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5040, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4536
                            , 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-21', 5040, 5040, 5040
                    , 5040, 4536, 4536, 4536
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5040, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4536
                            , 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 = '100', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1774', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '88', '100', '1', '2026-10-17 17:14:15','0','0'); -- id=15782
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-2 where id = 790;
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 = 3967;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 900, 900, 900
                    , 900, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-900, sellCostMeanBuyPrice = sellCostMeanBuyPrice-900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-900
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 900, 900, 900
                    , 900, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-900, sellCostMeanBuyPrice = sellCostMeanBuyPrice-900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-900
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '2', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15783
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 6246;
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 3968;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 4950, 4950, 4950
                    , 4950, 4554, 4554, 4554
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4554, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4554
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4554
                            , 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-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-21', 4950, 4950, 4950
                    , 4950, 4554, 4554, 4554
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4554, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4554
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4554
                            , 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 = '15', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '15', '1', '2026-10-17 17:14:15','0','0'); -- id=15784
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 790;
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 = 3969;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 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-21', 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 = '15', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '15', '1', '2026-10-17 17:14:15','0','0'); -- id=15785
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 159;
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 379.99, meanbuyprice_withDiscount = 379.99
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 379.99
                where sellbilldetailid = 3970;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1409, '2026-10-21', 3040, 3040, 3040
                    , 3040, 3039.92, 3039.92, 3039.92
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3040, sellCostBuyPrice =sellCostBuyPrice-3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3039.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3039.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3039.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3040
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3040, 3040, 3040
                    , 3040, 3039.92, 3039.92, 3039.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3040, sellCostBuyPrice =sellCostBuyPrice-3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3039.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3039.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3039.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3040
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1409', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '60', '68', '1', '2026-10-17 17:14:15','0','0'); -- id=15786
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 792;
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 = 3971;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1809, '2026-10-21', 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-21', 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2823';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1809', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '12', '1', '2026-10-17 17:14:15','0','0'); -- id=15787
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6283;
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 288.00, meanbuyprice_withDiscount = 288.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 288
                where sellbilldetailid = 3972;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2174, '2026-10-21', 1920, 1920, 1920
                    , 1920, 1728, 1728, 1728
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1920, sellCostBuyPrice =sellCostBuyPrice-1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1728, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1728
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1728
                            , 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-21', 1920, 1920, 1920
                    , 1920, 1728, 1728, 1728
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1920, sellCostBuyPrice =sellCostBuyPrice-1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1728, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1728
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1728
                            , 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3534';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2174', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15788
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6265;
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 533.60, meanbuyprice_withDiscount = 556.80
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 533.6
                where sellbilldetailid = 3973;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2171, '2026-10-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-870
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1740, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-870
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2171', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '9', '1', '2026-10-17 17:14:15','0','0'); -- id=15789
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 330;
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 = 3974;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 1520, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1520, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1440
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-21', 1520, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1520, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1440
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '16', '1', '2026-10-17 17:14:15','0','0'); -- id=15790
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 944;
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 511.43, lastbuyprice_withDiscount = 478.40, meanbuyprice_withDiscount = 487.66
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 511.43, lastbuyprice_withDiscountAndTax = 478.4
                where sellbilldetailid = 3975;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1874, '2026-10-21', 2080, 2080, 2080
                    , 2045.72, 1913.6, 1950.64, 1913.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 2080, 2045.72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2080, sellCostBuyPrice =sellCostBuyPrice-2080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2045.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1913.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950.64
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1913.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2045.72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2080, 2080, 2080
                    , 2045.72, 1913.6, 1950.64, 1913.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2080, 2045.72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2080, sellCostBuyPrice =sellCostBuyPrice-2080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2045.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1913.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950.64
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1913.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2045.72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1874', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '8', '1', '2026-10-17 17:14:15','0','0'); -- id=15791
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 977;
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 3976;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1883, '2026-10-21', 3160, 2912, 2912
                    , 2912, 2912, 2912, 2912
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 2912, 2912, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3160, sellCostBuyPrice =sellCostBuyPrice-2912
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2912, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2912, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2912
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2912
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2912
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 3160, 2912, 2912
                    , 2912, 2912, 2912, 2912
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2912, 2912, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3160, sellCostBuyPrice =sellCostBuyPrice-2912
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2912, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2912, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2912
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2912
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2912
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '46', '54', '1', '2026-10-17 17:14:15','0','0'); -- id=15792
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 490
                where sellbilldetailid = 3977;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1865, '2026-10-21', 2550, 2550, 2450
                    , 2550, 2550, 2550, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 2450, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2550, sellCostBuyPrice =sellCostBuyPrice-2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2550, 2550, 2450
                    , 2550, 2550, 2550, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2450, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2550, sellCostBuyPrice =sellCostBuyPrice-2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2882';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '5', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '13', '1', '2026-10-17 17:14:15','0','0'); -- id=15793
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6093;
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 = 3978;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2060, '2026-10-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, 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-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-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, 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 = '18', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2060', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '18', '1', '2026-10-17 17:14:15','0','0'); -- id=15794
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 554;
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 = 3979;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1690, '2026-10-21', 2940, 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-2940, 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-21', 2940, 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-2940, 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 = '15', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2702';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1690', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '15', '1', '2026-10-17 17:14:15','0','0'); -- id=15795
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 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 = 3980;
 INSERT INTO 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-21', 1290, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1290, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , 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-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-21', 1290, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1290, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , 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 = '57', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '54', '57', '1', '2026-10-17 17:14:15','0','0'); -- id=15796
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 6143;
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where sellbilldetailid = 3981;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1919, '2026-10-21', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,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-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-21', 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 = '20', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2936';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1919', '1', '4', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '20', '1', '2026-10-17 17:14:15','0','0'); -- id=15797
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 1119;
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 = 3982;
 INSERT INTO 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-21', 4950, 4650, 4650
                    , 4650, 4650, 4650, 4650
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 4650, 4650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 4950, 4650, 4650
                    , 4650, 4650, 4650, 4650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4650, 4650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '111', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2949';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1932', '1', '15', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '96', '111', '1', '2026-10-17 17:14:15','0','0'); -- id=15798
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 981;
UPDATE sellbilldetail SET  lastbuyprice = 379.00 , meanbuyprice = 379.00, lastbuyprice_withDiscount = 379.00, meanbuyprice_withDiscount = 379.00
        , lastbuyprice_withTax = 379, meanbuyprice_withTax = 379, lastbuyprice_withDiscountAndTax = 379
                where sellbilldetailid = 3983;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1887, '2026-10-21', 4920, 4548, 4548
                    , 4548, 4548, 4548, 4548
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 4548, 4548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4920, sellCostBuyPrice =sellCostBuyPrice-4548
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4548, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4548
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4548, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4548
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4548
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4548
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4548
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 4920, 4548, 4548
                    , 4548, 4548, 4548, 4548
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4548, 4548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4920, sellCostBuyPrice =sellCostBuyPrice-4548
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4548, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4548
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4548, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4548
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4548
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4548
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4548
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '294', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2904';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1887', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '282', '294', '1', '2026-10-17 17:14:15','0','0'); -- id=15799
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 978;
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 = 3984;
 INSERT INTO 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-21', 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-21', 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 = '294', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '288', '294', '1', '2026-10-17 17:14:15','0','0'); -- id=15800
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 541;
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 = 3985;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1639, '2026-10-21', 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-21', 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1639', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '9', '1', '2026-10-17 17:14:15','0','0'); -- id=15801
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6264;
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 = 3986;
 INSERT INTO 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-21', 2940, 2940, 2940
                    , 2940, 2704.8, 2822.4, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2940, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2940, sellCostBuyPrice =sellCostBuyPrice-2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2822.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2704.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1470
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2940, 2940, 2940
                    , 2940, 2704.8, 2822.4, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2940, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2940, sellCostBuyPrice =sellCostBuyPrice-2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2822.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2704.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1470
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3530';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2170', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '36', '1', '2026-10-17 17:14:15','0','0'); -- id=15802
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 6143;
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where sellbilldetailid = 3987;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1919, '2026-10-21', 3600, 3400, 3400
                    , 3400, 3400, 3400, 3400
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 3400, 3400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 3600, 3400, 3400
                    , 3400, 3400, 3400, 3400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3400, 3400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2936';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1919', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '28', '1', '2026-10-17 17:14:15','0','0'); -- id=15803
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6264;
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 = 3988;
 INSERT INTO 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-21', 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-21', 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 = '39', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3530';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2170', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '36', '39', '1', '2026-10-17 17:14:15','0','0'); -- id=15804
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 1119;
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 = 3989;
 INSERT INTO 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-21', 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-21', 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 = '117', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2949';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1932', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '111', '117', '1', '2026-10-17 17:14:15','0','0'); -- id=15805
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 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 = 3990;
 INSERT INTO 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-21', 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-21', 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '57', '63', '1', '2026-10-17 17:14:15','0','0'); -- id=15806
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 554;
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 = 3991;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1690, '2026-10-21', 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-21', 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 = '24', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2702';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1690', '1', '9', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '24', '1', '2026-10-17 17:14:15','0','0'); -- id=15807
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 6083;
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 = 3992;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2051, '2026-10-21', 6750, 6750, 6750
                    , 6750, 6210, 6210, 6210
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 6750, 6750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 6750, 6750, 6750
                    , 6750, 6210, 6210, 6210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6750, 6750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2051', '1', '15', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '21', '1', '2026-10-17 17:14:15','0','0'); -- id=15808
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 551;
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 377.20, meanbuyprice_withDiscount = 377.20
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 377.2
                where sellbilldetailid = 3993;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1687, '2026-10-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2460, sellCostBuyPrice =sellCostBuyPrice-2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2263.2
                            , 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-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2460, sellCostBuyPrice =sellCostBuyPrice-2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2263.2
                            , 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 = '33', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1687', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '27', '33', '1', '2026-10-17 17:14:15','0','0'); -- id=15809
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 6082;
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 404.80, meanbuyprice_withDiscount = 404.80
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 404.8
                where sellbilldetailid = 3994;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2050, '2026-10-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1320, sellCostBuyPrice =sellCostBuyPrice-1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1214.4
                            , 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-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1320, sellCostBuyPrice =sellCostBuyPrice-1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1214.4
                            , 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2050', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '3', '1', '2026-10-17 17:14:15','0','0'); -- id=15810
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 777;
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 = 3995;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1795, '2026-10-21', 1380, 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-1380, 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-21', 1380, 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-1380, 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2808';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1795', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15811
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 552;
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 = 3996;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1688, '2026-10-21', 1380, 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-1380, 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-21', 1380, 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-1380, 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1688', '1', '3', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '6', '1', '2026-10-17 17:14:15','0','0'); -- id=15812
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 158;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 3997;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 6000, 6000, 6000
                    , 6000, 5999.88, 5999.88, 5999.88
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6000, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5999.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5999.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5999.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 6000, 6000, 6000
                    , 6000, 5999.88, 5999.88, 5999.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6000, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5999.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5999.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5999.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '100', '112', '1', '2026-10-17 17:14:15','0','0'); -- id=15813
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 1143;
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 = 3998;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1954, '2026-10-21', 5200, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5200, sellCostBuyPrice =sellCostBuyPrice-4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 5200, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5200, sellCostBuyPrice =sellCostBuyPrice-4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4960
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '8', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '36', '44', '1', '2026-10-17 17:14:15','0','0'); -- id=15814
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 1136;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 3999;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1948, '2026-10-21', 6240, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6240, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 6240, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6240, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '132', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2965';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1948', '1', '12', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '120', '132', '1', '2026-10-17 17:14:15','0','0'); -- id=15815
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 1147;
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 4000;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1956, '2026-10-21', 3480, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3480, sellCostBuyPrice =sellCostBuyPrice-3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-21', 3480, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3480, sellCostBuyPrice =sellCostBuyPrice-3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '34', '40', '1', '2026-10-17 17:14:15','0','0'); -- id=15816
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 1140;
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 = 4001;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1951, '2026-10-21', 7680, 7200, 7200
                    , 7200, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0,16,0, 7200, 7200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7680, sellCostBuyPrice =sellCostBuyPrice-7200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 7680, 7200, 7200
                    , 7200, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7200, 7200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7680, sellCostBuyPrice =sellCostBuyPrice-7200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2968';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1951', '1', '16', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '20', '1', '2026-10-17 17:14:15','0','0'); -- id=15817
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 545;
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 = 4002;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1643, '2026-10-21', 2820, 2820, 2820
                    , 2820, 2538, 2538, 2538
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2820, sellCostBuyPrice =sellCostBuyPrice-2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2538, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2538
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2538
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2820
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 2820, 2820, 2820
                    , 2820, 2538, 2538, 2538
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2820, sellCostBuyPrice =sellCostBuyPrice-2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2538, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2538
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2538
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2820
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1643', '1', '6', '0', '986', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '9', '1', '2026-10-17 17:14:15','0','0'); -- id=15818
CALL clientInUse(32,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '776460', userid = '1' WHERE clientid = '32';
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 ('32','1072840.00','296380.00','1','تعديل فاتورة مبيعات','986', '776460', '2026-10-17 17:14:15', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '296380', '0', null, '0', null, null,'', '0','1','1','296380','1','2026-10-17 17:14:15','0','0','',''); -- id=1373
UPDATE client SET  inUse = 0 where clientid = 32;
 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-21', 296380, 284084, 283844
                    , 284049.72, 271895.53, 272965.14, 271655.53
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,283844, 264784.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-296380, sellCostBuyPrice =sellCostBuyPrice-284084
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-283844, sellCostMeanBuyPrice = sellCostMeanBuyPrice-284049.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-271895.53, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-272965.14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-271655.53
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-283844
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-264784.69
                        , returnSellVal = returnSellVal-0, 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 (32, '2026-10-21', 296380, 284084, 283844
                    , 284049.72, 271895.53, 272965.14, 271655.53
                    , 0, 0, 0, 0
                    , 0, 0, 0, 283844, 264784.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-296380, sellCostBuyPrice =sellCostBuyPrice-284084
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-283844, sellCostMeanBuyPrice = sellCostMeanBuyPrice-284049.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-271895.53, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-272965.14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-271655.53
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-283844
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-264784.69
                        , returnSellVal = returnSellVal-0, 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, 296380, 284084, 283844
                    , 284049.72, 271895.53, 272965.14, 271655.53, 283844, 264784.69)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-296380, netSellCostBuyPrice = netSellCostBuyPrice-284084
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-283844
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-284049.72
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-271895.53
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-272965.14
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-271655.53
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-283844
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-264784.69;

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


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

COMMIT;
BEGIN;
CALL clientInUse(32,@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-17 17:14:15', '06ad368d9bf584', '32', '776460.00', '1072840', '0', '1', '296380', '296380', '0', '296380', '1', '2026-10-17 17:14:15', '', '1', '0', 'يوسف طازه - عميل', '2', '1', '3', '0', 'يوسف طازه - عميل', '680', '986', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-17','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=1151
UPDATE client SET  clientdebt = '1072840', userid = '1' WHERE clientid = '32';
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 ('32','776460.00','296380','0','اضافة فاتورة مبيعات (معدله)','1151', '1072840', '2026-10-21 13:36:53', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '296380', '0', null, '0', null, null,'', '0','1','1','296380','1','2026-10-17 17:14:15','0','0','',''); -- id=1374
UPDATE client SET  inUse = 0 where clientid = 32;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 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','02159', '1151', '99', '2159', '16.00', '360', '5760', '0', '', '0', '2026-10-21 13:36:53', '2159', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6251-16,','1','1','0','0','360','5760','0','','0','0.00','0','0','0','0'); -- id=4643
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 = 4643;
 INSERT INTO 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-21', 5760, 5760, 5760
                    , 5760, 5184, 5184, 5184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5760, sellCostBuyPrice =sellCostBuyPrice+5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5184
                            , 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-21', 5760, 5760, 5760
                    , 5760, 5184, 5184, 5184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5760, sellCostBuyPrice =sellCostBuyPrice+5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5184
                            , 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 = '48', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2159', '1', '16', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '64', '48', '1', '2026-10-21 13:36:53','0','0'); -- id=15819
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6246;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('506','02154', '1151', '188', '2154', '3.00', '550', '1650', '0', '', '0', '2026-10-21 13:36:53', '2154', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6246-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=4644
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 4644;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1518
                            , 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+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-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1518
                            , 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '12', '1', '2026-10-21 13:36:53','0','0'); -- id=15820
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+24 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', '1151', '99', '1775', '24.00', '500', '12000', '0', '', '0', '2026-10-21 13:36:53', '1775', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','733-24,','1','1','0','0','500','12000','0','','0','0.00','0','0','0','0'); -- id=4645
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 = 4645;
 INSERT INTO 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-21', 12000, 12000, 12000
                    , 12000, 10800, 10800, 10800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 24, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12000, sellCostBuyPrice =sellCostBuyPrice+12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10800
                            , 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+24
                        , netQuantityRet = netQuantityRet+0;
 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-21', 12000, 12000, 12000
                    , 12000, 10800, 10800, 10800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12000, sellCostBuyPrice =sellCostBuyPrice+12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10800
                            , 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-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '24', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '108', '84', '1', '2026-10-21 13:36:53','0','0'); -- id=15821
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 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', '1151', '104', '1467', '15.00', '340', '5100', '0', '', '0', '2026-10-21 13:36:53', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','688-15,','1','1','0','0','340','5100','0','','0','0.00','0','0','0','0'); -- id=4646
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 = 4646;
 INSERT INTO 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-21', 5100, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, 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+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-21', 5100, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, 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 = '278', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '15', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '293', '278', '1', '2026-10-21 13:36:53','0','0'); -- id=15822
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 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', '1151', '104', '2014', '8.00', '435', '3480', '0', '', '0', '2026-10-21 13:36:53', '2014', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5965-8,','1','1','0','0','435','3480','0','','0','0.00','0','0','0','0'); -- id=4647
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 = 4647;
 INSERT INTO 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-21', 3480, 2624, 2624
                    , 2624, 2624, 2624, 2624
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2624, 2624, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3480, sellCostBuyPrice =sellCostBuyPrice+2624
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2624, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2624
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2624, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2624
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2624
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2624
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2624
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3480, 2624, 2624
                    , 2624, 2624, 2624, 2624
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2624, 2624, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3480, sellCostBuyPrice =sellCostBuyPrice+2624
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2624, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2624
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2624, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2624
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2624
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2624
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2624
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '584', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '592', '584', '1', '2026-10-21 13:36:53','0','0'); -- id=15823
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 670;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('490','01756', '1151', '134', '1756', '4.00', '510', '2040', '0', '', '0', '2026-10-21 13:36:53', '1756', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','670-4,','1','1','0','0','510','2040','0','','0','0.00','0','0','0','0'); -- id=4648
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 4648;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1756, '2026-10-21', 2040, 1960, 1960
                    , 1960, 1960, 1960, 1960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1960, 980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2040, 1960, 1960
                    , 1960, 1960, 1960, 1960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1960, 980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+1960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2769';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1756', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '1', '1', '2026-10-21 13:36:53','0','0'); -- id=15824
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 5982;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('372','02015', '1151', '115', '2015', '3.00', '400', '1200', '0', '', '0', '2026-10-21 13:36:53', '2015', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5982-3,','1','1','0','0','400','1200','0','','0','0.00','0','0','0','0'); -- id=4649
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 372.00, meanbuyprice_withDiscount = 372.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where sellbilldetailid = 4649;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2015, '2026-10-21', 1200, 1200, 1200
                    , 1200, 1116, 1116, 1116
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1116, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1116
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1116
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , 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+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-21', 1200, 1200, 1200
                    , 1200, 1116, 1116, 1116
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1116, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1116
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1116
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , 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 = '18', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2015', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '21', '18', '1', '2026-10-21 13:36:53','0','0'); -- id=15825
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('499.99','01408', '1151', '99', '1408', '4.00', '500', '2000', '0', '', '0', '2026-10-21 13:36:53', '1408', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','158-4,','1','1','0','0','500','2000','0','','0','0.00','0','0','0','0'); -- id=4650
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 4650;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 2000, 2000, 2000
                    , 2000, 1999.96, 1999.96, 1999.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1999.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1999.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1999.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 2000, 2000, 2000
                    , 2000, 1999.96, 1999.96, 1999.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1999.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1999.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1999.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '112', '108', '1', '2026-10-21 13:36:53','0','0'); -- id=15826
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 977;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('364','01883', '1151', '147', '1883', '3.00', '395', '1185', '0', '', '0', '2026-10-21 13:36:53', '1883', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','977-3,','1','1','0','0','395','1185','0','','0','0.00','0','0','0','0'); -- id=4651
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 4651;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1883, '2026-10-21', 1185, 1092, 1092
                    , 1092, 1092, 1092, 1092
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1092, 1092, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1092
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1092, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1092, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1092
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1092
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1092
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1185, 1092, 1092
                    , 1092, 1092, 1092, 1092
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1092, 1092, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1092
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1092, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1092
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1092, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1092
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1092
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1092
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1092
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '54', '51', '1', '2026-10-21 13:36:53','0','0'); -- id=15827
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 1141;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','01952', '1151', '158', '1952', '8.00', '600', '4800', '0', '', '0', '2026-10-21 13:36:53', '1952', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1141-8,','1','1','0','0','600','4800','0','','0','0.00','0','0','0','0'); -- id=4652
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4652;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1952, '2026-10-21', 4800, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, 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+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-21', 4800, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2969';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1952', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15828
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 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', '1151', '99', '1775', '4.00', '500', '2000', '0', '', '0', '2026-10-21 13:36:53', '1775', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','733-4,','1','1','0','0','500','2000','0','','0','0.00','0','0','0','0'); -- id=4653
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 = 4653;
 INSERT INTO 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-21', 2000, 2000, 2000
                    , 2000, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 2000, 2000, 2000
                    , 2000, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '84', '80', '1', '2026-10-21 13:36:53','0','0'); -- id=15829
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6140;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02089', '1151', '122', '2089', '3.00', '370', '1110', '0', '', '0', '2026-10-21 13:36:53', '2089', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6140-3,','1','1','0','0','370','1110','0','','0','0.00','0','0','0','0'); -- id=4654
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 = 4654;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2089, '2026-10-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+999
                            , 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-21', 1110, 1110, 1110
                    , 1110, 999, 999, 999
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+999, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+999
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+999
                            , 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3448';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2089', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '3', '1', '2026-10-21 13:36:53','0','0'); -- id=15830
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 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', '1151', '104', '2014', '4.00', '435', '1740', '0', '', '0', '2026-10-21 13:36:53', '2014', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5965-4,','1','1','0','0','435','1740','0','','0','0.00','0','0','0','0'); -- id=4655
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 = 4655;
 INSERT INTO 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-21', 1740, 1312, 1312
                    , 1312, 1312, 1312, 1312
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1312, 1312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1312, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1312
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1740, 1312, 1312
                    , 1312, 1312, 1312, 1312
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1312, 1312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1312, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1312
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '580', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '584', '580', '1', '2026-10-21 13:36:53','0','0'); -- id=15831
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 154;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('419.99','01404', '1151', '99', '1404', '4.00', '420', '1680', '0', '', '0', '2026-10-21 13:36:53', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=4656
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 4656;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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+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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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 = '477', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '481', '477', '1', '2026-10-21 13:36:53','0','0'); -- id=15832
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', '1151', '99', '1775', '16.00', '500', '8000', '0', '', '0', '2026-10-21 13:36:53', '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=4657
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 = 4657;
 INSERT INTO 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-21', 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-21', 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-21 13:36:53' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '16', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '80', '64', '1', '2026-10-21 13:36:53','0','0'); -- id=15833
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 154;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('419.99','01404', '1151', '99', '1404', '4.00', '420', '1680', '0', '', '0', '2026-10-21 13:36:53', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=4658
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 4658;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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+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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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 = '473', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '477', '473', '1', '2026-10-21 13:36:53','0','0'); -- id=15834
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 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', '1151', '104', '2014', '20.00', '435', '8700', '0', '', '0', '2026-10-21 13:36:53', '2014', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5965-20,','1','1','0','0','435','8700','0','','0','0.00','0','0','0','0'); -- id=4659
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 = 4659;
 INSERT INTO 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-21', 8700, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8700, 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+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-21', 8700, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8700, 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 = '560', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '20', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '580', '560', '1', '2026-10-21 13:36:53','0','0'); -- id=15835
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 154;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('419.99','01404', '1151', '99', '1404', '4.00', '420', '1680', '0', '', '0', '2026-10-21 13:36:53', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=4660
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 4660;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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+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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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 = '469', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '473', '469', '1', '2026-10-21 13:36:53','0','0'); -- id=15836
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 736;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01778', '1151', '99', '1778', '16.00', '500', '8000', '0', '', '0', '2026-10-21 13:36:53', '1778', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','736-16,','1','1','0','0','500','8000','0','','0','0.00','0','0','0','0'); -- id=4661
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 = 4661;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1778, '2026-10-21', 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-21', 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 = '32', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2791';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1778', '1', '16', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '48', '32', '1', '2026-10-21 13:36:53','0','0'); -- id=15837
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6155;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02095', '1151', '177', '2095', '12.00', '440', '5280', '0', '', '0', '2026-10-21 13:36:53', '2095', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6155-12,','1','1','0','0','440','5280','0','','0','0.00','0','0','0','0'); -- id=4662
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 = 4662;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2095, '2026-10-21', 5280, 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+5280, 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-21', 5280, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5280, 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2095', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '12', '1', '2026-10-21 13:36:53','0','0'); -- id=15838
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 987;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01893', '1151', '137', '1893', '8.00', '660', '5280', '0', '', '0', '2026-10-21 13:36:53', '1893', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','987-8,','1','1','0','0','660','5280','0','','0','0.00','0','0','0','0'); -- id=4663
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 = 4663;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1893, '2026-10-21', 5280, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5280, sellCostBuyPrice =sellCostBuyPrice+4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5280, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5280, sellCostBuyPrice =sellCostBuyPrice+4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2910';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1893', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '16', '1', '2026-10-21 13:36:53','0','0'); -- id=15839
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+23 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', '1151', '104', '1467', '23.00', '340', '7820', '0', '', '0', '2026-10-21 13:36:53', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','688-23,','1','1','0','0','340','7820','0','','0','0.00','0','0','0','0'); -- id=4664
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 = 4664;
 INSERT INTO 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-21', 7820, 6348, 6348
                    , 6348, 6348, 6348, 6348
                    , 0, 0, 0, 0
                    , 0, 0, 0, 23, 0, 6348, 6348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7820, sellCostBuyPrice =sellCostBuyPrice+6348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6348, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6348
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+23
                        , netQuantityRet = netQuantityRet+0;
 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-21', 7820, 6348, 6348
                    , 6348, 6348, 6348, 6348
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6348, 6348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7820, sellCostBuyPrice =sellCostBuyPrice+6348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6348, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6348
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '23', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '278', '255', '1', '2026-10-21 13:36:53','0','0'); -- id=15840
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 865;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01840', '1151', '141', '1840', '18.00', '330', '5940', '0', '', '0', '2026-10-21 13:36:53', '1840', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','865-18,','1','1','0','0','330','5940','0','','0','0.00','0','0','0','0'); -- id=4665
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 313.50
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4665;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1840, '2026-10-21', 5940, 5940, 5940
                    , 5940, 5346, 5643, 5346
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 5940, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5940, sellCostBuyPrice =sellCostBuyPrice+5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5346, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5643
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5346
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5940
                            , 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+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-21', 5940, 5940, 5940
                    , 5940, 5346, 5643, 5346
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5940, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5940, sellCostBuyPrice =sellCostBuyPrice+5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5346, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5643
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5346
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5940
                            , 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 = '48', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '18', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '66', '48', '1', '2026-10-21 13:36:53','0','0'); -- id=15841
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1151', '128', '1702', '3.00', '480', '1440', '0', '', '0', '2026-10-21 13:36:53', '1702', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','565-3,','1','1','0','0','480','1440','0','','0','0.00','0','0','0','0'); -- id=4666
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 = 4666;
 INSERT INTO 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-21', 1440, 1440, 1440
                    , 1440, 1324.8, 1365.57, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1440, 929.97, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1365.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1324.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+929.97
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1440, 1440, 1440
                    , 1440, 1324.8, 1365.57, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 929.97, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1365.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1324.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+929.97
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1702', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '42', '39', '1', '2026-10-21 13:36:53','0','0'); -- id=15842
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 574;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('487.6','01711', '1151', '128', '1711', '3.00', '530', '1590', '0', '', '0', '2026-10-21 13:36:53', '1711', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','574-3,','1','1','0','0','530','1590','0','','0','0.00','0','0','0','0'); -- id=4667
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 4667;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1590, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+795
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1590, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+795
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '15', '1', '2026-10-21 13:36:53','0','0'); -- id=15843
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6096;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','21857', '1151', '108', '2063', '3.00', '480', '1440', '0', '', '0', '2026-10-21 13:36:53', '2063', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6096-3,','1','1','0','0','480','1440','0','','0','0.00','0','0','0','0'); -- id=4668
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 = 4668;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2063, '2026-10-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, 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+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-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, 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 = '18', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2063', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '21', '18', '1', '2026-10-21 13:36:53','0','0'); -- id=15844
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6265;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('533.6','02171', '1151', '128', '2171', '3.00', '580', '1740', '0', '', '0', '2026-10-21 13:36:53', '2171', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6265-3,','1','1','0','0','580','1740','0','','0','0.00','0','0','0','0'); -- id=4669
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 533.60, meanbuyprice_withDiscount = 556.80
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 533.6
                where sellbilldetailid = 4669;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2171, '2026-10-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2171', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15845
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6092;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02059', '1151', '108', '2059', '6.00', '430', '2580', '0', '', '0', '2026-10-21 13:36:53', '2059', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6092-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4670
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 = 4670;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2059, '2026-10-21', 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-21', 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2059', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15846
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 574;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('487.6','01711', '1151', '128', '1711', '6.00', '530', '3180', '0', '', '0', '2026-10-21 13:36:53', '1711', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','574-6,','1','1','0','0','530','3180','0','','0','0.00','0','0','0','0'); -- id=4671
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 4671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 3180, 3180, 3180
                    , 3180, 2925.6, 3052.8, 2925.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3180, 1590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3180, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2925.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3052.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2925.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3180, 3180, 3180
                    , 3180, 2925.6, 3052.8, 2925.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3180, 1590, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3180, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2925.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3052.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2925.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1590
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '9', '1', '2026-10-21 13:36:53','0','0'); -- id=15847
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+27 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', '1151', '154', '1924', '27.00', '295', '7965', '0', '', '0', '2026-10-21 13:36:53', '1924', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1085-27,','1','1','0','0','295','7965','0','','0','0.00','0','0','0','0'); -- id=4672
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 = 4672;
 INSERT INTO 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-21', 7965, 7425, 7425
                    , 7425, 7425, 7425, 7425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 27, 0, 7425, 7425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7965, sellCostBuyPrice =sellCostBuyPrice+7425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 7965, 7425, 7425
                    , 7425, 7425, 7425, 7425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7425, 7425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7965, sellCostBuyPrice =sellCostBuyPrice+7425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '27', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '90', '63', '1', '2026-10-21 13:36:53','0','0'); -- id=15848
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 330;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01460', '1151', '103', '1460', '9.00', '380', '3420', '0', '', '0', '2026-10-21 13:36:53', '1460', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','330-9,','1','1','0','0','380','3420','0','','0','0.00','0','0','0','0'); -- id=4673
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 = 4673;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 3420, 3240, 3240
                    , 3240, 3240, 3240, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3420, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , 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-21', 3420, 3240, 3240
                    , 3240, 3240, 3240, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3420, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , 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 = '7', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '16', '7', '1', '2026-10-21 13:36:53','0','0'); -- id=15849
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 333;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01463', '1151', '103', '1463', '3.00', '470', '1410', '0', '', '0', '2026-10-21 13:36:53', '1463', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','333-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=4674
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 = 4674;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1463, '2026-10-21', 1410, 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+1410, 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-21', 1410, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, 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 = '22', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1463', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '22', '1', '2026-10-21 13:36:53','0','0'); -- id=15850
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6282;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02173', '1151', '105', '2173', '9.00', '470', '4230', '0', '', '0', '2026-10-21 13:36:53', '2173', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6282-9,','1','1','0','0','470','4230','0','','0','0.00','0','0','0','0'); -- id=4675
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 = 4675;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2173, '2026-10-21', 4230, 4230, 4230
                    , 4230, 3807, 3807, 3807
                    , 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+3807, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3807
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3807
                            , 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-21', 4230, 4230, 4230
                    , 4230, 3807, 3807, 3807
                    , 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+3807, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3807
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3807
                            , 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 = '4', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3533';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2173', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '4', '1', '2026-10-21 13:36:53','0','0'); -- id=15851
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('510','01865', '1151', '146', '1865', '7.00', '510', '3570', '0', '', '0', '2026-10-21 13:36:53', '1865', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','510','3570','0','','0','0.00','0','0','0','0'); -- id=4676
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 490
                where sellbilldetailid = 4676;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1865, '2026-10-21', 3570, 3570, 3430
                    , 3570, 3570, 3570, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 3430, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3570, sellCostBuyPrice =sellCostBuyPrice+3570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3570, 3570, 3430
                    , 3570, 3570, 3570, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3430, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3570, sellCostBuyPrice =sellCostBuyPrice+3570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2882';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '7', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15852
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 546;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01644', '1151', '122', '1644', '3.00', '460', '1380', '0', '', '0', '2026-10-21 13:36:53', '1644', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','546-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4677
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4677;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1644, '2026-10-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1644', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '3', '1', '2026-10-21 13:36:53','0','0'); -- id=15853
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 154;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('419.99','01404', '1151', '99', '1404', '4.00', '420', '1680', '0', '', '0', '2026-10-21 13:36:53', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=4678
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 4678;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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+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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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 = '465', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '469', '465', '1', '2026-10-21 13:36:53','0','0'); -- id=15854
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6246;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('506','02154', '1151', '188', '2154', '3.00', '550', '1650', '0', '', '0', '2026-10-21 13:36:53', '2154', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6246-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=4679
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 4679;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1518
                            , 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+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-21', 1650, 1650, 1650
                    , 1650, 1518, 1518, 1518
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1518, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1518
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1518
                            , 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '9', '1', '2026-10-21 13:36:53','0','0'); -- id=15855
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 154;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('419.99','01404', '1151', '99', '1404', '4.00', '420', '1680', '0', '', '0', '2026-10-21 13:36:53', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=4680
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 4680;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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+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-21', 1680, 1680, 1680
                    , 1680, 1679.96, 1679.96, 1679.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1679.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1679.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1679.96
                            , 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 = '461', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '465', '461', '1', '2026-10-21 13:36:53','0','0'); -- id=15856
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 546;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01644', '1151', '122', '1644', '3.00', '460', '1380', '0', '', '0', '2026-10-21 13:36:53', '1644', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','546-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4681
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4681;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1644, '2026-10-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1644', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15857
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 551;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('377.2','01687', '1151', '126', '1687', '6.00', '410', '2460', '0', '', '0', '2026-10-21 13:36:53', '1687', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','551-6,','1','1','0','0','410','2460','0','','0','0.00','0','0','0','0'); -- id=4682
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 377.20, meanbuyprice_withDiscount = 377.20
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 377.2
                where sellbilldetailid = 4682;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1687, '2026-10-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2263.2
                            , 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-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2263.2
                            , 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 = '27', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1687', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '33', '27', '1', '2026-10-21 13:36:53','0','0'); -- id=15858
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 790;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01807', '1151', '122', '1807', '9.00', '450', '4050', '0', '', '0', '2026-10-21 13:36:53', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-9,','1','1','0','0','450','4050','0','','0','0.00','0','0','0','0'); -- id=4683
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 = 4683;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15859
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 529;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01627', '1151', '120', '1627', '6.00', '470', '2820', '0', '', '0', '2026-10-21 13:36:53', '1627', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','529-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=4684
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 = 4684;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1627, '2026-10-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '1652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1627', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15860
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 985;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('364','01891', '1151', '147', '1891', '12.00', '395', '4740', '0', '', '0', '2026-10-21 13:36:53', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-12,','1','1','0','0','395','4740','0','','0','0.00','0','0','0','0'); -- id=4685
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 4685;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4740, sellCostBuyPrice =sellCostBuyPrice+4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4368
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4740, sellCostBuyPrice =sellCostBuyPrice+4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4368
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '210', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '222', '210', '1', '2026-10-21 13:36:53','0','0'); -- id=15861
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6339;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1151', '147', '1886', '9.00', '320', '2880', '0', '', '0', '2026-10-21 13:36:53', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6339-9,','1','1','0','0','320','2880','0','','0','0.00','0','0','0','0'); -- id=4686
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4686;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '91', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '100', '91', '1', '2026-10-21 13:36:53','0','0'); -- id=15862
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 534;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01632', '1151', '120', '1632', '12.00', '330', '3960', '0', '', '0', '2026-10-21 13:36:53', '1632', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','534-12,','1','1','0','0','330','3960','0','','0','0.00','0','0','0','0'); -- id=4687
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 303.60
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 4687;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1632, '2026-10-21', 3960, 3960, 3960
                    , 3960, 3643.2, 3643.2, 3643.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3960, 3960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3643.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3643.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3643.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3960, 3960, 3960
                    , 3960, 3643.2, 3643.2, 3643.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3960, 3960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3643.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3643.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3643.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '1657';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1632', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15863
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 574;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('487.6','01711', '1151', '128', '1711', '3.00', '530', '1590', '0', '', '0', '2026-10-21 13:36:53', '1711', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','574-3,','1','1','0','0','530','1590','0','','0','0.00','0','0','0','0'); -- id=4688
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 487.60, meanbuyprice_withDiscount = 508.80
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where sellbilldetailid = 4688;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1711, '2026-10-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1590, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+795
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1590, 1590, 1590
                    , 1590, 1462.8, 1526.4, 1462.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1590, 795, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1590, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1462.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1526.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1462.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+795
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1711', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15864
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 330;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01460', '1151', '103', '1460', '3.00', '380', '1140', '0', '', '0', '2026-10-21 13:36:53', '1460', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','330-3,','1','1','0','0','380','1140','0','','0','0.00','0','0','0','0'); -- id=4689
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 = 4689;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 1140, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , 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-21', 1140, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , 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 = '4', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '4', '1', '2026-10-21 13:36:53','0','0'); -- id=15865
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 534;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01632', '1151', '120', '1632', '6.00', '330', '1980', '0', '', '0', '2026-10-21 13:36:53', '1632', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','534-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=4690
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 303.60
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 4690;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1632, '2026-10-21', 1980, 1980, 1980
                    , 1980, 1821.6, 1821.6, 1821.6
                    , 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+1821.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1821.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1821.6
                            , 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-21', 1980, 1980, 1980
                    , 1980, 1821.6, 1821.6, 1821.6
                    , 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+1821.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1821.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1821.6
                            , 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1657';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1632', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15866
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02060', '1151', '108', '2060', '6.00', '480', '2880', '0', '', '0', '2026-10-21 13:36:53', '2060', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6093-6,','1','1','0','0','480','2880','0','','0','0.00','0','0','0','0'); -- id=4691
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 = 4691;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2060, '2026-10-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, 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+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-21', 2880, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, 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 = '12', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2060', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '12', '1', '2026-10-21 13:36:53','0','0'); -- id=15867
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 531;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01629', '1151', '120', '1629', '6.00', '450', '2700', '0', '', '0', '2026-10-21 13:36:53', '1629', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','531-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4692
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 = 4692;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1629, '2026-10-21', 2700, 2700, 2700
                    , 2700, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , 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-21', 2700, 2700, 2700
                    , 2700, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , 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 = '15', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1654';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1629', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '21', '15', '1', '2026-10-21 13:36:53','0','0'); -- id=15868
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6092;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02059', '1151', '108', '2059', '6.00', '430', '2580', '0', '', '0', '2026-10-21 13:36:53', '2059', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6092-3,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4693
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 = 4693;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2059, '2026-10-21', 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-21', 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2059', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15869
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('499.99','01408', '1151', '99', '1408', '3.00', '500', '1500', '0', '', '0', '2026-10-21 13:36:53', '1408', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','158-3,','1','1','0','0','500','1500','0','','0','0.00','0','0','0','0'); -- id=4694
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 4694;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 1500, 1500, 1500
                    , 1500, 1499.97, 1499.97, 1499.97
                    , 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+1499.97, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1499.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1499.97
                            , 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-21', 1500, 1500, 1500
                    , 1500, 1499.97, 1499.97, 1499.97
                    , 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+1499.97, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1499.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1499.97
                            , 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 = '105', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '108', '105', '1', '2026-10-21 13:36:53','0','0'); -- id=15870
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 541;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01639', '1151', '122', '1639', '6.00', '350', '2100', '0', '', '0', '2026-10-21 13:36:53', '1639', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','541-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=4695
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 = 4695;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1639, '2026-10-21', 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-21', 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1639', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '3', '1', '2026-10-21 13:36:53','0','0'); -- id=15871
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 936;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01866', '1151', '146', '1866', '8.00', '390', '3120', '0', '', '0', '2026-10-21 13:36:53', '1866', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','936-8,','1','1','0','0','390','3120','0','','0','0.00','0','0','0','0'); -- id=4696
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 = 4696;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1866, '2026-10-21', 3120, 3120, 3120
                    , 3120, 2870.4, 2995.2, 2870.4
                    , 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+2870.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2870.4
                            , 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-21', 3120, 3120, 3120
                    , 3120, 2870.4, 2995.2, 2870.4
                    , 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+2870.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2870.4
                            , 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 = '6', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2883';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1866', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '14', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15872
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6155;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02095', '1151', '177', '2095', '12.00', '440', '5280', '0', '', '0', '2026-10-21 13:36:53', '2095', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6155-12,','1','1','0','0','440','5280','0','','0','0.00','0','0','0','0'); -- id=4697
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 = 4697;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2095, '2026-10-21', 5280, 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+5280, 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-21', 5280, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5280, 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2095', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15873
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 732;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01774', '1151', '99', '1774', '12.00', '420', '5040', '0', '', '0', '2026-10-21 13:36:53', '1774', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','732-12,','1','1','0','0','420','5040','0','','0','0.00','0','0','0','0'); -- id=4698
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 378.00, meanbuyprice_withDiscount = 378.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 378
                where sellbilldetailid = 4698;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1774, '2026-10-21', 5040, 5040, 5040
                    , 5040, 4536, 4536, 4536
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4536
                            , 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-21', 5040, 5040, 5040
                    , 5040, 4536, 4536, 4536
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4536
                            , 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 = '88', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2787';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1774', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '100', '88', '1', '2026-10-21 13:36:53','0','0'); -- id=15874
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 790;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01807', '1151', '122', '1807', '2.00', '450', '900', '0', '', '0', '2026-10-21 13:36:53', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-2,','1','1','0','0','450','900','0','','0','0.00','0','0','0','0'); -- id=4699
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 = 4699;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 900, 900, 900
                    , 900, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 900, 900, 900
                    , 900, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '2', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '4', '1', '2026-10-21 13:36:53','0','0'); -- id=15875
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6246;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('506','02154', '1151', '188', '2154', '9.00', '550', '4950', '0', '', '0', '2026-10-21 13:36:53', '2154', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6246-9,','1','1','0','0','550','4950','0','','0','0.00','0','0','0','0'); -- id=4700
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 506.00, meanbuyprice_withDiscount = 506.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 506
                where sellbilldetailid = 4700;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2154, '2026-10-21', 4950, 4950, 4950
                    , 4950, 4554, 4554, 4554
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4554, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4554
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4554
                            , 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+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-21', 4950, 4950, 4950
                    , 4950, 4554, 4554, 4554
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4554, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4554
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4554
                            , 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3513';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2154', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15876
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 790;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01807', '1151', '122', '1807', '3.00', '450', '1350', '0', '', '0', '2026-10-21 13:36:53', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4701
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 = 4701;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-21', 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-21', 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 = '1', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '1', '1', '2026-10-21 13:36:53','0','0'); -- id=15877
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 159;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('379.99','01409', '1151', '99', '1409', '8.00', '380', '3040', '0', '', '0', '2026-10-21 13:36:53', '1409', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','159-8,','1','1','0','0','380','3040','0','','0','0.00','0','0','0','0'); -- id=4702
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 379.99, meanbuyprice_withDiscount = 379.99
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 379.99
                where sellbilldetailid = 4702;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1409, '2026-10-21', 3040, 3040, 3040
                    , 3040, 3039.92, 3039.92, 3039.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3040, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3039.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3039.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3039.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3040, 3040, 3040
                    , 3040, 3039.92, 3039.92, 3039.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3040, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3039.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3039.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3039.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1409', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '68', '60', '1', '2026-10-21 13:36:53','0','0'); -- id=15878
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 792;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01809', '1151', '122', '1809', '3.00', '350', '1050', '0', '', '0', '2026-10-21 13:36:53', '1809', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','792-3,','1','1','0','0','350','1050','0','','0','0.00','0','0','0','0'); -- id=4703
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 = 4703;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1809, '2026-10-21', 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-21', 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2823';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1809', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '9', '1', '2026-10-21 13:36:53','0','0'); -- id=15879
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6283;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('288','02174', '1151', '105', '2174', '6.00', '320', '1920', '0', '', '0', '2026-10-21 13:36:53', '2174', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6283-6,','1','1','0','0','320','1920','0','','0','0.00','0','0','0','0'); -- id=4704
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 288.00, meanbuyprice_withDiscount = 288.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 288
                where sellbilldetailid = 4704;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2174, '2026-10-21', 1920, 1920, 1920
                    , 1920, 1728, 1728, 1728
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1728, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1728
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1728
                            , 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-21', 1920, 1920, 1920
                    , 1920, 1728, 1728, 1728
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1728, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1728
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1728
                            , 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3534';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2174', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15880
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6265;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('533.6','02171', '1151', '128', '2171', '3.00', '580', '1740', '0', '', '0', '2026-10-21 13:36:53', '2171', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6265-3,','1','1','0','0','580','1740','0','','0','0.00','0','0','0','0'); -- id=4705
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 533.60, meanbuyprice_withDiscount = 556.80
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 533.6
                where sellbilldetailid = 4705;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2171, '2026-10-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1740, 1740, 1740
                    , 1740, 1600.8, 1670.4, 1600.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1740, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1670.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3531';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2171', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '3', '1', '2026-10-21 13:36:53','0','0'); -- id=15881
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 330;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01460', '1151', '103', '1460', '4.00', '380', '1520', '0', '', '0', '2026-10-21 13:36:53', '1460', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','330-3,','1','1','0','0','380','1520','0','','0','0.00','0','0','0','0'); -- id=4706
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 = 4706;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1460, '2026-10-21', 1520, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 1520, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15882
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 944;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('478.4','01874', '1151', '146', '1874', '4.00', '520', '2080', '0', '', '0', '2026-10-21 13:36:53', '1874', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','944-4,','1','1','0','0','520','2080','0','','0','0.00','0','0','0','0'); -- id=4707
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 511.43, lastbuyprice_withDiscount = 478.40, meanbuyprice_withDiscount = 487.66
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 511.43, lastbuyprice_withDiscountAndTax = 478.4
                where sellbilldetailid = 4707;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1874, '2026-10-21', 2080, 2080, 2080
                    , 2045.72, 1913.6, 1950.64, 1913.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2080, 2045.72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2080, sellCostBuyPrice =sellCostBuyPrice+2080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2045.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1913.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950.64
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1913.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2045.72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2080, 2080, 2080
                    , 2045.72, 1913.6, 1950.64, 1913.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2080, 2045.72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2080, sellCostBuyPrice =sellCostBuyPrice+2080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2045.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1913.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950.64
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1913.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2045.72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1874', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '4', '1', '2026-10-21 13:36:53','0','0'); -- id=15883
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 977;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('364','01883', '1151', '147', '1883', '8.00', '395', '3160', '0', '', '0', '2026-10-21 13:36:53', '1883', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','977-8,','1','1','0','0','395','3160','0','','0','0.00','0','0','0','0'); -- id=4708
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 4708;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1883, '2026-10-21', 3160, 2912, 2912
                    , 2912, 2912, 2912, 2912
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2912, 2912, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3160, sellCostBuyPrice =sellCostBuyPrice+2912
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2912, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2912, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2912
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2912
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2912
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3160, 2912, 2912
                    , 2912, 2912, 2912, 2912
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2912, 2912, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3160, sellCostBuyPrice =sellCostBuyPrice+2912
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2912, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2912
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2912, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2912
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2912
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2912
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2912
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '51', '43', '1', '2026-10-21 13:36:53','0','0'); -- id=15884
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('510','01865', '1151', '146', '1865', '5.00', '510', '2550', '0', '', '0', '2026-10-21 13:36:53', '1865', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','510','2550','0','','0','0.00','0','0','0','0'); -- id=4709
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 490
                where sellbilldetailid = 4709;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1865, '2026-10-21', 2550, 2550, 2450
                    , 2550, 2550, 2550, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2450, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2550, 2550, 2450
                    , 2550, 2550, 2550, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2450, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '2882';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '5', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '1', '1', '2026-10-21 13:36:53','0','0'); -- id=15885
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02060', '1151', '108', '2060', '3.00', '480', '1440', '0', '', '0', '2026-10-21 13:36:53', '2060', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6093-3,','1','1','0','0','480','1440','0','','0','0.00','0','0','0','0'); -- id=4710
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 = 4710;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2060, '2026-10-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, 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+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-21', 1440, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2060', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '9', '1', '2026-10-21 13:36:53','0','0'); -- id=15886
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 554;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01690', '1151', '126', '1690', '6.00', '490', '2940', '0', '', '0', '2026-10-21 13:36:53', '1690', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','554-6,','1','1','0','0','490','2940','0','','0','0.00','0','0','0','0'); -- id=4711
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 = 4711;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1690, '2026-10-21', 2940, 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+2940, 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-21', 2940, 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+2940, 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 = '18', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2702';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1690', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '18', '1', '2026-10-21 13:36:53','0','0'); -- id=15887
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1151', '102', '1933', '3.00', '430', '1290', '0', '', '0', '2026-10-21 13:36:53', '1933', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1120-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4712
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 = 4712;
 INSERT INTO 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-21', 1290, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , 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+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-21', 1290, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , 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 = '60', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '63', '60', '1', '2026-10-21 13:36:53','0','0'); -- id=15888
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 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', '1151', '104', '2202', '4', '450', '1800', '0', '', '0', '2026-10-21 13:36:53', '2202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6476-4,','1','1','0','0','450','1800','0','','0','0.00','0','0','0','0'); -- id=4713
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 = 4713;
 INSERT INTO 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-21', 1800, 1530, 1530
                    , 1530, 1530, 1530, 1530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1530, 1530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1800, 1530, 1530
                    , 1530, 1530, 1530, 1530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1530, 1530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '373', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '4', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '377', '373', '1', '2026-10-21 13:36:53','0','0'); -- id=15889
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 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', '1151', '102', '1932', '15.00', '330', '4950', '0', '', '0', '2026-10-21 13:36:53', '1932', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1119-15,','1','1','0','0','330','4950','0','','0','0.00','0','0','0','0'); -- id=4714
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 = 4714;
 INSERT INTO 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-21', 4950, 4650, 4650
                    , 4650, 4650, 4650, 4650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4650, 4650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4950, 4650, 4650
                    , 4650, 4650, 4650, 4650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4650, 4650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '102', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2949';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1932', '1', '15', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '117', '102', '1', '2026-10-21 13:36:53','0','0'); -- id=15890
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 981;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('379','01887', '1151', '147', '1887', '12.00', '410', '4920', '0', '', '0', '2026-10-21 13:36:53', '1887', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','981-12,','1','1','0','0','410','4920','0','','0','0.00','0','0','0','0'); -- id=4715
UPDATE sellbilldetail SET  lastbuyprice = 379.00 , meanbuyprice = 379.00, lastbuyprice_withDiscount = 379.00, meanbuyprice_withDiscount = 379.00
        , lastbuyprice_withTax = 379, meanbuyprice_withTax = 379, lastbuyprice_withDiscountAndTax = 379
                where sellbilldetailid = 4715;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1887, '2026-10-21', 4920, 4548, 4548
                    , 4548, 4548, 4548, 4548
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4548, 4548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4920, sellCostBuyPrice =sellCostBuyPrice+4548
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4548, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4548
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4548, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4548
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4548
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4548
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4548
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4920, 4548, 4548
                    , 4548, 4548, 4548, 4548
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4548, 4548, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4920, sellCostBuyPrice =sellCostBuyPrice+4548
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4548, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4548
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4548, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4548
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4548
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4548
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4548
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2904';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1887', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '294', '282', '1', '2026-10-21 13:36:53','0','0'); -- id=15891
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', '1151', '147', '1884', '6.00', '460', '2760', '0', '', '0', '2026-10-21 13:36:53', '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=4716
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 = 4716;
 INSERT INTO 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-21', 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-21', 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 = '288', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '294', '288', '1', '2026-10-21 13:36:53','0','0'); -- id=15892
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 541;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01639', '1151', '122', '1639', '3.00', '350', '1050', '0', '', '0', '2026-10-21 13:36:53', '1639', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','541-3,','1','1','0','0','350','1050','0','','0','0.00','0','0','0','0'); -- id=4717
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 = 4717;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1639, '2026-10-21', 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-21', 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '1664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1639', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '0', '1', '2026-10-21 13:36:53','0','0'); -- id=15893
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1151', '128', '2170', '6.00', '490', '2940', '0', '', '0', '2026-10-21 13:36:53', '2170', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6264-6,','1','1','0','0','490','2940','0','','0','0.00','0','0','0','0'); -- id=4718
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 = 4718;
 INSERT INTO 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-21', 2940, 2940, 2940
                    , 2940, 2704.8, 2822.4, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2940, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2822.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1470
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2940, 2940, 2940
                    , 2940, 2704.8, 2822.4, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2940, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2822.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1470
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3530';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2170', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '39', '33', '1', '2026-10-21 13:36:53','0','0'); -- id=15894
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 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', '1151', '104', '2202', '8', '450', '3600', '0', '', '0', '2026-10-21 13:36:53', '2202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6476-8,','1','1','0','0','450','3600','0','','0','0.00','0','0','0','0'); -- id=4719
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 = 4719;
 INSERT INTO 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-21', 3600, 3060, 3060
                    , 3060, 3060, 3060, 3060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060
                            , 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+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-21', 3600, 3060, 3060
                    , 3060, 3060, 3060, 3060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060
                            , 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 = '365', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '373', '365', '1', '2026-10-21 13:36:53','0','0'); -- id=15895
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', '1151', '128', '2170', '3.00', '490', '1470', '0', '', '0', '2026-10-21 13:36:53', '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=4720
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 = 4720;
 INSERT INTO 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-21', 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-21', 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '3530';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2170', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '33', '30', '1', '2026-10-21 13:36:53','0','0'); -- id=15896
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', '1151', '102', '1932', '6.00', '330', '1980', '0', '', '0', '2026-10-21 13:36:53', '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=4721
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 = 4721;
 INSERT INTO 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-21', 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-21', 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 = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2949';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1932', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '102', '96', '1', '2026-10-21 13:36:53','0','0'); -- id=15897
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', '1151', '102', '1933', '6.00', '430', '2580', '0', '', '0', '2026-10-21 13:36:53', '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=4722
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 = 4722;
 INSERT INTO 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-21', 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-21', 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 = '54', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '60', '54', '1', '2026-10-21 13:36:53','0','0'); -- id=15898
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 554;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01690', '1151', '126', '1690', '9.00', '490', '4410', '0', '', '0', '2026-10-21 13:36:53', '1690', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','554-9,','1','1','0','0','490','4410','0','','0','0.00','0','0','0','0'); -- id=4723
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 = 4723;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1690, '2026-10-21', 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-21', 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 = '9', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2702';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1690', '1', '9', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '9', '1', '2026-10-21 13:36:53','0','0'); -- id=15899
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 6083;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02051', '1151', '126', '2051', '15.00', '450', '6750', '0', '', '0', '2026-10-21 13:36:53', '2051', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6083-15,','1','1','0','0','450','6750','0','','0','0.00','0','0','0','0'); -- id=4724
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 = 4724;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2051, '2026-10-21', 6750, 6750, 6750
                    , 6750, 6210, 6210, 6210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6750, 6750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6750, 6750, 6750
                    , 6750, 6210, 6210, 6210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6750, 6750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:53' WHERE storedetailid = '3410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2051', '1', '15', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '21', '6', '1', '2026-10-21 13:36:53','0','0'); -- id=15900
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 551;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('377.2','01687', '1151', '126', '1687', '6.00', '410', '2460', '0', '', '0', '2026-10-21 13:36:53', '1687', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','551-6,','1','1','0','0','410','2460','0','','0','0.00','0','0','0','0'); -- id=4725
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 377.20, meanbuyprice_withDiscount = 377.20
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 377.2
                where sellbilldetailid = 4725;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1687, '2026-10-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2263.2
                            , 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-21', 2460, 2460, 2460
                    , 2460, 2263.2, 2263.2, 2263.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2263.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2263.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2263.2
                            , 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 = '21', userid = '1', storedetaildate = '2026-10-21 13:36:53' WHERE storedetailid = '2699';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1687', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '27', '21', '1', '2026-10-21 13:36:53','0','0'); -- id=15901
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6082;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02050', '1151', '126', '2050', '3.00', '440', '1320', '0', '', '0', '2026-10-21 13:36:54', '2050', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6082-3,','1','1','0','0','440','1320','0','','0','0.00','0','0','0','0'); -- id=4726
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 404.80, meanbuyprice_withDiscount = 404.80
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 404.8
                where sellbilldetailid = 4726;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2050, '2026-10-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1320, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1214.4
                            , 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-21', 1320, 1320, 1320
                    , 1320, 1214.4, 1214.4, 1214.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1320, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1214.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1214.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1214.4
                            , 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 = '0', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '3409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2050', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '0', '1', '2026-10-21 13:36:54','0','0'); -- id=15902
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 777;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01795', '1151', '126', '1795', '3.00', '460', '1380', '0', '', '0', '2026-10-21 13:36:54', '1795', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','777-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4727
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 = 4727;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1795, '2026-10-21', 1380, 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+1380, 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-21', 1380, 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+1380, 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '2808';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1795', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '3', '1', '2026-10-21 13:36:54','0','0'); -- id=15903
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 552;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01688', '1151', '126', '1688', '3.00', '460', '1380', '0', '', '0', '2026-10-21 13:36:54', '1688', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','552-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4728
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 = 4728;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1688, '2026-10-21', 1380, 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+1380, 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-21', 1380, 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+1380, 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 = '3', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '2700';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1688', '1', '3', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '3', '1', '2026-10-21 13:36:54','0','0'); -- id=15904
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('499.99','01408', '1151', '99', '1408', '12.00', '500', '6000', '0', '', '0', '2026-10-21 13:36:54', '1408', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','158-12,','1','1','0','0','500','6000','0','','0','0.00','0','0','0','0'); -- id=4729
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 499.99, meanbuyprice_withDiscount = 499.99
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 499.99
                where sellbilldetailid = 4729;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1408, '2026-10-21', 6000, 6000, 6000
                    , 6000, 5999.88, 5999.88, 5999.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6000, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5999.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5999.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5999.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6000, 6000, 6000
                    , 6000, 5999.88, 5999.88, 5999.88
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6000, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5999.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5999.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5999.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '93', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '1421';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1408', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '105', '93', '1', '2026-10-21 13:36:54','0','0'); -- id=15905
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 1143;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01954', '1151', '158', '1954', '8.00', '650', '5200', '0', '', '0', '2026-10-21 13:36:54', '1954', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1143-8,','1','1','0','0','650','5200','0','','0','0.00','0','0','0','0'); -- id=4730
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 = 4730;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1954, '2026-10-21', 5200, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5200, sellCostBuyPrice =sellCostBuyPrice+4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5200, 4960, 4960
                    , 4960, 4960, 4960, 4960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4960, 4960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5200, sellCostBuyPrice =sellCostBuyPrice+4960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:36:54' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '8', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '44', '36', '1', '2026-10-21 13:36:54','0','0'); -- id=15906
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 1136;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('500','01948', '1151', '157', '1948', '12.00', '520', '6240', '0', '', '0', '2026-10-21 13:36:54', '1948', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1136-12,','1','1','0','0','520','6240','0','','0','0.00','0','0','0','0'); -- id=4731
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 4731;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1948, '2026-10-21', 6240, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6240, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6240, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6240, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '120', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '2965';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1948', '1', '12', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '132', '120', '1', '2026-10-21 13:36:54','0','0'); -- id=15907
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','01956', '1151', '158', '1956', '6.00', '580', '3480', '0', '', '0', '2026-10-21 13:36:54', '1956', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1147-6,','1','1','0','0','580','3480','0','','0','0.00','0','0','0','0'); -- id=4732
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 4732;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1956, '2026-10-21', 3480, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3480, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 3480, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3480, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '34', '1', '2026-10-21 13:36:54','0','0'); -- id=15908
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 1140;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01951', '1151', '158', '1951', '16.00', '480', '7680', '0', '', '0', '2026-10-21 13:36:54', '1951', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1140-16,','1','1','0','0','480','7680','0','','0','0.00','0','0','0','0'); -- id=4733
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 = 4733;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1951, '2026-10-21', 7680, 7200, 7200
                    , 7200, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 7200, 7200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7680, sellCostBuyPrice =sellCostBuyPrice+7200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 7680, 7200, 7200
                    , 7200, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7200, 7200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7680, sellCostBuyPrice =sellCostBuyPrice+7200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '2968';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1951', '1', '16', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '4', '1', '2026-10-21 13:36:54','0','0'); -- id=15909
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 545;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01643', '1151', '122', '1643', '6.00', '470', '2820', '0', '', '0', '2026-10-21 13:36:54', '1643', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','545-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=4734
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 = 4734;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1643, '2026-10-21', 2820, 2820, 2820
                    , 2820, 2538, 2538, 2538
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2538, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2538
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2538
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2820, 2820, 2820
                    , 2820, 2538, 2538, 2538
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2538, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2538
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2538
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-10-21 13:36:54' WHERE storedetailid = '1668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1643', '1', '6', '1', '1151', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '3', '1', '2026-10-21 13:36:54','0','0'); -- id=15910
UPDATE dailyentry SET totalcreditor = '296380.00', totaldebtor = '296380.00', thedate = '2026-10-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-17 20:19:01', entryComment = 'اضافة فاتورة مبيعات رقم 986', fromFlag = '1',related='0',isopeningentry='0',operationId='986',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=986' WHERE id = '3589';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '296380.00', '296380.00', '2026-10-21', '1', '0', '3589', '2026-10-21 13:36:54','تم عكس القيد رقم 3589 ','1','0','0','0','0',''); -- id=4092
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4092', '530', '296380.00', '','0'); -- id=4094
UPDATE accountstree SET name = 'يوسف طازه - عميل', customName = 'يوسف طازه - عميل', customNameEn = 'يوسف طازه - عميل', nameEn = 'يوسف طازه - عميل', parent = '58', accountNature = '0', theValue = '693115', 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 = '530';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4092', '143', '296380.00', '','0'); -- id=4201
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12775490', 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 = '271895.53', totaldebtor = '271895.53', thedate = '2026-10-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-17 20:19:01', entryComment = 'اضافة فاتورة مبيعات رقم 986 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='986',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=986' WHERE id = '3590';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '271895.53', '271895.53', '2026-10-21', '1', '0', '3590', '2026-10-21 13:36:54','تم عكس القيد رقم 3590 ','1','0','0','0','0',''); -- id=4093
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4093', '402', '271895.53', '','0'); -- id=4095
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11822460.98', 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 ('4093', '382', '271895.53', '','0'); -- id=4202
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25116986.32', 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 ( '296380', '296380', '2026-10-21', '1', '0', '0', '2026-10-21 13:36:54','اضافة فاتورة مبيعات رقم 1151','1','0',null,'0','1151','sellbillController.php?do=showDetail&sellbillid=1151'); -- id=4094
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4094', '530', '296380', '','0'); -- id=4203
UPDATE accountstree SET name = 'يوسف طازه - عميل', customName = 'يوسف طازه - عميل', customNameEn = 'يوسف طازه - عميل', nameEn = 'يوسف طازه - عميل', parent = '58', accountNature = '0', theValue = '989495', 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 = '530';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4094', '143', '296380', '','0'); -- id=4096
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13071870', 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 ( '271385.53', '271385.53', '2026-10-21', '1', '0', '0', '2026-10-21 13:36:54','اضافة فاتورة مبيعات رقم 1151 - صرف البضاعة من المخزن','1','0',null,'0','1151','sellbillController.php?do=showDetail&sellbillid=1151'); -- id=4095
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4095', '402', '271385.53', '','0'); -- id=4204
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12093846.51', 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 ('4095', '382', '271385.53', '','0'); -- id=4097
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24845600.79', 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='4094,0,4095' where sellbillid=1151;
 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-21', 296380, 283574, 283334
                    , 283539.72, 271385.53, 272455.14, 271145.53
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,283334, 264274.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296380, sellCostBuyPrice =sellCostBuyPrice+283574
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+283334, sellCostMeanBuyPrice = sellCostMeanBuyPrice+283539.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+271385.53, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+272455.14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+271145.53
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+283334
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+264274.69
                        , returnSellVal = returnSellVal+0, 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 (32, '2026-10-21', 296380, 283574, 283334
                    , 283539.72, 271385.53, 272455.14, 271145.53
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,283334, 264274.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+296380, sellCostBuyPrice =sellCostBuyPrice+283574
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+283334, sellCostMeanBuyPrice = sellCostMeanBuyPrice+283539.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+271385.53, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+272455.14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+271145.53
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+283334
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+264274.69
                        , returnSellVal = returnSellVal+0, 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, 296380, 283574, 283334
                    , 283539.72, 271385.53, 272455.14, 271145.53, 283334, 264274.69)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+296380, netSellCostBuyPrice = netSellCostBuyPrice+283574
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+283334
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+283539.72
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+271385.53
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+272455.14
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+271145.53
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+283334
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+264274.69;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 986 and newid=1151 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:06:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:36:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:36:54', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=1151'); -- id=16270
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:07:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:37:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:37:04', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=985'); -- id=16271
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:07:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:37:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:37:15', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=984'); -- id=16272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:07:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:37:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:37:29', '1', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=983'); -- id=16273
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:08:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:38:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 13:38:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=16274
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:08:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:38:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 13:38:46', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16275
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:08:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:38:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:38:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16276
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-21 10:09:16";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-21 13:39:16", 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-21 10:09:16";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:39:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:09:18";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:09:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:39:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:39:18', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:09:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:39:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:39:28', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16278
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:09:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:39:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:39:42', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:10:11";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-21 13:40:11", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:10:28";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-21 13:40:28", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:10:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:40:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:40:43', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16280
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:10:46";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-21 13:40:46", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:11:08";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-21 13:41:08", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:12:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:42:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:42:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16281
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:12:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:42:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 13:42:33', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:13:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:43:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:43:19', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:13:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:43:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:43:51', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16284
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 ('فولكانو جينز 736','','28','600','620','0','0','2026-10-21','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','3.33','0','0','.','0','0','0','600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','600','600','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=2325
UPDATE product SET productName = 'فولكانو جينز 736', productDescription = '', productCatId = '28', productBuyPrice = '600', productSellAllPrice = '620', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2325';
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', '2325', '1', '2026-10-21', '1', '0','0232501','620','0','0','600','','0','0','0','0','0','0','0','0','0','0'); -- id=2325
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2325', '1', '0', '1', '2026-10-21'); -- id=3719
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2325', '1', '0', '0', '2325', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15911
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2325, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2325, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3412
UPDATE product SET productName = 'فولكانو جينز 736', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2325';
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 ('فولكانو جينز 1554','','28','600','620','0','0','2026-10-21','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','3.33','0','0','.','0','0','0','600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','600','600','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=2326
UPDATE product SET productName = 'فولكانو جينز 1554', productDescription = '', productCatId = '28', productBuyPrice = '600', productSellAllPrice = '620', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2326';
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', '2326', '1', '2026-10-21', '1', '0','0232601','620','0','0','600','','0','0','0','0','0','0','0','0','0','0'); -- id=2326
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2326', '1', '0', '1', '2026-10-21'); -- id=3720
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '0', '0', '2326', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15912
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2326, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2326, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3413
UPDATE product SET productName = 'فولكانو جينز 1554', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2326';
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 ('فولكانو جينز 1322','','28','530','550','0','0','2026-10-21','0','1','0','','0','0','0','0','0','530','530','530','530','530','0','3.77','0','0','.','0','0','0','530','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','530','530','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','530','0','0','0','0','0','0','','','0','0','0','0'); -- id=2327
UPDATE product SET productName = 'فولكانو جينز 1322', productDescription = '', productCatId = '28', productBuyPrice = '530', productSellAllPrice = '550', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '3.77' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',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='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2327';
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', '2327', '1', '2026-10-21', '1', '0','0232701','550','0','0','530','','0','0','0','0','0','0','0','0','0','0'); -- id=2327
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2327', '1', '0', '1', '2026-10-21'); -- id=3721
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2327', '1', '0', '0', '2327', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15913
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2327, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2327, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3414
UPDATE product SET productName = 'فولكانو جينز 1322', productDescription = '', productCatId = '28', productBuyPrice = '530.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '3.77' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',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='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2327';
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 ('فولكانو جينز 1563','','28','570','590','0','0','2026-10-21','0','1','0','','0','0','0','0','0','570','570','570','570','570','0','3.51','0','0','.','0','0','0','570','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','570','570','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','570','0','0','0','0','0','0','','','0','0','0','0'); -- id=2328
UPDATE product SET productName = 'فولكانو جينز 1563', productDescription = '', productCatId = '28', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2328';
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', '2328', '1', '2026-10-21', '1', '0','0232801','590','0','0','570','','0','0','0','0','0','0','0','0','0','0'); -- id=2328
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2328', '1', '0', '1', '2026-10-21'); -- id=3722
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2328', '1', '0', '0', '2328', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15914
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2328, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2328, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3415
UPDATE product SET productName = 'فولكانو جينز 1563', productDescription = '', productCatId = '28', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2328';
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 ('فولكانو جينز 733','','28','720','740','0','0','2026-10-21','0','1','0','','0','0','0','0','0','720','720','720','720','720','0','2.78','0','0','.','0','0','0','720','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','720','720','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','720','0','0','0','0','0','0','','','0','0','0','0'); -- id=2329
UPDATE product SET productName = 'فولكانو جينز 733', productDescription = '', productCatId = '28', productBuyPrice = '720', productSellAllPrice = '740', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '720',lastbuyprice_withDiscount = '720',meanbuyprice = '720',meanbuyprice_withDiscount = '720' , productbuypricereal = '720' , buypricereal_precentage = '0' , buytotal_precentage = '2.78' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='720',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='720',meanbuyprice_withTax='720',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='720',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2329';
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', '2329', '1', '2026-10-21', '1', '0','0232901','740','0','0','720','','0','0','0','0','0','0','0','0','0','0'); -- id=2329
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2329', '1', '0', '1', '2026-10-21'); -- id=3723
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2329', '1', '0', '0', '2329', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15915
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2329, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2329, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3416
UPDATE product SET productName = 'فولكانو جينز 733', productDescription = '', productCatId = '28', productBuyPrice = '720.00', productSellAllPrice = '740.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '720',lastbuyprice_withDiscount = '720',meanbuyprice = '720',meanbuyprice_withDiscount = '720' , productbuypricereal = '720' , buypricereal_precentage = '0' , buytotal_precentage = '2.78' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='720',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='720',meanbuyprice_withTax='720',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='720',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2329';
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 ('فولكانو جينز 734','','28','700','720','0','0','2026-10-21','0','1','0','','0','0','0','0','0','700','700','700','700','700','0','2.86','0','0','.','0','0','0','700','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','700','700','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','700','0','0','0','0','0','0','','','0','0','0','0'); -- id=2330
UPDATE product SET productName = 'فولكانو جينز 734', productDescription = '', productCatId = '28', productBuyPrice = '700', productSellAllPrice = '720', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',meanbuyprice_withDiscount = '700' , productbuypricereal = '700' , buypricereal_precentage = '0' , buytotal_precentage = '2.86' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',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='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 = '2330';
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', '2330', '1', '2026-10-21', '1', '0','0233001','720','0','0','700','','0','0','0','0','0','0','0','0','0','0'); -- id=2330
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2330', '1', '0', '1', '2026-10-21'); -- id=3724
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2330', '1', '0', '0', '2330', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15916
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2330, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2330, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3417
UPDATE product SET productName = 'فولكانو جينز 734', productDescription = '', productCatId = '28', productBuyPrice = '700.00', productSellAllPrice = '720.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',meanbuyprice_withDiscount = '700' , productbuypricereal = '700' , buypricereal_precentage = '0' , buytotal_precentage = '2.86' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',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='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 = '2330';
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 ('فولكانو جينز  736','','28','600','620','0','0','2026-10-21','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','3.33','0','0','.','0','0','0','600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','600','600','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=2331
UPDATE product SET productName = 'فولكانو جينز  736', productDescription = '', productCatId = '28', productBuyPrice = '600', productSellAllPrice = '620', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02331',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2331';
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', '2331', '1', '2026-10-21', '1', '0','0233101','620','0','0','600','','0','0','0','0','0','0','0','0','0','0'); -- id=2331
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2331', '1', '0', '1', '2026-10-21'); -- id=3725
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2331', '1', '0', '0', '2331', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=15917
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2331, 1,'2026-10-21 13:43:51',1)
                ON DUPLICATE KEY UPDATE productid = 2331, edited = 1, sysdate = '2026-10-21 13:43:51', userid = 1; -- id=3418
UPDATE product SET productName = 'فولكانو جينز  736', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02331',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2331';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:13:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:43:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:43:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16285
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:13:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:43:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:43:56', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:14:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:44:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:44:32', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16287
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:14:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:44:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:44:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16288
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:14:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:44:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:44:41', '1', 'tempdelete', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=tempdelete&id=2331&optic=0'); -- id=16289
BEGIN;
UPDATE product SET conditions =1 WHERE productId =2331;
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2331, 2,'2026-10-21 13:44:41',1)
                ON DUPLICATE KEY UPDATE productid = 2331, edited = 2, sysdate = '2026-10-21 13:44:41', userid = 1; -- id=3418
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:14:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:44:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:44:41', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=sucess'); -- id=16290
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:14:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:44:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:44:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:15:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:45:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:45:35', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:16:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:46:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:46:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:16:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:46:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:46:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16294
UPDATE productunit SET proUnitSellAllPrice  = 480.00 * productnumber  WHERE productid = 916;
UPDATE product SET productName = 'فولكانو 1025', productDescription = '', productCatId = '28', productBuyPrice = '420.00', productSellAllPrice = '480.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07627',type ='0', expireDate = '0' , dailyentryId = '271',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , 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='7627',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='420',meanbuyprice_withTax='420',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='420',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 = '916';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (916, 1,'2026-10-21 13:46:44',1)
                ON DUPLICATE KEY UPDATE productid = 916, edited = 1, sysdate = '2026-10-21 13:46:44', userid = 1; -- id=1561
UPDATE productunit SET proUnitBuyPrice  = 460.00 * productnumber WHERE productid = 916;
UPDATE product SET productName = 'فولكانو 1025', productDescription = '', productCatId = '28', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07627',type ='0', expireDate = '0' , dailyentryId = '271',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '420.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='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7627',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='440',meanbuyprice_withTax='440',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='420',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 = '916';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (916, 1,'2026-10-21 13:46:48',1)
                ON DUPLICATE KEY UPDATE productid = 916, edited = 1, sysdate = '2026-10-21 13:46:48', userid = 1; -- id=1561
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:18:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:48:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:48:09', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16295
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 ('06ad8976c62f80', '2026-10-21 13:43:56', '20', '481180.00', '586180', '0', '0', '105000.00',  '105000.00', '0', '105000', '1', '2026-10-21 13:48:09', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=286
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 ('01965', '286', '28', '1965', '15', '580', '8700.00', '0', '', '2026-10-21 13:48:09', '1965','','','0','0','0','0','0',null,'580','8700','0','0','0','0','0','0','0','0','1'); -- id=1600
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 1965, 0, 0
                    , 580, 15, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6893
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1965', '580', '15', '0', 'buyBillController.php', '1600', '', '0', '0'); -- id=1174
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1965 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 1600 ;
UPDATE product SET productName = 'فولكانو جينز 729', productDescription = '', productCatId = '28', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01965',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 = '3.45' , 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='580',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 = '1965';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 1600;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1965;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2982';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1965', '1', '15', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '30', '1', '2026-10-21 13:43:56','0','0'); -- id=15918
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 ('02325', '286', '28', '2325', '12', '600', '7200.00', '0', '', '2026-10-21 13:48:09', '2325','','','0','0','0','0','0',null,'600','7200','0','0','0','0','0','0','0','0','1'); -- id=1601
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2325, 0, 0
                    , 600, 12, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6894
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2325', '600', '12', '0', 'buyBillController.php', '1601', '', '0', '0'); -- id=1175
UPDATE product SET  productBuyPrice = "600" WHERE productId = 2325 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1601 ;
UPDATE product SET productName = 'فولكانو جينز 736', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.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='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2325';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 1601;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 2325;
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3719';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2325', '1', '12', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '12', '1', '2026-10-21 13:43:56','0','0'); -- id=15919
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 ('07627', '286', '28', '916', '50', '460', '23000.00', '0', '', '2026-10-21 13:48:09', '916','','','0','0','0','0','0',null,'460','23000','0','0','0','0','0','0','0','0','1'); -- id=1602
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 916, 0, 0
                    , 460, 50, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6895
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('916', '460', '50', '0', 'buyBillController.php', '1602', '', '0', '0'); -- id=1176
UPDATE product SET  productBuyPrice = "460" WHERE productId = 916 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1602 ;
UPDATE product SET productName = 'فولكانو 1025', productDescription = '', productCatId = '28', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07627',type ='0', expireDate = '0' , dailyentryId = '271',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '420.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='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7627',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='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='1',lastbuyprice_withDiscountAndTax='460',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 = '916';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1602;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 916;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '916';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('916', '1', '50', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '1', '2026-10-21 13:43:56','0','0'); -- id=15920
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 ('02326', '286', '28', '2326', '20', '600', '12000.00', '0', '', '2026-10-21 13:48:09', '2326','','','0','0','0','0','0',null,'600','12000','0','0','0','0','0','0','0','0','1'); -- id=1603
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2326, 0, 0
                    , 600, 20, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6896
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2326', '600', '20', '0', 'buyBillController.php', '1603', '', '0', '0'); -- id=1177
UPDATE product SET  productBuyPrice = "600" WHERE productId = 2326 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1603 ;
UPDATE product SET productName = 'فولكانو جينز 1554', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.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='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2326';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 1603;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 2326;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '20', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 13:43:56','0','0'); -- id=15921
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 ('02327', '286', '28', '2327', '30', '530', '15900.00', '0', '', '2026-10-21 13:48:09', '2327','','','0','0','0','0','0',null,'530','15900','0','0','0','0','0','0','0','0','1'); -- id=1604
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2327, 0, 0
                    , 530, 30, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 530,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6897
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2327', '530', '30', '0', 'buyBillController.php', '1604', '', '0', '0'); -- id=1178
UPDATE product SET  productBuyPrice = "530" WHERE productId = 2327 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1604 ;
UPDATE product SET productName = 'فولكانو جينز 1322', productDescription = '', productCatId = '28', productBuyPrice = '530.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',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='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2327';
UPDATE buybilldetail SET  lastbuyprice = 530 , meanbuyprice = 530, lastbuyprice_withDiscount = 530, meanbuyprice_withDiscount = 530
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where buybilldetailid = 1604;
UPDATE productunit SET proUnitBuyPrice  = 530 * productnumber WHERE productid = 2327;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3721';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2327', '1', '30', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 13:43:56','0','0'); -- id=15922
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 ('02328', '286', '28', '2328', '20', '570', '11400.00', '0', '', '2026-10-21 13:48:09', '2328','','','0','0','0','0','0',null,'570','11400','0','0','0','0','0','0','0','0','1'); -- id=1605
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2328, 0, 0
                    , 570, 20, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 570,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6898
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2328', '570', '20', '0', 'buyBillController.php', '1605', '', '0', '0'); -- id=1179
UPDATE product SET  productBuyPrice = "570" WHERE productId = 2328 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1605 ;
UPDATE product SET productName = 'فولكانو جينز 1563', productDescription = '', productCatId = '28', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.51' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2328';
UPDATE buybilldetail SET  lastbuyprice = 570 , meanbuyprice = 570, lastbuyprice_withDiscount = 570, meanbuyprice_withDiscount = 570
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where buybilldetailid = 1605;
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 2328;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3722';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2328', '1', '20', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 13:43:56','0','0'); -- id=15923
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 ('02329', '286', '28', '2329', '15', '720', '10800.00', '0', '', '2026-10-21 13:48:09', '2329','','','0','0','0','0','0',null,'720','10800','0','0','0','0','0','0','0','0','1'); -- id=1606
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2329, 0, 0
                    , 720, 15, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 720,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6899
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2329', '720', '15', '0', 'buyBillController.php', '1606', '', '0', '0'); -- id=1180
UPDATE product SET  productBuyPrice = "720" WHERE productId = 2329 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1606 ;
UPDATE product SET productName = 'فولكانو جينز 733', productDescription = '', productCatId = '28', productBuyPrice = '720.00', productSellAllPrice = '740.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '720',lastbuyprice_withDiscount = '720',meanbuyprice = '720',meanbuyprice_withDiscount = '720' , productbuypricereal = '720.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='720',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='720',meanbuyprice_withTax='720',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='720',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2329';
UPDATE buybilldetail SET  lastbuyprice = 720 , meanbuyprice = 720, lastbuyprice_withDiscount = 720, meanbuyprice_withDiscount = 720
        , lastbuyprice_withTax = 720, meanbuyprice_withTax = 720, lastbuyprice_withDiscountAndTax = 720
                where buybilldetailid = 1606;
UPDATE productunit SET proUnitBuyPrice  = 720 * productnumber WHERE productid = 2329;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2329', '1', '15', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-10-21 13:43:56','0','0'); -- id=15924
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 ('02330', '286', '28', '2330', '10', '700', '7000.00', '0', '', '2026-10-21 13:48:09', '2330','','','0','0','0','0','0',null,'700','7000','0','0','0','0','0','0','0','0','1'); -- id=1607
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2330, 0, 0
                    , 700, 10, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 700,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6900
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2330', '700', '10', '0', 'buyBillController.php', '1607', '', '0', '0'); -- id=1181
UPDATE product SET  productBuyPrice = "700" WHERE productId = 2330 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1607 ;
UPDATE product SET productName = 'فولكانو جينز 734', productDescription = '', productCatId = '28', productBuyPrice = '700.00', productSellAllPrice = '720.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',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 = '2330';
UPDATE buybilldetail SET  lastbuyprice = 700 , meanbuyprice = 700, lastbuyprice_withDiscount = 700, meanbuyprice_withDiscount = 700
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where buybilldetailid = 1607;
UPDATE productunit SET proUnitBuyPrice  = 700 * productnumber WHERE productid = 2330;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3724';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2330', '1', '10', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '1', '2026-10-21 13:43:56','0','0'); -- id=15925
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 ('02325', '286', '28', '2325', '15', '600', '9000.00', '0', '', '2026-10-21 13:48:09', '2325','','','0','0','0','0','0',null,'600','9000','0','0','0','0','0','0','0','0','1'); -- id=1608
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 13:43:56', 1, 2325, 0, 0
                    , 600, 15, 0, 0, 1, '2026-10-21 13:48:09')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 13:48:09' ; -- id=6894
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2325', '600', '15', '0', 'buyBillController.php', '1608', '', '0', '0'); -- id=1182
UPDATE product SET  productBuyPrice = "600" WHERE productId = 2325 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 1608 ;
UPDATE product SET productName = 'فولكانو جينز 736', productDescription = '', productCatId = '28', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.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='600',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='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2325';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 1608;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 2325;
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3719';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2325', '1', '15', '0', '286', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '27', '1', '2026-10-21 13:43:56','0','0'); -- id=15926
UPDATE supplier SET  suppliercurrentDebt = '586180',suppliercurrentDebtInCurrency= '586180' , userid = '1', supplierdate = '2026-10-21 13:48:09'   WHERE supplierid = '20';
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 ('20', '481180.00', '105000', '0', 'اضافة فاتورة مشتريات', '286', '586180', '2026-10-21 13:43:56', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','105000','1','481180','105000','586180','0',''); -- id=799
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '105000', '105000', '2026-10-21', '1', '0', '0', '2026-10-21 13:48:09','اضافة فاتورة مشتريات رقم 286','1','0',null,'0','286','buyBillController.php?do=details&id=286'); -- id=4096
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4096', '382', '105000', '','0'); -- id=4205
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24950600.79', 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 ('4096', '439', '105000', '','0'); -- id=4098
UPDATE accountstree SET name = 'فولكانو جينز - مورد', customName = 'فولكانو جينز - مورد', customNameEn = 'فولكانو جينز - مورد', nameEn = 'فولكانو جينز - مورد', parent = '81', accountNature = '1', theValue = '247825', 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 = '439';
update buybill set dailyentryid='4096,0' where buybillid=286;
COMMIT;
UPDATE product SET overAllAveragePrice = 460 WHERE productId = 916;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 1965;UPDATE product SET overAllAveragePrice = 600 WHERE productId = 2325;UPDATE product SET overAllAveragePrice = 600 WHERE productId = 2326;UPDATE product SET overAllAveragePrice = 530 WHERE productId = 2327;UPDATE product SET overAllAveragePrice = 570 WHERE productId = 2328;UPDATE product SET overAllAveragePrice = 720 WHERE productId = 2329;UPDATE product SET overAllAveragePrice = 700 WHERE productId = 2330;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:18:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:48:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:48:09', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=286'); -- id=16296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:18:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:48:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 13:48:13', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=286&type=2'); -- id=16297
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:19:23";
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-21 10:19:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:49:25", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:49:25', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16298
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-21 10:19:25";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 13:49:25", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:49:25', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:19:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:49:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:49:27', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:20:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:50:16", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:50:16', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16301

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad898b738b78
-- ----------------------------------------------------------------------------------------------------

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-21 13:50:16', '06ad898b738b78', '1', '0.00', '0', '0', '1', '2070.00', '2070', '2070', '0', '1', '2026-10-21 13:50:16', '', '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-21','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=1152
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','اضافة فاتورة مبيعات','1152', '0', '2026-10-21 13:50:16', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2070', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:50:16','0','0','',''); -- id=1375
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', '1152', '191', '2203', '6', '345', '2070', '0', '', '0', '2026-10-21 13:50:16', '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=4735
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 = 4735;
 INSERT INTO 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-21', 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-21', 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 = '12', userid = '6', storedetaildate = '2026-10-21 13:50:16' WHERE storedetailid = '3592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2203', '1', '6', '1', '1152', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '6', '2026-10-21 13:50:16','0','0'); -- id=15927
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '984820',  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 ('982750','2070', '0', '4', 'اضافة فاتورة مبيعات', '1152', '984820', '2026-10-21 13:50:16', '6',  'sellbillController.php','1','','0'); -- id=1429
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2070', '2070', '2026-10-21', '6', '0', '0', '2026-10-21 13:50:16','اضافة فاتورة مبيعات رقم 1152','1','0',null,'0','1152','sellbillController.php?do=showDetail&sellbillid=1152'); -- id=4097
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4097', '568', '2070', '','0'); -- id=4206
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '984820', 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 ('4097', '143', '2070', '','0'); -- id=4099
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13073940', 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-21', '6', '0', '0', '2026-10-21 13:50:16','اضافة فاتورة مبيعات رقم 1152 - صرف البضاعة من المخزن','1','0',null,'0','1152','sellbillController.php?do=showDetail&sellbillid=1152'); -- id=4098
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4098', '402', '1680', '','0'); -- id=4207
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12095526.51', 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 ('4098', '382', '1680', '','0'); -- id=4100
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24948920.79', 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='4097,0,4098' where sellbillid=1152;
 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-21', 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-21', 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 06ad898b738b78 and sellbillId = 1152 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:20:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:50:16", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:50:16', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16302
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:21:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:51:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 13:51:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16303
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-21 10:21:19";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 13:51:19', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:21:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:51:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:51:22', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=6'); -- id=16305
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:23:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:53:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:53:59', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16306

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad898e8f1af9
-- ----------------------------------------------------------------------------------------------------

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-21 13:53:59', '06ad898e8f1af9', '1', '0.00', '0', '0', '1', '2975.00', '2975', '2975', '0', '1', '2026-10-21 13:53:59', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2975','0','','0','0','2975','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1153
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','اضافة فاتورة مبيعات','1153', '0', '2026-10-21 13:53:59', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2975', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:53:59','0','0','',''); -- id=1376
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1153', '175', '2088', '5', '595', '2975', '0', '', '0', '2026-10-21 13:53:59', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-5,','1','1','0','0','595','2975','0','','0','0.00','0','0','0','0'); -- id=4736
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 = 4736;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1126', userid = '6', storedetaildate = '2026-10-21 13:53:59' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '5', '1', '1153', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1131', '1126', '6', '2026-10-21 13:53:59','0','0'); -- id=15928
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '987795',  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 ('984820','2975', '0', '4', 'اضافة فاتورة مبيعات', '1153', '987795', '2026-10-21 13:53:59', '6',  'sellbillController.php','1','','0'); -- id=1430
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2975', '2975', '2026-10-21', '6', '0', '0', '2026-10-21 13:53:59','اضافة فاتورة مبيعات رقم 1153','1','0',null,'0','1153','sellbillController.php?do=showDetail&sellbillid=1153'); -- id=4099
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4099', '568', '2975', '','0'); -- id=4208
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '987795', 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 ('4099', '143', '2975', '','0'); -- id=4101
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13076915', 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 ( '2300', '2300', '2026-10-21', '6', '0', '0', '2026-10-21 13:53:59','اضافة فاتورة مبيعات رقم 1153 - صرف البضاعة من المخزن','1','0',null,'0','1153','sellbillController.php?do=showDetail&sellbillid=1153'); -- id=4100
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4100', '402', '2300', '','0'); -- id=4209
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12097826.51', 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 ('4100', '382', '2300', '','0'); -- id=4102
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24946620.79', 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='4099,0,4100' where sellbillid=1153;
 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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, 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300, 2300, 2300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2975, netSellCostBuyPrice = netSellCostBuyPrice+2300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad898e8f1af9 and sellbillId = 1153 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:23:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:53:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:53:59', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:24:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:54:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:54:52', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16308

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad897cf30a61
-- ----------------------------------------------------------------------------------------------------

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-21 13:54:52', '06ad897cf30a61', '1', '0.00', '0', '0', '1', '2355.00', '2355', '2355', '0', '1', '2026-10-21 13:54:52', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','2355','0','','0','0','2355','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1154
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','اضافة فاتورة مبيعات','1154', '0', '2026-10-21 13:54:52', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2355', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 13:54:52','0','0','',''); -- id=1377
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1154', '154', '1923', '3', '245', '735', '0', '', '0', '2026-10-21 13:54:52', '1923', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1084-3,','1','1','0','0','245','735','0','','0','0.00','0','0','0','0'); -- id=4737
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 = 4737;
 INSERT INTO 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-21', 735, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , 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-21', 735, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , 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 = '28', userid = '2', storedetaildate = '2026-10-21 13:54:52' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '3', '1', '1154', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '28', '2', '2026-10-21 13:54:52','0','0'); -- id=15929
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1154', '190', '2175', '3', '245', '735', '0', '', '0', '2026-10-21 13:54:52', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-3,','1','1','0','0','245','735','0','','0','0.00','0','0','0','0'); -- id=4738
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 = 4738;
 INSERT INTO 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-21', 735, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , 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-21', 735, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , 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 = '16', userid = '2', storedetaildate = '2026-10-21 13:54:52' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '3', '1', '1154', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '16', '2', '2026-10-21 13:54:52','0','0'); -- id=15930
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1154', '154', '1924', '3', '295', '885', '0', '', '0', '2026-10-21 13:54:52', '1924', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1085-3,','1','1','0','0','295','885','0','','0','0.00','0','0','0','0'); -- id=4739
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 = 4739;
 INSERT INTO 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-21', 885, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+885, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 885, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+885, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 13:54:52' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '3', '1', '1154', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '60', '2', '2026-10-21 13:54:52','0','0'); -- id=15931
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7122048.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 ('7119693.5','2355', '0', '2', 'اضافة فاتورة مبيعات', '1154', '7122048.5', '2026-10-21 13:54:52', '2',  'sellbillController.php','1','','0'); -- id=1431
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2355', '2355', '2026-10-21', '2', '0', '0', '2026-10-21 13:54:52','اضافة فاتورة مبيعات رقم 1154','1','0',null,'0','1154','sellbillController.php?do=showDetail&sellbillid=1154'); -- id=4101
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4101', '419', '2355', '','0'); -- id=4210
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7122048', 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 ('4101', '143', '2355', '','0'); -- id=4103
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13079270', 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 ( '2205', '2205', '2026-10-21', '2', '0', '0', '2026-10-21 13:54:52','اضافة فاتورة مبيعات رقم 1154 - صرف البضاعة من المخزن','1','0',null,'0','1154','sellbillController.php?do=showDetail&sellbillid=1154'); -- id=4102
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4102', '402', '2205', '','0'); -- id=4211
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12100031.51', 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 ('4102', '382', '2205', '','0'); -- id=4104
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24944415.79', 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='4101,0,4102' where sellbillid=1154;
 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-21', 2355, 2205, 2205
                    , 2205, 2205, 2205, 2205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2205, 2205, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2355, sellCostBuyPrice =sellCostBuyPrice+2205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2205
                        , returnSellVal = returnSellVal+0, 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-21', 2355, 2205, 2205
                    , 2205, 2205, 2205, 2205
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2205, 2205, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2355, sellCostBuyPrice =sellCostBuyPrice+2205
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2205, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2205
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2205, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2205
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2205
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2205
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2205
                        , returnSellVal = returnSellVal+0, 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, 2355, 2205, 2205
                    , 2205, 2205, 2205, 2205, 2205, 2205)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2355, netSellCostBuyPrice = netSellCostBuyPrice+2205
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2205
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2205
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2205
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2205
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2205
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2205
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2205;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad897cf30a61 and sellbillId = 1154 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:24:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:54:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 13:54:52', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16309
UPDATE productunit SET unitid = '1', productid = '1211', productnumber = '1.00', productunitdate = '2026-09-27', userid = '1', conditions = '0',proUnitParcode='',proUnitSellAllPrice='370',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1211';
UPDATE product SET productName = 'جبردين شروال بلاك اند وايت 370', productDescription = '', productCatId = '60', productBuyPrice = '350', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09214',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9214',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1211';
UPDATE productunit SET unitid = '1', productid = '1211', productnumber = '1.00', productunitdate = '2026-09-27', userid = '1', conditions = '0',proUnitParcode='',proUnitSellAllPrice='370',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1211';
UPDATE product SET productName = 'جبردين شروال بلاك اند وايت 370', productDescription = '', productCatId = '60', productBuyPrice = '345', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09214',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9214',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1211';
UPDATE productunit SET unitid = '1', productid = '1211', productnumber = '1.00', productunitdate = '2026-09-27', userid = '1', conditions = '0',proUnitParcode='',proUnitSellAllPrice='370',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1211';
UPDATE product SET productName = 'جبردين شروال بلاك اند وايت 370', productDescription = '', productCatId = '60', productBuyPrice = '350', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09214',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9214',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1211';
UPDATE productunit SET unitid = '1', productid = '1212', productnumber = '1.00', productunitdate = '2026-09-27', userid = '1', conditions = '0',proUnitParcode='',proUnitSellAllPrice='350',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='330',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1212';
UPDATE product SET productName = 'سوفت شروال بلاك اند وايت 350', productDescription = '', productCatId = '60', productBuyPrice = '320', productSellAllPrice = '350', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09345',type ='0', expireDate = '0' , dailyentryId = '567',isService = '0',isOptic = '0',lastbuyprice = '330.00',lastbuyprice_withDiscount = '330',meanbuyprice = '330.00',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 = '0',webApiId='9345',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='330',meanbuyprice_withTax='330',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='330',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 = '1212';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:27:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:57:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 13:57:02', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16310
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06ad8992aad7d8', '2026-10-21 13:51:22', '84', '197430.00', '145620', '0', '0', '-51810.00', '-51810.00', '0', '-51810', '1', '2026-10-21 13:57:02', '', '1', '0', '', '1', '6','1','0.00','-1','0','1','0','0','0','0','0'); -- id=32
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09345', '32', '60', '1212', '48', '320', '15360', '0', '', '1212','','','0','0','0','0','0','320','15360','0','0','0','0','0','0','0','1'); -- id=169
UPDATE product SET productName = 'سوفت شروال بلاك اند وايت 350', productDescription = '', productCatId = '60', productBuyPrice = '320.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09345',type ='0', expireDate = '0' , dailyentryId = '567',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320.00',meanbuyprice_withDiscount = '320' , 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='9345',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='320',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='1',lastbuyprice_withDiscountAndTax='320',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 = '1212';
UPDATE returnbuybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where returnbuybilldetailid = 169;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 1212;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '1212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1212', '1', '48', '1', '32', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '48', '0', '1', '2026-10-21 13:51:22','0','0'); -- id=15932
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09214', '32', '60', '1211', '60', '345', '20700', '0', '', '1211','','','0','0','0','0','0','345','20700','0','0','0','0','0','0','0','1'); -- id=170
UPDATE product SET productName = 'جبردين شروال بلاك اند وايت 370', productDescription = '', productCatId = '60', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09214',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '345',lastbuyprice_withDiscount = '345',meanbuyprice = '356.67',meanbuyprice_withDiscount = '356.67' , 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='9214',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='345',meanbuyprice_withTax='356.67',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='345',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 = '1211';
UPDATE returnbuybilldetail SET  lastbuyprice = 345 , meanbuyprice = 356.67, lastbuyprice_withDiscount = 345, meanbuyprice_withDiscount = 356.67
        , lastbuyprice_withTax = 345, meanbuyprice_withTax = 356.67, lastbuyprice_withDiscountAndTax = 345
                where returnbuybilldetailid = 170;
UPDATE productunit SET proUnitBuyPrice  = 345 * productnumber WHERE productid = 1211;
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '1211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1211', '1', '60', '1', '32', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '105', '45', '1', '2026-10-21 13:51:22','0','0'); -- id=15933
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09214', '32', '60', '1211', '45', '350', '15750', '0', '', '1211','','','0','0','0','0','0','350','15750','0','0','0','0','0','0','0','1'); -- id=171
UPDATE product SET productName = 'جبردين شروال بلاك اند وايت 370', productDescription = '', productCatId = '60', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09214',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '361.67',meanbuyprice_withDiscount = '361.67' , 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='9214',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='361.67',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1211';
UPDATE returnbuybilldetail SET  lastbuyprice = 350 , meanbuyprice = 361.67, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 361.67
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 361.67, lastbuyprice_withDiscountAndTax = 350
                where returnbuybilldetailid = 171;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1211;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '1211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1211', '1', '45', '1', '32', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '45', '0', '1', '2026-10-21 13:51:22','0','0'); -- id=15934
UPDATE supplier SET  suppliercurrentDebt = '145620',suppliercurrentDebtInCurrency= '145620' , userid = '1', supplierdate = '2026-10-21 13:57:02'   WHERE supplierid = '84';
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 ('84', '197430.00', '51810', '1', 'اضافة فاتورة مردوات مشتريات', '32', '145620', '2026-10-21 13:51:22', '1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','51810','1','197430','51810','145620','0',''); -- id=800
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51810', '51810', '2026-10-21', '1', '0', '0', '2026-10-21 13:57:02','اضافة فاتورة مردود مشتريات رقم 32','1','0',null,'0','32','returnBuyBillController.php?do=details&id=32'); -- id=4103
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4103', '564', '51810', '','0'); -- id=4212
UPDATE accountstree SET name = 'بلاك اند وايت', customName = 'بلاك اند وايت', customNameEn = 'بلاك اند وايت', nameEn = 'بلاك اند وايت', parent = '81', accountNature = '1', theValue = '145620', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-05 18:25:53' WHERE id = '564';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4103', '382', '51810', '','0'); -- id=4105
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24892605.79', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update returnbuybill set dailyentryid='4103,0' where returnbuybillid=32;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:27:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:57:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 13:57:02', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=editprint&id=32'); -- id=16311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:27:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:57:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 13:57:55', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:29:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:59:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 13:59:05', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16313
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:29:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:59:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 13:59:14', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16314
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:29:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 13:59:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 13:59:38', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:30:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:00:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 14:00:13', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=16316
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '1188';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1188', '1', '25', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '25', '0', '1', '2026-10-21','0','0'); -- id=15935
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9000', '9000', '2026-10-21', '1', '0', '0', '2026-10-21 14:00:13','اعادة جرد للمنتج : (انترلوك وايد ليج طباعه 3340/الحفناوي) فى مخزن : (المخزن الرئيسي) بالكمية : 0','1','0',null,'0','15935','inventoryController.php?do=details&id=15935'); -- id=4104
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4104', '188', '9000', '','0'); -- id=4213
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3241340', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4104', '382', '9000', '','0'); -- id=4106
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24883605.79', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:30:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:00:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 14:00:28', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=16317
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '1187';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1187', '1', '28', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '28', '0', '1', '2026-10-21','0','0'); -- id=15936
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8400', '8400', '2026-10-21', '1', '0', '0', '2026-10-21 14:00:28','اعادة جرد للمنتج : (وايد ليج امريكن 3387/الحفناوي) فى مخزن : (المخزن الرئيسي) بالكمية : 0','1','0',null,'0','15936','inventoryController.php?do=details&id=15936'); -- id=4105
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4105', '188', '8400', '','0'); -- id=4214
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3232940', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4105', '382', '8400', '','0'); -- id=4107
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24875205.79', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:30:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:00:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 14:00:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16318
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:31:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:01:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:01:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:31:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:01:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:01:31', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16320
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32: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-21 10:32:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:27", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:02:27', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16321
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-21 10:32:27";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:02:27', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16322
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:02:29', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:02:35', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 14:02:36', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16325
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:02:37', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16326
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:41", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:02:41', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:32:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:02:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:02:43', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16328
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:33:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:03:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:03:11', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16329
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:33:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:03:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:03:20', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=143'); -- id=16330
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:33:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:03:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:03:29', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:33:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:03:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:03:31', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=144'); -- id=16332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:04:01', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16333
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 ('موديلات 440 تي ام','','165','440','440','0','0','2026-10-21','0','7','0','','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','0','0','0','0','0','-1','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=2332
UPDATE product SET productName = 'موديلات 440 تي ام', productDescription = '', productCatId = '165', productBuyPrice = '440', productSellAllPrice = '440', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02332',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='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 = '2332';
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', '2332', '1.00', '2026-10-21', '7', '0','0233201','440','0','0','440','','0','0','0','0','0','0','0','0','0','0'); -- id=2332
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2332', '1', '0', '7', '2026-10-21'); -- id=3726
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2332', '1', '0', '0', '2332', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15937
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2332, 1,'2026-10-21 14:04:01',7)
                ON DUPLICATE KEY UPDATE productid = 2332, edited = 1, sysdate = '2026-10-21 14:04:01', userid = 7; -- id=3422
UPDATE product SET productName = 'موديلات 440 تي ام', productDescription = '', productCatId = '165', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02332',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='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 = '2332';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:04:03', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:04:04', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16335
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:04:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16336
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-21 10:34:34";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:04:34', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16337
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:04:36', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16338
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:34:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:04:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:04:57', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16339
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:35:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:05:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:05:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:35:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:05:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:05:08', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16341
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 ('06ad89c2479204', '2026-10-21 14:04:04', '175', '24756.00', '63960', '10', '1', '43560.00',  '39204.00', '0', '39204', '1', '2026-10-21 14:05:08', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=287
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 ('02332', '287', '165', '2332', '99', '440', '43560.00', '0', '', '2026-10-21 14:05:08', '2332','','','0','0','0','0','0',null,'440','43560','0','0','0','0','0','0','0','0','1'); -- id=1609
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:04:04', 1, 2332, 0, 0
                    , 396, 99, 0, 0, 7, '2026-10-21 14:05:08')
                ON DUPLICATE KEY UPDATE buyprice = 396,
                        buyQuantity =buyQuantity+99, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:05:08' ; -- id=6902
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2332', '440', '99', '0', 'buyBillController.php', '1609', '', '0', '0'); -- id=1183
UPDATE product SET  productBuyPrice = "440" WHERE productId = 2332 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1609 ;
UPDATE product SET productName = 'موديلات 440 تي ام', productDescription = '', productCatId = '165', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02332',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '396',meanbuyprice = '440',meanbuyprice_withDiscount = '396' , 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='440',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='396',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2332';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 396, meanbuyprice_withDiscount = 396
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 396
                where buybilldetailid = 1609;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 2332;
UPDATE storedetail SET  productquantity = '99', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3726';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2332', '1', '99', '0', '287', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '99', '7', '2026-10-21 14:04:04','0','0'); -- id=15938
UPDATE supplier SET  suppliercurrentDebt = '63960',suppliercurrentDebtInCurrency= '63960' , userid = '7', supplierdate = '2026-10-21 14:05:08'   WHERE supplierid = '175';
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 ('175', '24756.00', '39204', '0', 'اضافة فاتورة مشتريات', '287', '63960', '2026-10-21 14:04:04', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','39204','1','24756','39204','63960','0',''); -- id=801
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '39204', '39204', '2026-10-21', '7', '0', '0', '2026-10-21 14:05:08','اضافة فاتورة مشتريات رقم 287','1','0',null,'0','287','buyBillController.php?do=details&id=287'); -- id=4106
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4106', '382', '39204', '','0'); -- id=4215
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24914409.79', 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 ('4106', '658', '39204', '','0'); -- id=4108
UPDATE accountstree SET name = 'تي ام على سالم', customName = 'تي ام على سالم', customNameEn = 'تي ام على سالم', nameEn = 'تي ام على سالم', parent = '81', accountNature = '1', theValue = '63960', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 19:07:50' WHERE id = '658';
update buybill set dailyentryid='4106,0' where buybillid=287;
COMMIT;
UPDATE product SET overAllAveragePrice = 396 WHERE productId = 2332;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:35:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:05:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:05:08', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=287'); -- id=16342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:35:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:05:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:05:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16343
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:35:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:05:16", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:05:16', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=287&type=2'); -- id=16344
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:36:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:06:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:06:29', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:36:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:06:34", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:06:34', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16346

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad899c7b2271
-- ----------------------------------------------------------------------------------------------------

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-21 14:06:34', '06ad899c7b2271', '1', '0.00', '0', '0', '1', '10750.00', '10750', '10750', '0', '1', '2026-10-21 14:06:34', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '14' ,'0','','','','','-1','0','0','0','0','0','10750','0','','0','0','10750','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1155
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','اضافة فاتورة مبيعات','1155', '0', '2026-10-21 14:06:34', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10750', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:06:34','0','0','',''); -- id=1378
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6539;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','02228', '1155', '194', '2228', '3', '600', '1800', '0', '', '0', '2026-10-21 14:06:34', '2228', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6539-3,','1','1','0','0','600','1800','0','','0','0.00','0','0','0','0'); -- id=4740
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4740;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2228, '2026-10-21', 1800, 1710, 1710
                    , 1710, 1710, 1710, 1710
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1710, 1710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1710
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1710
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1710
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1710
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1710
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1800, 1710, 1710
                    , 1710, 1710, 1710, 1710
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1710, 1710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1710
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1710
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1710
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1710
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1710
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-21 14:06:34' WHERE storedetailid = '3619';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2228', '1', '3', '1', '1155', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '6', '2026-10-21 14:06:34','0','0'); -- id=15939
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1209;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('800','01990', '1155', '161', '1990', '3', '850', '2550', '0', '', '0', '2026-10-21 14:06:34', '1990', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1209-3,','1','1','0','0','850','2550','0','','0','0.00','0','0','0','0'); -- id=4741
UPDATE sellbilldetail SET  lastbuyprice = 800.00 , meanbuyprice = 800.00, lastbuyprice_withDiscount = 800.00, meanbuyprice_withDiscount = 800.00
        , lastbuyprice_withTax = 800, meanbuyprice_withTax = 800, lastbuyprice_withDiscountAndTax = 800
                where sellbilldetailid = 4741;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1990, '2026-10-21', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, 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+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-21', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, 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 = '141', userid = '6', storedetaildate = '2026-10-21 14:06:34' WHERE storedetailid = '3007';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1990', '1', '3', '1', '1155', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '141', '6', '2026-10-21 14:06:34','0','0'); -- id=15940
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 454;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('700','01598', '1155', '118', '1598', '8', '800', '6400', '0', '', '0', '2026-10-21 14:06:34', '1598', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','454-8,','1','1','0','0','800','6400','0','','0','0.00','0','0','0','0'); -- id=4742
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 4742;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1598, '2026-10-21', 6400, 5600, 5600
                    , 5600, 5600, 5600, 5600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 5600, 5600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+5600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6400, 5600, 5600
                    , 5600, 5600, 5600, 5600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5600, 5600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+5600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-21 14:06:34' WHERE storedetailid = '1623';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1598', '1', '8', '1', '1155', 'اضافة فاتورة مبيعات', 'sellbillController.php', '80', '72', '6', '2026-10-21 14:06:34','0','0'); -- id=15941
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '998545',  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 ('987795','10750', '0', '4', 'اضافة فاتورة مبيعات', '1155', '998545', '2026-10-21 14:06:34', '6',  'sellbillController.php','1','','0'); -- id=1432
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10750', '10750', '2026-10-21', '6', '0', '0', '2026-10-21 14:06:34','اضافة فاتورة مبيعات رقم 1155','1','0',null,'0','1155','sellbillController.php?do=showDetail&sellbillid=1155'); -- id=4107
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4107', '568', '10750', '','0'); -- id=4216
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '998545', 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 ('4107', '143', '10750', '','0'); -- id=4109
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13090020', 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 ( '9710', '9710', '2026-10-21', '6', '0', '0', '2026-10-21 14:06:34','اضافة فاتورة مبيعات رقم 1155 - صرف البضاعة من المخزن','1','0',null,'0','1155','sellbillController.php?do=showDetail&sellbillid=1155'); -- id=4108
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4108', '402', '9710', '','0'); -- id=4217
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12109741.51', 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 ('4108', '382', '9710', '','0'); -- id=4110
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24904699.79', 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='4107,0,4108' where sellbillid=1155;
 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-21', 10750, 9710, 9710
                    , 9710, 9710, 9710, 9710
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9710, 9710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10750, sellCostBuyPrice =sellCostBuyPrice+9710
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9710
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9710
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9710
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9710
                        , returnSellVal = returnSellVal+0, 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-21', 10750, 9710, 9710
                    , 9710, 9710, 9710, 9710
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9710, 9710, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10750, sellCostBuyPrice =sellCostBuyPrice+9710
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9710
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9710
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9710
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9710
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9710
                        , returnSellVal = returnSellVal+0, 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, 10750, 9710, 9710
                    , 9710, 9710, 9710, 9710, 9710, 9710)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10750, netSellCostBuyPrice = netSellCostBuyPrice+9710
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9710
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9710
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9710
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9710
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9710
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9710
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9710;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad899c7b2271 and sellbillId = 1155 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:36:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:06:35", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:06:35', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16347
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:07:01', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:07:15', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16349
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:07:18', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16350
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-21 10:37:18";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 14:07:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:07:18', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16351
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:07:20', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:07:22', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16353
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:07:25', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16354

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad87e5b27877
-- ----------------------------------------------------------------------------------------------------

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-21 14:07:25', '06ad87e5b27877', '1', '0.00', '0', '0', '1', '28310.00', '28310', '28310', '0', '1', '2026-10-21 14:07:25', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '48' ,'0','','','','','-1','0','0','0','0','0','28310','0','','0','0','28310','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1156
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','اضافة فاتورة مبيعات','1156', '0', '2026-10-21 14:07:25', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '28310', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:07:25','0','0','',''); -- id=1379
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 958;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01880', '1156', '75', '1880', '9', '400', '3600', '0', '', '0', '2026-10-21 14:07:25', '1880', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','958-9,','1','1','0','0','400','3600','0','','0','0.00','0','0','0','0'); -- id=4743
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 204.85
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 1951.52, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4743;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1880, '2026-10-21', 3600, 3600, 3600
                    , 3600, 3240, 1843.65, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3600, 17563.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1843.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17563.68
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3600, 3600, 3600
                    , 3600, 3240, 1843.65, 3240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 17563.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1843.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17563.68
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '2897';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1880', '1', '9', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '39', '2', '2026-10-21 14:07:25','0','0'); -- id=15942
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 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', '1156', '75', '1879', '4', '390', '1560', '0', '', '0', '2026-10-21 14:07:25', '1879', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','957-4,','1','1','0','0','390','1560','0','','0','0.00','0','0','0','0'); -- id=4744
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 = 4744;
 INSERT INTO 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-21', 1560, 1560, 1560
                    , 1560, 1404, 1482, 1404
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1560, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1404, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1482
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1404
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1560, 1560, 1560
                    , 1560, 1404, 1482, 1404
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1404, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1482
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1404
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '4', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '2', '2026-10-21 14:07:25','0','0'); -- id=15943
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6900;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('700','02330', '1156', '28', '2330', '5', '720', '3600', '0', '', '0', '2026-10-21 14:07:25', '2330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6900-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=4745
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 4745;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2330, '2026-10-21', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '3724';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2330', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 14:07:25','0','0'); -- id=15944
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6899;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('720','02329', '1156', '28', '2329', '5', '740', '3700', '0', '', '0', '2026-10-21 14:07:25', '2329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6899-5,','1','1','0','0','740','3700','0','','0','0.00','0','0','0','0'); -- id=4746
UPDATE sellbilldetail SET  lastbuyprice = 720.00 , meanbuyprice = 720.00, lastbuyprice_withDiscount = 720.00, meanbuyprice_withDiscount = 720.00
        , lastbuyprice_withTax = 720, meanbuyprice_withTax = 720, lastbuyprice_withDiscountAndTax = 720
                where sellbilldetailid = 4746;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2329, '2026-10-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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+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-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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 = '10', userid = '2', storedetaildate = '2026-10-21 14:07:25' WHERE storedetailid = '3723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2329', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 14:07:25','0','0'); -- id=15945
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6896;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','02326', '1156', '28', '2326', '5', '620', '3100', '0', '', '0', '2026-10-21 14:07:25', '2326', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6896-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=4747
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 4747;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2326, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-10-21 14:07:25' WHERE storedetailid = '3720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 14:07:25','0','0'); -- id=15946
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6877;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('652','02323', '1156', '8', '2323', '5', '680', '3400', '0', '', '0', '2026-10-21 14:07:25', '2323', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6877-5,','1','1','0','0','680','3400','0','','0','0.00','0','0','0','0'); -- id=4748
UPDATE sellbilldetail SET  lastbuyprice = 652.00 , meanbuyprice = 652.00, lastbuyprice_withDiscount = 652.00, meanbuyprice_withDiscount = 652.00
        , lastbuyprice_withTax = 652, meanbuyprice_withTax = 652, lastbuyprice_withDiscountAndTax = 652
                where sellbilldetailid = 4748;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2323, '2026-10-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '3717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 14:07:25','0','0'); -- id=15947
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6873;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('512','02319', '1156', '8', '2319', '5', '540', '2700', '0', '', '0', '2026-10-21 14:07:25', '2319', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6873-5,','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=4749
UPDATE sellbilldetail SET  lastbuyprice = 512.00 , meanbuyprice = 512.00, lastbuyprice_withDiscount = 512.00, meanbuyprice_withDiscount = 512.00
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where sellbilldetailid = 4749;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2319, '2026-10-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 14:07:25','0','0'); -- id=15948
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6871;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('617','02317', '1156', '8', '2317', '5', '645', '3225', '0', '', '0', '2026-10-21 14:07:25', '2317', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6871-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=4750
UPDATE sellbilldetail SET  lastbuyprice = 617.00 , meanbuyprice = 617.00, lastbuyprice_withDiscount = 617.00, meanbuyprice_withDiscount = 617.00
        , lastbuyprice_withTax = 617, meanbuyprice_withTax = 617, lastbuyprice_withDiscountAndTax = 617
                where sellbilldetailid = 4750;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2317, '2026-10-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '3711';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2317', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 14:07:25','0','0'); -- id=15949
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6874;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('657','02320', '1156', '8', '2320', '5', '685', '3425', '0', '', '0', '2026-10-21 14:07:25', '2320', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6874-5,','1','1','0','0','685','3425','0','','0','0.00','0','0','0','0'); -- id=4751
UPDATE sellbilldetail SET  lastbuyprice = 657.00 , meanbuyprice = 657.00, lastbuyprice_withDiscount = 657.00, meanbuyprice_withDiscount = 657.00
        , lastbuyprice_withTax = 657, meanbuyprice_withTax = 657, lastbuyprice_withDiscountAndTax = 657
                where sellbilldetailid = 4751;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2320, '2026-10-21', 3425, 3285, 3285
                    , 3285, 3285, 3285, 3285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3285, 3285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3425, 3285, 3285
                    , 3285, 3285, 3285, 3285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3285, 3285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:07:25' WHERE storedetailid = '3714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2320', '1', '5', '1', '1156', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 14:07:25','0','0'); -- id=15950
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7150358.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 ('7122048.5','28310', '0', '2', 'اضافة فاتورة مبيعات', '1156', '7150358.5', '2026-10-21 14:07:25', '2',  'sellbillController.php','1','','0'); -- id=1433
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28310', '28310', '2026-10-21', '2', '0', '0', '2026-10-21 14:07:25','اضافة فاتورة مبيعات رقم 1156','1','0',null,'0','1156','sellbillController.php?do=showDetail&sellbillid=1156'); -- id=4109
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4109', '419', '28310', '','0'); -- id=4218
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7150358', 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 ('4109', '143', '28310', '','0'); -- id=4111
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13118330', 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 ( '26934', '26934', '2026-10-21', '2', '0', '0', '2026-10-21 14:07:25','اضافة فاتورة مبيعات رقم 1156 - صرف البضاعة من المخزن','1','0',null,'0','1156','sellbillController.php?do=showDetail&sellbillid=1156'); -- id=4110
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4110', '402', '26934', '','0'); -- id=4219
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12136675.51', 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 ('4110', '382', '26934', '','0'); -- id=4112
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24877765.79', 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='4109,0,4110' where sellbillid=1156;
 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-21', 28310, 27450, 27450
                    , 27450, 26934, 25615.65, 26934
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27450, 40633.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28310, sellCostBuyPrice =sellCostBuyPrice+27450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26934, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+25615.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26934
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40633.68
                        , returnSellVal = returnSellVal+0, 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-21', 28310, 27450, 27450
                    , 27450, 26934, 25615.65, 26934
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27450, 40633.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28310, sellCostBuyPrice =sellCostBuyPrice+27450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26934, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+25615.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26934
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40633.68
                        , returnSellVal = returnSellVal+0, 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, 28310, 27450, 27450
                    , 27450, 26934, 25615.65, 26934, 27450, 40633.68)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+28310, netSellCostBuyPrice = netSellCostBuyPrice+27450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+27450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+27450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26934
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+25615.65
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26934
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+27450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+40633.68;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad87e5b27877 and sellbillId = 1156 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:07:25', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16355
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:07:40', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:37:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:07:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:07:50', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16357
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:38:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:08:10", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:08:10', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16358
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '360', '360', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:02','تعديل منتج (كود 1002 برو) السعر من (480.00) الى (510) و الكميه (12)','1','0',null,'0','1949','productController.php?do=edit&id=1949'); -- id=4111
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4111', '382', '360', '','0'); -- id=4220
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24878125.79', 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 ('4111', '53', '360', '','0'); -- id=4113
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-239140', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 1949;
UPDATE product SET productName = 'كود 1002 برو', productDescription = '', productCatId = '158', productBuyPrice = '510', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01949',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480.00',lastbuyprice_withDiscount = '480',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',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='495',meanbuyprice_withTax='495',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='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 = '1949';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1949, 1,'2026-10-21 14:09:02',7)
                ON DUPLICATE KEY UPDATE productid = 1949, edited = 1, sysdate = '2026-10-21 14:09:02', userid = 7; -- id=2890
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '720', '720', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:06','تعديل منتج (كود 1005 برو) السعر من (500.00) الى (530) و الكميه (24)','1','0',null,'0','1950','productController.php?do=edit&id=1950'); -- id=4112
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4112', '382', '720', '','0'); -- id=4221
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24878845.79', 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 ('4112', '53', '720', '','0'); -- id=4114
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-238420', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 530 * productnumber WHERE productid = 1950;
UPDATE product SET productName = 'كود 1005 برو', productDescription = '', productCatId = '158', productBuyPrice = '530', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01950',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='515',meanbuyprice_withTax='515',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1950';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1950, 1,'2026-10-21 14:09:06',7)
                ON DUPLICATE KEY UPDATE productid = 1950, edited = 1, sysdate = '2026-10-21 14:09:06', userid = 7; -- id=2891
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '120', '120', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:09','تعديل منتج (كود 1015 برو) السعر من (450.00) الى (480) و الكميه (4)','1','0',null,'0','1951','productController.php?do=edit&id=1951'); -- id=4113
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4113', '382', '120', '','0'); -- id=4222
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24878965.79', 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 ('4113', '53', '120', '','0'); -- id=4115
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-238300', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 1951;
UPDATE product SET productName = 'كود 1015 برو', productDescription = '', productCatId = '158', productBuyPrice = '480', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01951',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '450',meanbuyprice = '465',meanbuyprice_withDiscount = '465' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.67' , 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='465',meanbuyprice_withTax='465',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 = '1951';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1951, 1,'2026-10-21 14:09:09',7)
                ON DUPLICATE KEY UPDATE productid = 1951, edited = 1, sysdate = '2026-10-21 14:09:09', userid = 7; -- id=2892
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1952;
UPDATE product SET productName = 'كود 1014 برو', productDescription = '', productCatId = '158', productBuyPrice = '600', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01952',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570.00',lastbuyprice_withDiscount = '570',meanbuyprice = '585',meanbuyprice_withDiscount = '585' , productbuypricereal = '570.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='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1952';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1952, 1,'2026-10-21 14:09:27',7)
                ON DUPLICATE KEY UPDATE productid = 1952, edited = 1, sysdate = '2026-10-21 14:09:27', userid = 7; -- id=2893
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1260', '1260', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:49','تعديل منتج (موديلات 550 برو) السعر من (520.00) الى (550.00) و الكميه (42)','1','0',null,'0','1953','productController.php?do=edit&id=1953'); -- id=4114
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4114', '382', '1260', '','0'); -- id=4223
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24880225.79', 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 ('4114', '53', '1260', '','0'); -- id=4116
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-237040', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 550.00 * productnumber WHERE productid = 1953;
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520.00',lastbuyprice_withDiscount = '520',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',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='535',meanbuyprice_withTax='535',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='520',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1953';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1953, 1,'2026-10-21 14:09:49',7)
                ON DUPLICATE KEY UPDATE productid = 1953, edited = 1, sysdate = '2026-10-21 14:09:49', userid = 7; -- id=2894
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1080', '1080', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:54','تعديل منتج (موديلات 650 برو) السعر من (620.00) الى (650.00) و الكميه (36)','1','0',null,'0','1954','productController.php?do=edit&id=1954'); -- id=4115
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4115', '382', '1080', '','0'); -- id=4224
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24881305.79', 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 ('4115', '53', '1080', '','0'); -- id=4117
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-235960', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 650.00 * productnumber WHERE productid = 1954;
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620.00',lastbuyprice_withDiscount = '620',meanbuyprice = '635',meanbuyprice_withDiscount = '635' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',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='635',meanbuyprice_withTax='635',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='620',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1954';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1954, 1,'2026-10-21 14:09:54',7)
                ON DUPLICATE KEY UPDATE productid = 1954, edited = 1, sysdate = '2026-10-21 14:09:54', userid = 7; -- id=2895
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:39:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:09:57", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:09:57', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16359

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad89cbb3fac1
-- ----------------------------------------------------------------------------------------------------

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-21 14:09:57', '06ad89cbb3fac1', '1', '0.00', '0', '0', '1', '11900.00', '11900', '11900', '0', '1', '2026-10-21 14:09:57', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','11900','0','','0','0','11900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1157
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','اضافة فاتورة مبيعات','1157', '0', '2026-10-21 14:09:57', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11900', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:09:57','0','0','',''); -- id=1380
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1157', '175', '2088', '20', '595', '11900', '0', '', '0', '2026-10-21 14:09:57', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-20,','1','1','0','0','595','11900','0','','0','0.00','0','0','0','0'); -- id=4752
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 = 4752;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 11900, 9200, 9200
                    , 9200, 9200, 9200, 9200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 9200, 9200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11900, sellCostBuyPrice =sellCostBuyPrice+9200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 11900, 9200, 9200
                    , 9200, 9200, 9200, 9200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9200, 9200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11900, sellCostBuyPrice =sellCostBuyPrice+9200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1106', userid = '6', storedetaildate = '2026-10-21 14:09:57' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '20', '1', '1157', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1126', '1106', '6', '2026-10-21 14:09:57','0','0'); -- id=15951
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1010445',  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 ('998545','11900', '0', '4', 'اضافة فاتورة مبيعات', '1157', '1010445', '2026-10-21 14:09:57', '6',  'sellbillController.php','1','','0'); -- id=1434
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11900', '11900', '2026-10-21', '6', '0', '0', '2026-10-21 14:09:57','اضافة فاتورة مبيعات رقم 1157','1','0',null,'0','1157','sellbillController.php?do=showDetail&sellbillid=1157'); -- id=4116
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4116', '568', '11900', '','0'); -- id=4225
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1010445', 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 ('4116', '143', '11900', '','0'); -- id=4118
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13130230', 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 ( '9200', '9200', '2026-10-21', '6', '0', '0', '2026-10-21 14:09:57','اضافة فاتورة مبيعات رقم 1157 - صرف البضاعة من المخزن','1','0',null,'0','1157','sellbillController.php?do=showDetail&sellbillid=1157'); -- id=4117
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4117', '402', '9200', '','0'); -- id=4226
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12145875.51', 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 ('4117', '382', '9200', '','0'); -- id=4119
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24872105.79', 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='4116,0,4117' where sellbillid=1157;
 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-21', 11900, 9200, 9200
                    , 9200, 9200, 9200, 9200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9200, 9200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11900, sellCostBuyPrice =sellCostBuyPrice+9200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9200
                        , returnSellVal = returnSellVal+0, 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-21', 11900, 9200, 9200
                    , 9200, 9200, 9200, 9200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9200, 9200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11900, sellCostBuyPrice =sellCostBuyPrice+9200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9200
                        , returnSellVal = returnSellVal+0, 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, 11900, 9200, 9200
                    , 9200, 9200, 9200, 9200, 9200, 9200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11900, netSellCostBuyPrice = netSellCostBuyPrice+9200
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9200
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9200
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9200
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9200
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9200
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9200
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad89cbb3fac1 and sellbillId = 1157 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:39:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:09:57", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:09:57', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16360
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2026-10-21', '7', '0', '0', '2026-10-21 14:09:58','تعديل منتج (كود 1036 برو) السعر من (650.00) الى (680.00) و الكميه (20)','1','0',null,'0','1955','productController.php?do=edit&id=1955'); -- id=4118
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4118', '382', '600', '','0'); -- id=4227
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24872705.79', 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 ('4118', '53', '600', '','0'); -- id=4120
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-235360', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 680.00 * productnumber WHERE productid = 1955;
UPDATE product SET productName = 'كود 1036 برو', productDescription = '', productCatId = '158', productBuyPrice = '680.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01955',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '665',meanbuyprice_withDiscount = '665' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',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='665',meanbuyprice_withTax='665',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='650',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1955';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1955, 1,'2026-10-21 14:09:58',7)
                ON DUPLICATE KEY UPDATE productid = 1955, edited = 1, sysdate = '2026-10-21 14:09:58', userid = 7; -- id=2896
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1020', '1020', '2026-10-21', '7', '0', '0', '2026-10-21 14:10:02','تعديل منتج (موديلات 580 برو) السعر من (550.00) الى (580.00) و الكميه (34)','1','0',null,'0','1956','productController.php?do=edit&id=1956'); -- id=4119
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4119', '382', '1020', '','0'); -- id=4228
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24873725.79', 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 ('4119', '53', '1020', '','0'); -- id=4121
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-234340', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 580.00 * productnumber WHERE productid = 1956;
UPDATE product SET productName = 'موديلات 580 برو', productDescription = '', productCatId = '158', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '550',meanbuyprice = '565',meanbuyprice_withDiscount = '565' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='565',meanbuyprice_withTax='565',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1956';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1956, 1,'2026-10-21 14:10:02',7)
                ON DUPLICATE KEY UPDATE productid = 1956, edited = 1, sysdate = '2026-10-21 14:10:02', userid = 7; -- id=2897
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2026-10-21', '7', '0', '0', '2026-10-21 14:10:08','تعديل منتج (كود 1008 برو) السعر من (630.00) الى (660.00) و الكميه (20)','1','0',null,'0','1957','productController.php?do=edit&id=1957'); -- id=4120
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4120', '382', '600', '','0'); -- id=4229
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24874325.79', 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 ('4120', '53', '600', '','0'); -- id=4122
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-233740', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 660.00 * productnumber WHERE productid = 1957;
UPDATE product SET productName = 'كود 1008 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:10:08',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:10:08', userid = 7; -- id=2898
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2026-10-21', '7', '0', '0', '2026-10-21 14:10:12','تعديل منتج (كود 1031 برو) السعر من (470.00) الى (500.00) و الكميه (20)','1','0',null,'0','1958','productController.php?do=edit&id=1958'); -- id=4121
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4121', '382', '600', '','0'); -- id=4230
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24874925.79', 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 ('4121', '53', '600', '','0'); -- id=4123
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-233140', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 500.00 * productnumber WHERE productid = 1958;
UPDATE product SET productName = 'كود 1031 برو', productDescription = '', productCatId = '158', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='485',meanbuyprice_withTax='485',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1958';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1958, 1,'2026-10-21 14:10:12',7)
                ON DUPLICATE KEY UPDATE productid = 1958, edited = 1, sysdate = '2026-10-21 14:10:12', userid = 7; -- id=2899
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '240', '240', '2026-10-21', '7', '0', '0', '2026-10-21 14:10:25','تعديل منتج (كود 1023 برو) السعر من (490.00) الى (520.00) و الكميه (8)','1','0',null,'0','1959','productController.php?do=edit&id=1959'); -- id=4122
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4122', '382', '240', '','0'); -- id=4231
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24875165.79', 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 ('4122', '53', '240', '','0'); -- id=4124
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-232900', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 520.00 * productnumber WHERE productid = 1959;
UPDATE product SET productName = 'كود 1023 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '505',meanbuyprice_withDiscount = '505' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='505',meanbuyprice_withTax='505',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1959';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1959, 1,'2026-10-21 14:10:25',7)
                ON DUPLICATE KEY UPDATE productid = 1959, edited = 1, sysdate = '2026-10-21 14:10:25', userid = 7; -- id=2900
UPDATE productunit SET proUnitBuyPrice  = 500.00 * productnumber WHERE productid = 1958;
UPDATE product SET productName = 'كود 1031 برو', productDescription = '', productCatId = '158', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '485.00',meanbuyprice_withDiscount = '485' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='485',meanbuyprice_withTax='485',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1958';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1958, 1,'2026-10-21 14:11:35',7)
                ON DUPLICATE KEY UPDATE productid = 1958, edited = 1, sysdate = '2026-10-21 14:11:35', userid = 7; -- id=2899
UPDATE productunit SET proUnitBuyPrice  = 660.00 * productnumber WHERE productid = 1957;
UPDATE product SET productName = 'كود 1008 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645.00',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:11:36',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:11:36', userid = 7; -- id=2898
UPDATE product SET productName = 'كود 1008 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645.00',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:13:02',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:13:02', userid = 7; -- id=2898
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:43:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:13:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:13:03', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16361
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-21 10:43:03";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:13:03', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16362
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:43:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:13:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:13:06', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16363
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:43:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:13:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:13:10', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16364

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad87756ad342
-- ----------------------------------------------------------------------------------------------------

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-21 14:13:10', '06ad87756ad342', '1', '0.00', '0', '0', '1', '1170.00', '1170', '1170', '0', '1', '2026-10-21 14:13:10', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1170','0','','0','0','1170','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1158
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','اضافة فاتورة مبيعات','1158', '0', '2026-10-21 14:13:10', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1170', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:13:10','0','0','',''); -- id=1381
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1158', '75', '1879', '3', '390', '1170', '0', '', '0', '2026-10-21 14:13:10', '1879', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','957-3,','1','1','0','0','390','1170','0','','0','0.00','0','0','0','0'); -- id=4753
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 = 4753;
 INSERT INTO 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-21', 1170, 1170, 1170
                    , 1170, 1053, 1111.5, 1053
                    , 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+1053, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1111.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1053
                            , 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-21', 1170, 1170, 1170
                    , 1170, 1053, 1111.5, 1053
                    , 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+1053, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1111.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1053
                            , 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 = '17', userid = '2', storedetaildate = '2026-10-21 14:13:10' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '3', '1', '1158', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '17', '2', '2026-10-21 14:13:10','0','0'); -- id=15952
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7151528.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 ('7150358.5','1170', '0', '2', 'اضافة فاتورة مبيعات', '1158', '7151528.5', '2026-10-21 14:13:10', '2',  'sellbillController.php','1','','0'); -- id=1435
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1170', '1170', '2026-10-21', '2', '0', '0', '2026-10-21 14:13:10','اضافة فاتورة مبيعات رقم 1158','1','0',null,'0','1158','sellbillController.php?do=showDetail&sellbillid=1158'); -- id=4123
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4123', '419', '1170', '','0'); -- id=4232
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7151528', 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 ('4123', '143', '1170', '','0'); -- id=4125
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13131400', 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 ( '1053', '1053', '2026-10-21', '2', '0', '0', '2026-10-21 14:13:10','اضافة فاتورة مبيعات رقم 1158 - صرف البضاعة من المخزن','1','0',null,'0','1158','sellbillController.php?do=showDetail&sellbillid=1158'); -- id=4124
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4124', '402', '1053', '','0'); -- id=4233
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12146928.51', 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 ('4124', '382', '1053', '','0'); -- id=4126
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24874112.79', 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='4123,0,4124' where sellbillid=1158;
 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-21', 1170, 1170, 1170
                    , 1170, 1053, 1111.5, 1053
                    , 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+1053, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1111.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1053
                            , 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;
 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-21', 1170, 1170, 1170
                    , 1170, 1053, 1111.5, 1053
                    , 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+1053, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1111.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1053
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1170, 1170, 1170
                    , 1170, 1053, 1111.5, 1053, 1170, 585)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1170, netSellCostBuyPrice = netSellCostBuyPrice+1170
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1170
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1170
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1053
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1111.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1053
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1170
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+585;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad87756ad342 and sellbillId = 1158 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:43:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:13:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:13:10', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16365
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:44:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:14:17", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:14:17', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16366
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 ('موديل 1030 برو','','158','440','440','0','0','2026-10-21','0','7','0','','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','0','0','0','0','0','-1','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=2333
UPDATE product SET productName = 'موديل 1030 برو', productDescription = '', productCatId = '158', productBuyPrice = '440', productSellAllPrice = '440', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02333',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='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 = '2333';
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', '2333', '1.00', '2026-10-21', '7', '0','0233301','440','0','0','440','','0','0','0','0','0','0','0','0','0','0'); -- id=2333
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2333', '1', '0', '7', '2026-10-21'); -- id=3727
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2333', '1', '0', '0', '2333', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15953
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2333, 1,'2026-10-21 14:14:17',7)
                ON DUPLICATE KEY UPDATE productid = 2333, edited = 1, sysdate = '2026-10-21 14:14:17', userid = 7; -- id=3437
UPDATE product SET productName = 'موديل 1030 برو', productDescription = '', productCatId = '158', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02333',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='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 = '2333';
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 ('موديل 1032 برو','','158','560','560','0','0','2026-10-21','0','7','0','','0','0','0','0','0','560','560','560','560','560','0','0','0','0','.','0','0','0','560','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','560','560','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','560','0','0','0','0','0','0','','','0','0','0','0'); -- id=2334
UPDATE product SET productName = 'موديل 1032 برو', productDescription = '', productCatId = '158', productBuyPrice = '560', productSellAllPrice = '560', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2334';
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', '2334', '1.00', '2026-10-21', '7', '0','0233401','560','0','0','560','','0','0','0','0','0','0','0','0','0','0'); -- id=2334
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2334', '1', '0', '7', '2026-10-21'); -- id=3728
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2334', '1', '0', '0', '2334', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15954
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2334, 1,'2026-10-21 14:14:17',7)
                ON DUPLICATE KEY UPDATE productid = 2334, edited = 1, sysdate = '2026-10-21 14:14:17', userid = 7; -- id=3438
UPDATE product SET productName = 'موديل 1032 برو', productDescription = '', productCatId = '158', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2334';
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 ('موديل 670 برو','','158','670','670','0','0','2026-10-21','0','7','0','','0','0','0','0','0','670','670','670','670','670','0','0','0','0','.','0','0','0','670','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','670','670','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','670','0','0','0','0','0','0','','','0','0','0','0'); -- id=2335
UPDATE product SET productName = 'موديل 670 برو', productDescription = '', productCatId = '158', productBuyPrice = '670', productSellAllPrice = '670', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '670',meanbuyprice = '670',meanbuyprice_withDiscount = '670' , productbuypricereal = '670' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',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='670',meanbuyprice_withTax='670',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='670',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2335';
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', '2335', '1.00', '2026-10-21', '7', '0','0233501','670','0','0','670','','0','0','0','0','0','0','0','0','0','0'); -- id=2335
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2335', '1', '0', '7', '2026-10-21'); -- id=3729
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2335', '1', '0', '0', '2335', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15955
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2335, 1,'2026-10-21 14:14:17',7)
                ON DUPLICATE KEY UPDATE productid = 2335, edited = 1, sysdate = '2026-10-21 14:14:17', userid = 7; -- id=3439
UPDATE product SET productName = 'موديل 670 برو', productDescription = '', productCatId = '158', productBuyPrice = '670.00', productSellAllPrice = '670.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '670',meanbuyprice = '670',meanbuyprice_withDiscount = '670' , productbuypricereal = '670' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',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='670',meanbuyprice_withTax='670',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='670',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2335';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:44:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:14:18", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:14:18', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16367
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:44:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:14:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:14:30', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16368
UPDATE product SET productName = 'كود 1008 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645.00',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:14:44',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:14:44', userid = 7; -- id=2898
UPDATE product SET productName = 'كود 1008 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645.00',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:14:52',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:14:52', userid = 7; -- id=2898
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:45:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:15:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:15:17', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16369
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-21 10:45:18";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 14:15:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:15:18', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16370
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:45:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:15:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:15:19', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16371
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:45:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:15:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:15:30', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16372
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:45:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:15:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:15:39', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16373
UPDATE product SET productName = 'موديلات 660 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630.00',lastbuyprice_withDiscount = '630',meanbuyprice = '645.00',meanbuyprice_withDiscount = '645' , productbuypricereal = '630.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='630',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='645',meanbuyprice_withTax='645',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='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1957';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1957, 1,'2026-10-21 14:15:54',7)
                ON DUPLICATE KEY UPDATE productid = 1957, edited = 1, sysdate = '2026-10-21 14:15:54', userid = 7; -- id=2898
UPDATE product SET productName = 'كود 1036 برو', productDescription = '', productCatId = '158', productBuyPrice = '680.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01955',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '665.00',meanbuyprice_withDiscount = '665' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',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='665',meanbuyprice_withTax='665',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='650',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1955';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1955, 1,'2026-10-21 14:15:56',7)
                ON DUPLICATE KEY UPDATE productid = 1955, edited = 1, sysdate = '2026-10-21 14:15:56', userid = 7; -- id=2896
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:46:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:16:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:16:06', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16374
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:49:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:19:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:19:30', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16375
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-21 10:49:30";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 14:19:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:19:30', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16376
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:49:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:19:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:19:32', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16377
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:49:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:19:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:19:36', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16378

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad89e4653ca7
-- ----------------------------------------------------------------------------------------------------

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-21 14:19:36', '06ad89e4653ca7', '1', '0.00', '0', '0', '1', '6200.00', '6200', '6200', '0', '1', '2026-10-21 14:19:36', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','6200','0','','0','0','6200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1159
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','اضافة فاتورة مبيعات','1159', '0', '2026-10-21 14:19:36', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:19:36','0','0','',''); -- id=1382
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6755;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02271', '1159', '71', '2271', '6', '340', '2040', '0', '', '0', '2026-10-21 14:19:36', '2271', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6755-6,','1','1','0','0','340','2040','0','','0','0.00','0','0','0','0'); -- id=4754
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 = 4754;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2271, '2026-10-21', 2040, 2040, 2040
                    , 2040, 1876.8, 1876.8, 1876.8
                    , 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+1876.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1876.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1876.8
                            , 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-21', 2040, 2040, 2040
                    , 2040, 1876.8, 1876.8, 1876.8
                    , 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+1876.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1876.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1876.8
                            , 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 = '126', userid = '2', storedetaildate = '2026-10-21 14:19:36' WHERE storedetailid = '3664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2271', '1', '6', '1', '1159', 'اضافة فاتورة مبيعات', 'sellbillController.php', '132', '126', '2', '2026-10-21 14:19:36','0','0'); -- id=15956
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02084', '1159', '43', '2084', '6', '360', '2160', '0', '', '0', '2026-10-21 14:19:36', '2084', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6131-6,','1','1','0','0','360','2160','0','','0','0.00','0','0','0','0'); -- id=4755
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 = 4755;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2084, '2026-10-21', 2160, 2160, 2160
                    , 2160, 1944, 1944, 1944
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1944, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1944
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1944
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2160, 2160, 2160
                    , 2160, 1944, 1944, 1944
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1944, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1944
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1944
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 14:19:36' WHERE storedetailid = '3443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2084', '1', '6', '1', '1159', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '54', '2', '2026-10-21 14:19:36','0','0'); -- id=15957
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6850;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01684', '1159', '68', '1684', '8', '250', '2000', '0', '', '0', '2026-10-21 14:19:36', '1684', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6850-8,','1','1','0','0','250','2000','0','','0','0.00','0','0','0','0'); -- id=4756
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 4756;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1684, '2026-10-21', 2000, 1880, 1880
                    , 1880, 1880, 1880, 1880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1880, 1880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2000, 1880, 1880
                    , 1880, 1880, 1880, 1880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1880, 1880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '2', storedetaildate = '2026-10-21 14:19:36' WHERE storedetailid = '2696';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1684', '1', '8', '1', '1159', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '44', '2', '2026-10-21 14:19:36','0','0'); -- id=15958
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7157728.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 ('7151528.5','6200', '0', '2', 'اضافة فاتورة مبيعات', '1159', '7157728.5', '2026-10-21 14:19:36', '2',  'sellbillController.php','1','','0'); -- id=1436
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6200', '6200', '2026-10-21', '2', '0', '0', '2026-10-21 14:19:36','اضافة فاتورة مبيعات رقم 1159','1','0',null,'0','1159','sellbillController.php?do=showDetail&sellbillid=1159'); -- id=4125
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4125', '419', '6200', '','0'); -- id=4234
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7157728', 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 ('4125', '143', '6200', '','0'); -- id=4127
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13137600', 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 ( '5700.8', '5700.8', '2026-10-21', '2', '0', '0', '2026-10-21 14:19:36','اضافة فاتورة مبيعات رقم 1159 - صرف البضاعة من المخزن','1','0',null,'0','1159','sellbillController.php?do=showDetail&sellbillid=1159'); -- id=4126
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4126', '402', '5700.8', '','0'); -- id=4235
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12152629.31', 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 ('4126', '382', '5700.8', '','0'); -- id=4128
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24868411.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='4125,0,4126' where sellbillid=1159;
 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-21', 6200, 6080, 6080
                    , 6080, 5700.8, 5700.8, 5700.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6080, 6080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6080
                        , returnSellVal = returnSellVal+0, 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-21', 6200, 6080, 6080
                    , 6080, 5700.8, 5700.8, 5700.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6080, 6080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6080
                        , returnSellVal = returnSellVal+0, 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, 6200, 6080, 6080
                    , 6080, 5700.8, 5700.8, 5700.8, 6080, 6080)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6200, netSellCostBuyPrice = netSellCostBuyPrice+6080
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6080
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6080
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5700.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5700.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5700.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6080
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6080;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad89e4653ca7 and sellbillId = 1159 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:49:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:19:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:19:36', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16379
UPDATE product SET productName = 'كود 1023 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '505.00',meanbuyprice_withDiscount = '505' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='505',meanbuyprice_withTax='505',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1959';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1959, 1,'2026-10-21 14:19:55',7)
                ON DUPLICATE KEY UPDATE productid = 1959, edited = 1, sysdate = '2026-10-21 14:19:55', userid = 7; -- id=2900
UPDATE product SET productName = 'موديلات 520 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '505.00',meanbuyprice_withDiscount = '505' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='505',meanbuyprice_withTax='505',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1959';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1959, 1,'2026-10-21 14:20:04',7)
                ON DUPLICATE KEY UPDATE productid = 1959, edited = 1, sysdate = '2026-10-21 14:20:04', userid = 7; -- id=2900
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:50:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:20:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:20:04', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16380
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-21 10:50:04";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 14:20:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:20:04', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16381
UPDATE product SET productName = 'كود 1031 برو', productDescription = '', productCatId = '158', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '485.00',meanbuyprice_withDiscount = '485' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='485',meanbuyprice_withTax='485',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1958';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1958, 1,'2026-10-21 14:20:05',7)
                ON DUPLICATE KEY UPDATE productid = 1958, edited = 1, sysdate = '2026-10-21 14:20:05', userid = 7; -- id=2899
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:50:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:20:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:20:06', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16382
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:50:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:20:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:20:11', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16383

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad89cedadbb3
-- ----------------------------------------------------------------------------------------------------

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-21 14:20:11', '06ad89cedadbb3', '1', '0.00', '0', '0', '1', '16000.00', '16000', '16000', '0', '1', '2026-10-21 14:20:11', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '25' ,'0','','','','','-1','0','0','0','0','0','16000','0','','0','0','16000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1160
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','اضافة فاتورة مبيعات','1160', '0', '2026-10-21 14:20:11', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '16000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:20:11','0','0','',''); -- id=1383
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6898;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','02328', '1160', '28', '2328', '5', '590', '2950', '0', '', '0', '2026-10-21 14:20:11', '2328', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6898-5,','1','1','0','0','590','2950','0','','0','0.00','0','0','0','0'); -- id=4757
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4757;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2328, '2026-10-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:20:11' WHERE storedetailid = '3722';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2328', '1', '5', '1', '1160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-21 14:20:11','0','0'); -- id=15959
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6900;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('700','02330', '1160', '28', '2330', '5', '720', '3600', '0', '', '0', '2026-10-21 14:20:11', '2330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6900-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=4758
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 4758;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2330, '2026-10-21', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:20:11' WHERE storedetailid = '3724';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2330', '1', '5', '1', '1160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 14:20:11','0','0'); -- id=15960
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 1158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01966', '1160', '28', '1966', '5', '600', '3000', '0', '', '0', '2026-10-21 14:20:11', '1966', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1158-5,','1','1','0','0','600','3000','0','','0','0.00','0','0','0','0'); -- id=4759
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 = 4759;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1966, '2026-10-21', 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-21', 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 = '5', userid = '2', storedetaildate = '2026-10-21 14:20:11' WHERE storedetailid = '2983';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1966', '1', '5', '1', '1160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 14:20:11','0','0'); -- id=15961
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6899;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('720','02329', '1160', '28', '2329', '5', '740', '3700', '0', '', '0', '2026-10-21 14:20:11', '2329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6899-5,','1','1','0','0','740','3700','0','','0','0.00','0','0','0','0'); -- id=4760
UPDATE sellbilldetail SET  lastbuyprice = 720.00 , meanbuyprice = 720.00, lastbuyprice_withDiscount = 720.00, meanbuyprice_withDiscount = 720.00
        , lastbuyprice_withTax = 720, meanbuyprice_withTax = 720, lastbuyprice_withDiscountAndTax = 720
                where sellbilldetailid = 4760;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2329, '2026-10-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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+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-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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 = '5', userid = '2', storedetaildate = '2026-10-21 14:20:11' WHERE storedetailid = '3723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2329', '1', '5', '1', '1160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 14:20:11','0','0'); -- id=15962
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','i0001969', '1160', '28', '1969', '5', '550', '2750', '0', '', '0', '2026-10-21 14:20:11', '1969', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','2750','0','','0','0.00','0','0','0','0'); -- id=4761
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 = 4761;
 INSERT INTO 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-21', 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-21', 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 = '2', storedetaildate = '2026-10-21 14:20:11' WHERE storedetailid = '2986';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1969', '1', '5', '1', '1160', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 14:20:11','0','0'); -- id=15963
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7173728.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 ('7157728.5','16000', '0', '2', 'اضافة فاتورة مبيعات', '1160', '7173728.5', '2026-10-21 14:20:11', '2',  'sellbillController.php','1','','0'); -- id=1437
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '16000', '16000', '2026-10-21', '2', '0', '0', '2026-10-21 14:20:11','اضافة فاتورة مبيعات رقم 1160','1','0',null,'0','1160','sellbillController.php?do=showDetail&sellbillid=1160'); -- id=4127
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4127', '419', '16000', '','0'); -- id=4236
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7173728', 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 ('4127', '143', '16000', '','0'); -- id=4129
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13153600', 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 ( '15500', '15500', '2026-10-21', '2', '0', '0', '2026-10-21 14:20:11','اضافة فاتورة مبيعات رقم 1160 - صرف البضاعة من المخزن','1','0',null,'0','1160','sellbillController.php?do=showDetail&sellbillid=1160'); -- id=4128
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4128', '402', '15500', '','0'); -- id=4237
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12168129.31', 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 ('4128', '382', '15500', '','0'); -- id=4130
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24852911.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='4127,0,4128' where sellbillid=1160;
 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-21', 16000, 15500, 15500
                    , 15500, 15500, 15500, 15500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,15500, 15500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16000, sellCostBuyPrice =sellCostBuyPrice+15500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15500
                        , returnSellVal = returnSellVal+0, 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-21', 16000, 15500, 15500
                    , 15500, 15500, 15500, 15500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,15500, 15500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16000, sellCostBuyPrice =sellCostBuyPrice+15500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15500
                        , returnSellVal = returnSellVal+0, 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, 16000, 15500, 15500
                    , 15500, 15500, 15500, 15500, 15500, 15500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+16000, netSellCostBuyPrice = netSellCostBuyPrice+15500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+15500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+15500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+15500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+15500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+15500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+15500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+15500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad89cedadbb3 and sellbillId = 1160 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:50:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:20:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:20:11', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16384
UPDATE product SET productName = 'موديلات 520 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '505.00',meanbuyprice_withDiscount = '505' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='505',meanbuyprice_withTax='505',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1959';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1959, 1,'2026-10-21 14:20:23',7)
                ON DUPLICATE KEY UPDATE productid = 1959, edited = 1, sysdate = '2026-10-21 14:20:23', userid = 7; -- id=2900
UPDATE product SET productName = 'موديل 1030 برو', productDescription = '', productCatId = '158', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02333',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='440',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 = '2333';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2333, 1,'2026-10-21 14:20:24',7)
                ON DUPLICATE KEY UPDATE productid = 2333, edited = 1, sysdate = '2026-10-21 14:20:24', userid = 7; -- id=3437
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:51:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:21:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:21:24', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16385
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 ('06ad89ef66b446', '2026-10-21 14:16:06', '137', '107160.00', '200080', '8', '1', '101000.00',  '92920.00', '0', '92920', '1', '2026-10-21 14:21:24', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=288
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 ('01957', '288', '158', '1957', '16', '660', '10560.00', '0', '', '2026-10-21 14:21:24', '1957','','','0','0','0','0','0',null,'660','10560','0','0','0','0','0','0','0','0','1'); -- id=1610
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 1957, 0, 0
                    , 607.2, 16, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 607.2,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6903
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1957', '660', '16', '0', 'buyBillController.php', '1610', '', '0', '0'); -- id=1184
UPDATE product SET  productBuyPrice = "660" WHERE productId = 1957 ;
UPDATE buybilldetail SET  quantitybefore = 20 WHERE buybilldetailid = 1610 ;
UPDATE product SET productName = 'موديلات 660 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '607.2',meanbuyprice = '651.67',meanbuyprice_withDiscount = '628.2' , productbuypricereal = '630.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='630',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='660',meanbuyprice_withTax='651.67',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='607.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 = '1957';
UPDATE buybilldetail SET  lastbuyprice = 660 , meanbuyprice = 651.67, lastbuyprice_withDiscount = 607.2, meanbuyprice_withDiscount = 628.2
        , lastbuyprice_withTax = 660, meanbuyprice_withTax = 651.67, lastbuyprice_withDiscountAndTax = 607.2
                where buybilldetailid = 1610;
UPDATE productunit SET proUnitBuyPrice  = 660 * productnumber WHERE productid = 1957;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2974';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1957', '1', '16', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '20', '36', '7', '2026-10-21 14:16:06','0','0'); -- id=15964
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 ('02333', '288', '158', '2333', '16', '440', '7040.00', '0', '', '2026-10-21 14:21:24', '2333','','','0','0','0','0','0',null,'440','7040','0','0','0','0','0','0','0','0','1'); -- id=1611
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 2333, 0, 0
                    , 404.8, 16, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 404.8,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6904
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2333', '440', '16', '0', 'buyBillController.php', '1611', '', '0', '0'); -- id=1185
UPDATE product SET  productBuyPrice = "440" WHERE productId = 2333 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1611 ;
UPDATE product SET productName = 'موديل 1030 برو', productDescription = '', productCatId = '158', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02333',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '404.8',meanbuyprice = '440',meanbuyprice_withDiscount = '404.8' , 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='440',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='404.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 = '2333';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 404.8, meanbuyprice_withDiscount = 404.8
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 404.8
                where buybilldetailid = 1611;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 2333;
UPDATE storedetail SET  productquantity = '16', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3727';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2333', '1', '16', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '16', '7', '2026-10-21 14:16:06','0','0'); -- id=15965
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 ('01953', '288', '158', '1953', '28', '550', '15400.00', '0', '', '2026-10-21 14:21:24', '1953','','','0','0','0','0','0',null,'550','15400','0','0','0','0','0','0','0','0','1'); -- id=1612
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 1953, 0, 0
                    , 506, 28, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 506,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6905
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1953', '550', '28', '0', 'buyBillController.php', '1612', '', '0', '0'); -- id=1186
UPDATE product SET  productBuyPrice = "550" WHERE productId = 1953 ;
UPDATE buybilldetail SET  quantitybefore = 42 WHERE buybilldetailid = 1612 ;
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '506',meanbuyprice = '541',meanbuyprice_withDiscount = '523.4' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',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='550',meanbuyprice_withTax='541',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1953';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 541, lastbuyprice_withDiscount = 506, meanbuyprice_withDiscount = 523.4
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 541, lastbuyprice_withDiscountAndTax = 506
                where buybilldetailid = 1612;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1953;
UPDATE storedetail SET  productquantity = '70', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2970';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1953', '1', '28', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '42', '70', '7', '2026-10-21 14:16:06','0','0'); -- id=15966
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 ('02334', '288', '158', '2334', '28', '560', '15680.00', '0', '', '2026-10-21 14:21:24', '2334','','','0','0','0','0','0',null,'560','15680','0','0','0','0','0','0','0','0','1'); -- id=1613
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 2334, 0, 0
                    , 515.2, 28, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6906
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2334', '560', '28', '0', 'buyBillController.php', '1613', '', '0', '0'); -- id=1187
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2334 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1613 ;
UPDATE product SET productName = 'موديل 1032 برو', productDescription = '', productCatId = '158', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.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 = '2334';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1613;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2334;
UPDATE storedetail SET  productquantity = '28', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3728';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2334', '1', '28', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '7', '2026-10-21 14:16:06','0','0'); -- id=15967
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 ('01954', '288', '158', '1954', '16', '650', '10400.00', '0', '', '2026-10-21 14:21:24', '1954','','','0','0','0','0','0',null,'650','10400','0','0','0','0','0','0','0','0','1'); -- id=1614
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 1954, 0, 0
                    , 598, 16, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 598,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6907
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1954', '650', '16', '0', 'buyBillController.php', '1614', '', '0', '0'); -- id=1188
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1954 ;
UPDATE buybilldetail SET  quantitybefore = 36 WHERE buybilldetailid = 1614 ;
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '598',meanbuyprice = '639.62',meanbuyprice_withDiscount = '623.62' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',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='650',meanbuyprice_withTax='639.62',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='598',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1954';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 639.62, lastbuyprice_withDiscount = 598, meanbuyprice_withDiscount = 623.62
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 639.62, lastbuyprice_withDiscountAndTax = 598
                where buybilldetailid = 1614;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '52', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '16', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '36', '52', '7', '2026-10-21 14:16:06','0','0'); -- id=15968
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 ('02335', '288', '158', '2335', '16', '670', '10720.00', '0', '', '2026-10-21 14:21:24', '2335','','','0','0','0','0','0',null,'670','10720','0','0','0','0','0','0','0','0','1'); -- id=1615
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 2335, 0, 0
                    , 616.4, 16, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 616.4,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6908
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2335', '670', '16', '0', 'buyBillController.php', '1615', '', '0', '0'); -- id=1189
UPDATE product SET  productBuyPrice = "670" WHERE productId = 2335 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1615 ;
UPDATE product SET productName = 'موديل 670 برو', productDescription = '', productCatId = '158', productBuyPrice = '670.00', productSellAllPrice = '670.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '616.4',meanbuyprice = '670',meanbuyprice_withDiscount = '616.4' , productbuypricereal = '670.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='670',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='670',meanbuyprice_withTax='670',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='616.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 = '2335';
UPDATE buybilldetail SET  lastbuyprice = 670 , meanbuyprice = 670, lastbuyprice_withDiscount = 616.4, meanbuyprice_withDiscount = 616.4
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 616.4
                where buybilldetailid = 1615;
UPDATE productunit SET proUnitBuyPrice  = 670 * productnumber WHERE productid = 2335;
UPDATE storedetail SET  productquantity = '16', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3729';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2335', '1', '16', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '16', '7', '2026-10-21 14:16:06','0','0'); -- id=15969
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 ('01959', '288', '158', '1959', '28', '520', '14560.00', '0', '', '2026-10-21 14:21:24', '1959','','','0','0','0','0','0',null,'520','14560','0','0','0','0','0','0','0','0','1'); -- id=1616
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 1959, 0, 0
                    , 478.4, 28, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 478.4,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6909
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1959', '520', '28', '0', 'buyBillController.php', '1616', '', '0', '0'); -- id=1190
UPDATE product SET  productBuyPrice = "520" WHERE productId = 1959 ;
UPDATE buybilldetail SET  quantitybefore = 8 WHERE buybilldetailid = 1616 ;
UPDATE product SET productName = 'موديلات 520 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '478.4',meanbuyprice = '516.67',meanbuyprice_withDiscount = '484.31' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='520',meanbuyprice_withTax='516.67',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='478.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 = '1959';
UPDATE buybilldetail SET  lastbuyprice = 520 , meanbuyprice = 516.67, lastbuyprice_withDiscount = 478.4, meanbuyprice_withDiscount = 484.31
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 516.67, lastbuyprice_withDiscountAndTax = 478.4
                where buybilldetailid = 1616;
UPDATE productunit SET proUnitBuyPrice  = 520 * productnumber WHERE productid = 1959;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1959', '1', '28', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '8', '36', '7', '2026-10-21 14:16:06','0','0'); -- id=15970
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 ('01959', '288', '158', '1959', '32', '520', '16640.00', '0', '', '2026-10-21 14:21:24', '1959','','','0','0','0','0','0',null,'520','16640','0','0','0','0','0','0','0','0','1'); -- id=1617
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:16:06', 1, 1959, 0, 0
                    , 478.4, 32, 0, 0, 7, '2026-10-21 14:21:24')
                ON DUPLICATE KEY UPDATE buyprice = 478.4,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:21:24' ; -- id=6909
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1959', '520', '32', '0', 'buyBillController.php', '1617', '', '0', '0'); -- id=1191
UPDATE product SET  productBuyPrice = "520" WHERE productId = 1959 ;
UPDATE buybilldetail SET  quantitybefore = 36 WHERE buybilldetailid = 1617 ;
UPDATE product SET productName = 'موديلات 520 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '478.4',meanbuyprice = '519.33',meanbuyprice_withDiscount = '479.58' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='520',meanbuyprice_withTax='519.33',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='478.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 = '1959';
UPDATE buybilldetail SET  lastbuyprice = 520 , meanbuyprice = 519.33, lastbuyprice_withDiscount = 478.4, meanbuyprice_withDiscount = 479.58
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 519.33, lastbuyprice_withDiscountAndTax = 478.4
                where buybilldetailid = 1617;
UPDATE productunit SET proUnitBuyPrice  = 520 * productnumber WHERE productid = 1959;
UPDATE storedetail SET  productquantity = '68', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '2976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1959', '1', '32', '0', '288', 'اضافة فاتورة مشتريات', 'buyBillController.php', '36', '68', '7', '2026-10-21 14:16:06','0','0'); -- id=15971
UPDATE supplier SET  suppliercurrentDebt = '200080',suppliercurrentDebtInCurrency= '200080' , userid = '7', supplierdate = '2026-10-21 14:21:24'   WHERE supplierid = '137';
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 ('137', '107160.00', '92920', '0', 'اضافة فاتورة مشتريات', '288', '200080', '2026-10-21 14:16:06', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','92920','1','107160','92920','200080','0',''); -- id=802
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '92920', '92920', '2026-10-21', '7', '0', '0', '2026-10-21 14:21:24','اضافة فاتورة مشتريات رقم 288','1','0',null,'0','288','buyBillController.php?do=details&id=288'); -- id=4129
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4129', '382', '92920', '','0'); -- id=4238
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24945831.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 ('4129', '620', '92920', '','0'); -- id=4131
UPDATE accountstree SET name = 'برو', customName = 'برو', customNameEn = 'برو', nameEn = 'برو', parent = '81', accountNature = '1', theValue = '200080', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:09:52' WHERE id = '620';
update buybill set dailyentryid='4129,0' where buybillid=288;
COMMIT;
UPDATE product SET overAllAveragePrice = 515.1 WHERE productId = 1953;UPDATE product SET overAllAveragePrice = 615.11 WHERE productId = 1954;UPDATE product SET overAllAveragePrice = 619.87 WHERE productId = 1957;UPDATE product SET overAllAveragePrice = 480.84 WHERE productId = 1959;UPDATE product SET overAllAveragePrice = 404.8 WHERE productId = 2333;UPDATE product SET overAllAveragePrice = 515.2 WHERE productId = 2334;UPDATE product SET overAllAveragePrice = 616.4 WHERE productId = 2335;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:51:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:21:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:21:24', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=288'); -- id=16386
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:51:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:21:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:21:29', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=288&type=2'); -- id=16387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:52:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:22:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:22:06', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16388
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:52:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:22:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:22:12', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16389
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:52:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:22:13", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:22:13', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16390
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:52:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:22:51", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:22:51', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16391

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a065ecafb
-- ----------------------------------------------------------------------------------------------------

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-21 14:22:51', '06ad8a065ecafb', '1', '0.00', '0', '0', '1', '1800', '1800', '-1800', '0', '1', '2026-10-21 14:22:51', '', '6', '0', 'نقدي','4', '0', '5', '0', 'نقدي', '3', '0', '', '','','','-1','0','0','0','','0','-1800','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=39
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','1','اضافة فاتورة مردوات مبيعات','39', '0', '2026-10-21 14:22:51', '6', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:22:51','0','0','',''); -- id=1384
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 ('570.00', '02228', '39', '194', '2228', '3', '600', '1800', '0', '', '0', '0', '2228', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','600','1800','0','','0'); -- id=57
UPDATE returnsellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where returnsellbilldetailid = 57;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2228, '2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1800, 1710, 1710, 1710
                    , 1710, 1710, 1710, 0, 3, 0, 0, 1710, 1710)
                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+1800, returnSellCostBuyPrice = returnSellCostBuyPrice+1710, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1710
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1710
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1710
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1710
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1710
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1710
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1800, 1710, 1710, 1710
                    , 1710, 1710, 1710, 0, 0, 1710, 1710)
                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+1800, returnSellCostBuyPrice = returnSellCostBuyPrice+1710, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1710
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1710
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1710
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1710
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1710
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1710;
UPDATE storedetail SET  productquantity = '18', userid = '6', storedetaildate = '2026-10-21 14:22:51' WHERE storedetailid = '3619';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2228', '1', '3', '0', '39', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '15', '18', '6', '2026-10-21 14:22:51','0','0'); -- id=15972
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1008645',  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 ('1010445','-1800', '1', '4', 'اضافة فاتورة مردوات مبيعات', '39', '1008645', '2026-10-21 14:22:51', '6',  'returnsellbillController.php','1','','0'); -- id=1438
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-21', '6', '0', '0', '2026-10-21 14:22:51','اضافة فاتورة مردود مبيعات رقم 39','1','0',null,'0','39','returnsellbillController.php?do=showDetail&returnsellbillid=39'); -- id=4130
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4130', '143', '1800', '','0'); -- id=4239
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13151800', 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 ('4130', '568', '1800', '','0'); -- id=4132
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1008645', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1710', '1710', '2026-10-21', '6', '0', '0', '2026-10-21 14:22:51','اضافة فاتورة مردود مبيعات رقم 39 - صرف البضاعة من المخزن','1','0',null,'0','39','returnsellbillController.php?do=showDetail&returnsellbillid=39'); -- id=4131
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4131', '382', '1710', '','0'); -- id=4240
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24947541.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 ('4131', '402', '1710', '','0'); -- id=4133
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12166419.31', 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='4130,0,4131' where returnsellbillid=39;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1800, 1710, 1710, 1710
                    , 1710, 1710, 1710 ,0, 0, 1710, 1710)
                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+1800, returnSellCostBuyPrice = returnSellCostBuyPrice+1710, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1710
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1710
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1710
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1710
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1710
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1710;
 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1800, 1710, 1710, 1710
                    , 1710, 1710, 1710 ,0, 0, 1710, 1710)
                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+1800, returnSellCostBuyPrice = returnSellCostBuyPrice+1710, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1710
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1710
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1710
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1710
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1710
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1710;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1800, -1710, -1710
                    , -1710, -1710, -1710, -1710, -1710, -1710)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1800, netSellCostBuyPrice = netSellCostBuyPrice+-1710
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-1710
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-1710
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-1710
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-1710
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-1710
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-1710
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-1710;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:52:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:22:52", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:22:52', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16392
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:53:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:23:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:23:07', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16393
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:56:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:26:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:26:47', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16394
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:56:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:26:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:26:57', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16395
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:59:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:29:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 14:29:05', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16396
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 10:59:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:29:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:29:33', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16397
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:06:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:36:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:36:07', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16398
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:06:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:36:26", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:36:26', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16399

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a3a7b6b0e
-- ----------------------------------------------------------------------------------------------------

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-21 14:36:26', '06ad8a3a7b6b0e', '1', '0.00', '0', '0', '1', '2975', '2975', '-2975', '0', '1', '2026-10-21 14:36:26', '', '6', '0', 'نقدي','4', '0', '5', '0', 'نقدي', '5', '0', '', '','','','-1','0','0','0','','0','-2975','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=40
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','1','اضافة فاتورة مردوات مبيعات','40', '0', '2026-10-21 14:36:26', '6', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '2975', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:36:26','0','0','',''); -- id=1385
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', '02088', '40', '175', '2088', '5', '595', '2975', '0', '', '0', '0', '2088', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','595','2975','0','','0'); -- id=58
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 58;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2975, 2300, 2300, 2300
                    , 2300, 2300, 2300, 0, 5, 0, 0, 2300, 2300)
                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+2975, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2300
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2300
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2300
                        , 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2975, 2300, 2300, 2300
                    , 2300, 2300, 2300, 0, 0, 2300, 2300)
                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+2975, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2300
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2300
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2300;
UPDATE storedetail SET  productquantity = '1111', userid = '6', storedetaildate = '2026-10-21 14:36:26' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '5', '0', '40', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '1106', '1111', '6', '2026-10-21 14:36:26','0','0'); -- id=15973
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1005670',  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 ('1008645','-2975', '1', '4', 'اضافة فاتورة مردوات مبيعات', '40', '1005670', '2026-10-21 14:36:26', '6',  'returnsellbillController.php','1','','0'); -- id=1439
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2975', '2975', '2026-10-21', '6', '0', '0', '2026-10-21 14:36:26','اضافة فاتورة مردود مبيعات رقم 40','1','0',null,'0','40','returnsellbillController.php?do=showDetail&returnsellbillid=40'); -- id=4132
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4132', '143', '2975', '','0'); -- id=4241
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13148825', 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 ('4132', '568', '2975', '','0'); -- id=4134
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1005670', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2300', '2300', '2026-10-21', '6', '0', '0', '2026-10-21 14:36:26','اضافة فاتورة مردود مبيعات رقم 40 - صرف البضاعة من المخزن','1','0',null,'0','40','returnsellbillController.php?do=showDetail&returnsellbillid=40'); -- id=4133
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4133', '382', '2300', '','0'); -- id=4242
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24949841.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 ('4133', '402', '2300', '','0'); -- id=4135
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12164119.31', 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='4132,0,4133' where returnsellbillid=40;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2975, 2300, 2300, 2300
                    , 2300, 2300, 2300 ,0, 0, 2300, 2300)
                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+2975, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2300
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2300
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2300;
 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2975, 2300, 2300, 2300
                    , 2300, 2300, 2300 ,0, 0, 2300, 2300)
                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+2975, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2300
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2300
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2300;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -2975, -2300, -2300
                    , -2300, -2300, -2300, -2300, -2300, -2300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-2975, netSellCostBuyPrice = netSellCostBuyPrice+-2300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-2300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-2300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-2300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-2300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-2300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-2300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-2300;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:06:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:36:26", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:36:26', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=16400
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:06:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:36:38", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:36:38', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16401
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:11:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:41:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:41:33', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16402
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:12:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:42:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:42:00', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16403
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:12:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:42:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:42:19', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:12:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:42:36", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:42:36', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16405
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:13:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:43:18", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:43:18', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16406
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:16:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:46:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 14:46:07', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16407
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:16:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:46:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:46:09', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16408
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:17:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:47:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:47:56', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16409
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:48:04', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16410
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:48:40', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16411
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 ('بوكس فيت 460 باور ماكس','','115','460','460','0','0','2026-10-21','0','7','0','','0','0','0','0','0','460','460','460','460','460','0','0','0','0','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=2336
UPDATE product SET productName = 'بوكس فيت 460 باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '460', productSellAllPrice = '460', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='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 = '2336';
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', '2336', '1.00', '2026-10-21', '7', '0','0233601','460','0','0','460','','0','0','0','0','0','0','0','0','0','0'); -- id=2336
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2336', '1', '0', '7', '2026-10-21'); -- id=3730
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2336', '1', '0', '0', '2336', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15974
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2336, 1,'2026-10-21 14:48:40',7)
                ON DUPLICATE KEY UPDATE productid = 2336, edited = 1, sysdate = '2026-10-21 14:48:40', userid = 7; -- id=3449
UPDATE product SET productName = 'بوكس فيت 460 باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='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 = '2336';
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 ('اوفر قصات باور ماكس','','115','455','455','0','0','2026-10-21','0','7','0','','0','0','0','0','0','455','455','455','455','455','0','0','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','1','0','0','0','0','0','0','','455','0','0','0','0','0','0','','','0','0','0','0'); -- id=2337
UPDATE product SET productName = 'اوفر قصات باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '455', productSellAllPrice = '455', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02337',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 = '0' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2337';
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', '2337', '1.00', '2026-10-21', '7', '0','0233701','455','0','0','455','','0','0','0','0','0','0','0','0','0','0'); -- id=2337
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2337', '1', '0', '7', '2026-10-21'); -- id=3731
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2337', '1', '0', '0', '2337', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15975
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2337, 1,'2026-10-21 14:48:40',7)
                ON DUPLICATE KEY UPDATE productid = 2337, edited = 1, sysdate = '2026-10-21 14:48:40', userid = 7; -- id=3450
UPDATE product SET productName = 'اوفر قصات باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '455.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02337',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 = '0' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2337';
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 ('اوفر سايز باور ماكس','','115','360','360','0','0','2026-10-21','0','7','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=2338
UPDATE product SET productName = 'اوفر سايز باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02338',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 = '2338';
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', '2338', '1.00', '2026-10-21', '7', '0','0233801','360','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2338
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2338', '1', '0', '7', '2026-10-21'); -- id=3732
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2338', '1', '0', '0', '2338', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=15976
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2338, 1,'2026-10-21 14:48:40',7)
                ON DUPLICATE KEY UPDATE productid = 2338, edited = 1, sysdate = '2026-10-21 14:48:40', userid = 7; -- id=3451
UPDATE product SET productName = 'اوفر سايز باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02338',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 = '2338';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:42", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:48:42', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16412
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:48:43', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16413
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:48:43', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16414
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:18:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:48:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:48:49', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16415
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:19:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:49:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:49:20', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=251'); -- id=16416
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:19:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:49:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:49:26', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16417
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:19:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:49:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:49:29', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=249'); -- id=16418
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:19:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:49:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:49:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16419
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:19:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:49:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:49:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16420
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:50:06', '1', 'delete', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=delete&id=249'); -- id=16421
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 249;
update productserial set del= 1 WHERE billid = 249
		and type =0 
		;
UPDATE buybill SET  buybillsysdate = '2026-10-21 14:50:06', userid = '5',delbyuserid = '1', conditions = '1' WHERE buybillid = '249';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 16:21:12', 1, 879, 0, 0
                    , 317.4, 75, 0, 0, 1, '2026-10-21 14:50:06')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-75, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 14:50:06' ; -- id=6643
UPDATE buybilldetail SET  lastbuyprice = 345.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 317.40, meanbuyprice_withDiscount = 318.80
        , lastbuyprice_withTax = 345.00, meanbuyprice_withTax = 345.00, lastbuyprice_withDiscountAndTax = 317.40
                where buybilldetailid = 1420;
UPDATE product SET productName = 'نيو سكاي تقطيع رجالي', productDescription = '', productCatId = '24', productBuyPrice = '345.00', productSellAllPrice = '365.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08528',type ='0', expireDate = '0' , dailyentryId = '234',isService = '0',isOptic = '0',lastbuyprice = '345',lastbuyprice_withDiscount = '0',meanbuyprice = '345',meanbuyprice_withDiscount = '345.05' , productbuypricereal = '345.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='317.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8528',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='345',meanbuyprice_withTax='345',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='0',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 = '879';
UPDATE productunit SET proUnitBuyPrice  = 345 * productnumber WHERE productid = 879;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('879', '1', '75', '1', '249', 'حذف فاتورة مشتريات', 'buyBillController.php', '79', '4', '1', '2026-10-21','0','0'); -- id=15977
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 16:21:12', 1, 1826, 0, 0
                    , 345, 76, 0, 0, 1, '2026-10-21 14:50:06')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-76, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 14:50:06' ; -- id=6644
UPDATE product SET productName = 'وايت لج ساده زاي وان', productDescription = '', productCatId = '24', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '375.00', productSellHalfPrice = '375.00', productDate = '2026-10-10', conditions = '0', userId = '1', limitamount = '0', parcode = '01826',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375',lastbuyprice_withDiscount = '345',meanbuyprice = '375',meanbuyprice_withDiscount = '345' , productbuypricereal = '375.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='345',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='375',meanbuyprice_withTax='375',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 = '1826';
UPDATE productunit SET proUnitBuyPrice  = 375 * productnumber WHERE productid = 1826;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1826', '1', '76', '1', '249', 'حذف فاتورة مشتريات', 'buyBillController.php', '92', '16', '1', '2026-10-21','0','0'); -- id=15978
UPDATE supplier SET  suppliercurrentDebt = '572543',suppliercurrentDebtInCurrency= '572543' , userid = '1', supplierdate = '2026-10-21 14:50:06'   WHERE supplierid = '58';
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 ('58', '622568.00', '50025.00', '1', 'حذف فاتورة مشتريات', '249', '572543', '2026-10-21 14:50:06', '1', 'buyBillController.php', 'حذف فاتورة مشتريات', '0','', '0','1','1','50025','1','622568','50025','572543','0',''); -- id=803
UPDATE product SET overAllAveragePrice = 345 WHERE productId = 1826;;
UPDATE dailyentry SET totalcreditor = '50025.00', totaldebtor = '50025.00', thedate = '2026-10-19', userid = '5', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 16:23:12', entryComment = 'اضافة فاتورة مشتريات رقم 249', fromFlag = '1',related='0',isopeningentry='0',operationId='249',operationDetailLink='buyBillController.php?do=details&id=249' WHERE id = '3789';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50025.00', '50025.00', '2026-10-21', '1', '0', '3789', '2026-10-21 14:50:06','تم عكس القيد رقم 3789 ','1','0','0','0','0',''); -- id=4134
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4134', '382', '50025.00', '','0'); -- id=4136
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24899816.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4134', '477', '50025.00', '','0'); -- id=4243
UPDATE accountstree SET name = 'زاي وان - مورد', customName = 'زاي وان - مورد', customNameEn = 'زاي وان - مورد', nameEn = 'زاي وان - مورد', parent = '81', accountNature = '1', theValue = '67175', 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 = '477';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:50:07', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=sucess'); -- id=16422
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:50:08', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16423
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:50:22', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16424
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:50:28', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16425
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:50:39', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16426
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:20:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:50:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:50:48', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16427
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:21:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:51:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:51:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16428
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:21:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:51:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:51:20', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16429
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:21:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:51:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:51:31', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16430
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:21:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:51:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:51:40', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16431
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:52:03', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16432
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 ('06ad8a69bd79bd', '2026-10-21 14:48:43', '111', '101641.90', '153171.1', '8', '1', '56010.00',  '51529.20', '0', '51529.2', '1', '2026-10-21 14:52:03', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=289
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 ('01584', '289', '115', '1584', '39', '400', '15600.00', '0', '', '2026-10-21 14:52:03', '1584','','','0','0','0','0','0',null,'400','15600','0','0','0','0','0','0','0','0','1'); -- id=1618
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:48:43', 1, 1584, 0, 0
                    , 368, 39, 0, 0, 7, '2026-10-21 14:52:03')
                ON DUPLICATE KEY UPDATE buyprice = 368,
                        buyQuantity =buyQuantity+39, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:52:03' ; -- id=6913
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1584', '400', '39', '0', 'buyBillController.php', '1618', '', '0', '0'); -- id=1192
UPDATE product SET  productBuyPrice = "400" WHERE productId = 1584 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1618 ;
UPDATE product SET productName = 'اوفر سايز دبل باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01584',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '368',meanbuyprice = '400',meanbuyprice_withDiscount = '368' , 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='372',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='368',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1584';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 368, meanbuyprice_withDiscount = 368
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 368
                where buybilldetailid = 1618;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1584;
UPDATE storedetail SET  productquantity = '39', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '1609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1584', '1', '39', '0', '289', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '39', '7', '2026-10-21 14:48:43','0','0'); -- id=15979
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 ('02336', '289', '115', '2336', '30', '460', '13800.00', '0', '', '2026-10-21 14:52:03', '2336','','','0','0','0','0','0',null,'460','13800','0','0','0','0','0','0','0','0','1'); -- id=1619
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:48:43', 1, 2336, 0, 0
                    , 423.2, 30, 0, 0, 7, '2026-10-21 14:52:03')
                ON DUPLICATE KEY UPDATE buyprice = 423.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:52:03' ; -- id=6914
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2336', '460', '30', '0', 'buyBillController.php', '1619', '', '0', '0'); -- id=1193
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2336 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1619 ;
UPDATE product SET productName = 'بوكس فيت 460 باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '423.2',meanbuyprice = '460',meanbuyprice_withDiscount = '423.2' , productbuypricereal = '460.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='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='423.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 = '2336';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 423.2, meanbuyprice_withDiscount = 423.2
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where buybilldetailid = 1619;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2336;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3730';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2336', '1', '30', '0', '289', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 14:48:43','0','0'); -- id=15980
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 ('02337', '289', '115', '2337', '30', '455', '13650.00', '0', '', '2026-10-21 14:52:03', '2337','','','0','0','0','0','0',null,'455','13650','0','0','0','0','0','0','0','0','1'); -- id=1620
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:48:43', 1, 2337, 0, 0
                    , 418.6, 30, 0, 0, 7, '2026-10-21 14:52:03')
                ON DUPLICATE KEY UPDATE buyprice = 418.6,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:52:03' ; -- id=6915
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2337', '455', '30', '0', 'buyBillController.php', '1620', '', '0', '0'); -- id=1194
UPDATE product SET  productBuyPrice = "455" WHERE productId = 2337 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1620 ;
UPDATE product SET productName = 'اوفر قصات باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '455.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02337',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '418.6',meanbuyprice = '455',meanbuyprice_withDiscount = '418.6' , productbuypricereal = '455.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='418.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 = '2337';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 455, lastbuyprice_withDiscount = 418.6, meanbuyprice_withDiscount = 418.6
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 455, lastbuyprice_withDiscountAndTax = 418.6
                where buybilldetailid = 1620;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 2337;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3731';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2337', '1', '30', '0', '289', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 14:48:43','0','0'); -- id=15981
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 ('02338', '289', '115', '2338', '36', '360', '12960.00', '0', '', '2026-10-21 14:52:03', '2338','','','0','0','0','0','0',null,'360','12960','0','0','0','0','0','0','0','0','1'); -- id=1621
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 14:48:43', 1, 2338, 0, 0
                    , 331.2, 36, 0, 0, 7, '2026-10-21 14:52:03')
                ON DUPLICATE KEY UPDATE buyprice = 331.2,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 14:52:03' ; -- id=6916
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2338', '360', '36', '0', 'buyBillController.php', '1621', '', '0', '0'); -- id=1195
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2338 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1621 ;
UPDATE product SET productName = 'اوفر سايز باور ماكس', productDescription = '', productCatId = '115', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02338',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 = '2338';
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 = 1621;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2338;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3732';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2338', '1', '36', '0', '289', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 14:48:43','0','0'); -- id=15982
UPDATE supplier SET  suppliercurrentDebt = '153171.1',suppliercurrentDebtInCurrency= '153171.1' , userid = '7', supplierdate = '2026-10-21 14:52:03'   WHERE supplierid = '111';
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 ('111', '101641.90', '51529.2', '0', 'اضافة فاتورة مشتريات', '289', '153171.1', '2026-10-21 14:48:43', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','51529.2','1','101641.9','51529.2','153171.1','0',''); -- id=804
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51529.2', '51529.2', '2026-10-21', '7', '0', '0', '2026-10-21 14:52:03','اضافة فاتورة مشتريات رقم 289','1','0',null,'0','289','buyBillController.php?do=details&id=289'); -- id=4135
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4135', '382', '51529.2', '','0'); -- id=4244
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24951346.19', 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 ('4135', '594', '51529.2', '','0'); -- id=4137
UPDATE accountstree SET name = 'باور ماكس', customName = 'باور ماكس', customNameEn = 'باور ماكس', nameEn = 'باور ماكس', parent = '81', accountNature = '1', theValue = '153171.1', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-07 16:56:48' WHERE id = '594';
update buybill set dailyentryid='4135,0' where buybillid=289;
COMMIT;
UPDATE product SET overAllAveragePrice = 371.39 WHERE productId = 1584;UPDATE product SET overAllAveragePrice = 423.2 WHERE productId = 2336;UPDATE product SET overAllAveragePrice = 418.6 WHERE productId = 2337;UPDATE product SET overAllAveragePrice = 331.2 WHERE productId = 2338;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 14:52:03', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=289'); -- id=16433
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:10", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:52:10', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=289&type=2'); -- id=16434
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:52:27', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16435
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:52:33', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16436
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:22:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:52:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:52:52', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16437
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:23:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:53:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 14:53:01', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16438
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-21 11:23:01";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 14:53:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 14:53:01', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16439
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:23:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:53:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:53:02', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16440
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:23:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:53:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:53:04', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16441
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:23:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:53:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:53:22', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16442

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a21d3a41d
-- ----------------------------------------------------------------------------------------------------

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-21 14:53:22', '06ad8a21d3a41d', '1', '0.00', '0', '0', '1', '3400.00', '3400', '3400', '0', '1', '2026-10-21 14:53:22', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','3400','0','','0','0','3400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1161
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','اضافة فاتورة مبيعات','1161', '0', '2026-10-21 14:53:22', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 14:53:22','0','0','',''); -- id=1386
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6877;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('652','02323', '1161', '8', '2323', '5', '680', '3400', '0', '', '0', '2026-10-21 14:53:22', '2323', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6877-5,','1','1','0','0','680','3400','0','','0','0.00','0','0','0','0'); -- id=4762
UPDATE sellbilldetail SET  lastbuyprice = 652.00 , meanbuyprice = 652.00, lastbuyprice_withDiscount = 652.00, meanbuyprice_withDiscount = 652.00
        , lastbuyprice_withTax = 652, meanbuyprice_withTax = 652, lastbuyprice_withDiscountAndTax = 652
                where sellbilldetailid = 4762;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2323, '2026-10-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 14:53:22' WHERE storedetailid = '3717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '5', '1', '1161', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 14:53:22','0','0'); -- id=15983
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7177128.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 ('7173728.5','3400', '0', '2', 'اضافة فاتورة مبيعات', '1161', '7177128.5', '2026-10-21 14:53:22', '2',  'sellbillController.php','1','','0'); -- id=1440
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3400', '3400', '2026-10-21', '2', '0', '0', '2026-10-21 14:53:22','اضافة فاتورة مبيعات رقم 1161','1','0',null,'0','1161','sellbillController.php?do=showDetail&sellbillid=1161'); -- id=4136
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4136', '419', '3400', '','0'); -- id=4245
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7177128', 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 ('4136', '143', '3400', '','0'); -- id=4138
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13152225', 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 ( '3260', '3260', '2026-10-21', '2', '0', '0', '2026-10-21 14:53:22','اضافة فاتورة مبيعات رقم 1161 - صرف البضاعة من المخزن','1','0',null,'0','1161','sellbillController.php?do=showDetail&sellbillid=1161'); -- id=4137
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4137', '402', '3260', '','0'); -- id=4246
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12167379.31', 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 ('4137', '382', '3260', '','0'); -- id=4139
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24948086.19', 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='4136,0,4137' where sellbillid=1161;
 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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, 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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, 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, 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260, 3260, 3260)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3400, netSellCostBuyPrice = netSellCostBuyPrice+3260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3260
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3260
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3260;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8a21d3a41d and sellbillId = 1161 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:23:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:53:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 14:53:22', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16443
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:24:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:54:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:54:19', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16444
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:24:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:54:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 14:54:24', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16445
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:27:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:57:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:57:51', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16446
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:28:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:58:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 14:58:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16447
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:29:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 14:59:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 14:59:25', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16448
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:30:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:00:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:00:14', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16449
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:30:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:00:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:00:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16450
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:30:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:00:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:00:31', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=144'); -- id=16451
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:02:09', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16452
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 144;
UPDATE buybill SET  buybillsysdate = '2026-10-21 15:02:09', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '144';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1949, 0, 0
                    , 480, 12, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1138
UPDATE buybilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 495.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 495.00, meanbuyprice_withTax = 495.00, lastbuyprice_withDiscountAndTax = 480.00
                where buybilldetailid = 861;
UPDATE product SET productName = 'كود 1002 برو', productDescription = '', productCatId = '158', productBuyPrice = '510.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01949',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '0',meanbuyprice = '510.00',meanbuyprice_withDiscount = '510' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',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='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 = '1949';
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 1949;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2966';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1949', '1', '12', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '12', '0', '1', '2026-10-14 13:20:59','0','0'); -- id=15984
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1950, 0, 0
                    , 500, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1139
UPDATE buybilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 515.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 515.00
        , lastbuyprice_withTax = 515.00, meanbuyprice_withTax = 515.00, lastbuyprice_withDiscountAndTax = 500.00
                where buybilldetailid = 862;
UPDATE product SET productName = 'كود 1005 برو', productDescription = '', productCatId = '158', productBuyPrice = '530.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01950',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '0',meanbuyprice = '530.00',meanbuyprice_withDiscount = '530' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',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 = '1950';
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 1950;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2967';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1950', '1', '24', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-14 13:20:59','0','0'); -- id=15985
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1951, 0, 0
                    , 450, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1140
UPDATE buybilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 465.00
        , lastbuyprice_withTax = 465.00, meanbuyprice_withTax = 465.00, lastbuyprice_withDiscountAndTax = 450.00
                where buybilldetailid = 863;
UPDATE product SET productName = 'كود 1015 برو', productDescription = '', productCatId = '158', productBuyPrice = '480.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01951',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '0',meanbuyprice = '446.25',meanbuyprice_withDiscount = '446.25' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.67' , 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='446.25',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 = '1951';
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1951;
UPDATE storedetail SET  productquantity = '-16', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2968';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1951', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '4', '-16', '1', '2026-10-14 13:20:59','0','0'); -- id=15986
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1952, 0, 0
                    , 570, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1141
UPDATE buybilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 585.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 585.00
        , lastbuyprice_withTax = 585.00, meanbuyprice_withTax = 585.00, lastbuyprice_withDiscountAndTax = 570.00
                where buybilldetailid = 864;
UPDATE product SET productName = 'كود 1014 برو', productDescription = '', productCatId = '158', productBuyPrice = '600.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01952',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '0',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570.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='570',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='570',meanbuyprice_withTax='570',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 = '1952';
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 1952;
UPDATE storedetail SET  productquantity = '-20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2969';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1952', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '0', '-20', '1', '2026-10-14 13:20:59','0','0'); -- id=15987
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1953, 0, 0
                    , 520, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1142
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '549.4',meanbuyprice_withDiscount = '524.76' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515.1',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='550',meanbuyprice_withTax='549.4',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 = '1953';
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1953;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2970';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1953', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '70', '50', '1', '2026-10-14 13:20:59','0','0'); -- id=15988
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 620, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '651.88',meanbuyprice_withDiscount = '625.88' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='651.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='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 = '1954';
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '52', '32', '1', '2026-10-14 13:20:59','0','0'); -- id=15989
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 620, 16, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '666.05',meanbuyprice_withDiscount = '628.49' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='666.05',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 = '1954';
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '16', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '32', '16', '1', '2026-10-14 13:20:59','0','0'); -- id=15990
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 620, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '694.83',meanbuyprice_withDiscount = '633.8' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='694.83',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 = '1954';
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '16', '-4', '1', '2026-10-14 13:20:59','0','0'); -- id=15991
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1955, 0, 0
                    , 650, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1146
UPDATE buybilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 665.00, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 665.00
        , lastbuyprice_withTax = 665.00, meanbuyprice_withTax = 665.00, lastbuyprice_withDiscountAndTax = 650.00
                where buybilldetailid = 869;
UPDATE product SET productName = 'كود 1036 برو', productDescription = '', productCatId = '158', productBuyPrice = '680.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01955',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '0',meanbuyprice = '680.00',meanbuyprice_withDiscount = '680' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',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='650',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 = '1955';
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1955;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1955', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '0', '1', '2026-10-14 13:20:59','0','0'); -- id=15992
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1956, 0, 0
                    , 550, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1147
UPDATE buybilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 565.00
        , lastbuyprice_withTax = 565.00, meanbuyprice_withTax = 565.00, lastbuyprice_withDiscountAndTax = 550.00
                where buybilldetailid = 870;
UPDATE product SET productName = 'موديلات 580 برو', productDescription = '', productCatId = '158', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '0',meanbuyprice = '601',meanbuyprice_withDiscount = '601' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='601',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 = '1956';
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1956;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '24', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '34', '10', '1', '2026-10-14 13:20:59','0','0'); -- id=15993
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1956, 0, 0
                    , 550, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1147
UPDATE buybilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 601.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 601.00
        , lastbuyprice_withTax = 550.00, meanbuyprice_withTax = 601.00, lastbuyprice_withDiscountAndTax = 0.00
                where buybilldetailid = 871;
UPDATE product SET productName = 'موديلات 580 برو', productDescription = '', productCatId = '158', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '0',meanbuyprice = '723.4',meanbuyprice_withDiscount = '723.4' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='723.4',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 = '1956';
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1956;
UPDATE storedetail SET  productquantity = '-14', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '24', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '10', '-14', '1', '2026-10-14 13:20:59','0','0'); -- id=15994
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1957, 0, 0
                    , 630, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1149
UPDATE product SET productName = 'موديلات 660 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '660',meanbuyprice = '678.76',meanbuyprice_withDiscount = '625.95' , productbuypricereal = '630.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='619.87',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='660',meanbuyprice_withTax='678.76',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 = '1957';
UPDATE productunit SET proUnitBuyPrice  = 660 * productnumber WHERE productid = 1957;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2974';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1957', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '36', '16', '1', '2026-10-14 13:20:59','0','0'); -- id=15995
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1953, 0, 0
                    , 520, 32, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1142
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '574.16',meanbuyprice_withDiscount = '528.77' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515.1',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='550',meanbuyprice_withTax='574.16',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 = '1953';
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1953;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2970';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1953', '1', '32', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '50', '18', '1', '2026-10-14 13:20:59','0','0'); -- id=15996
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1958, 0, 0
                    , 470, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1151
UPDATE buybilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485.00, meanbuyprice_withTax = 485.00, lastbuyprice_withDiscountAndTax = 470.00
                where buybilldetailid = 874;
UPDATE product SET productName = 'كود 1031 برو', productDescription = '', productCatId = '158', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '0',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',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 = '1958';
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 1958;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2975';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1958', '1', '20', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '0', '1', '2026-10-14 13:20:59','0','0'); -- id=15997
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1959, 0, 0
                    , 490, 16, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1152
UPDATE product SET productName = 'موديلات 520 برو', productDescription = '', productCatId = '158', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01959',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '528.35',meanbuyprice_withDiscount = '476.37' , productbuypricereal = '490.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='480.84',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='520',meanbuyprice_withTax='528.35',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 = '1959';
UPDATE productunit SET proUnitBuyPrice  = 520 * productnumber WHERE productid = 1959;
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1959', '1', '16', '1', '144', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '68', '52', '1', '2026-10-14 13:20:59','0','0'); -- id=15998
UPDATE supplier SET  suppliercurrentDebt = '30920',suppliercurrentDebtInCurrency= '30920' , userid = '1', supplierdate = '2026-10-21 15:02:09'   WHERE supplierid = '137';
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 ('137', '200080.00', '169160.00', '1', 'حذف فاتورة مشتريات - للتعديل', '144', '30920', '2026-10-14 13:20:59', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','169160','1','200080','169160','30920','0',''); -- id=805
UPDATE productserial SET del = 1
		 WHERE billid = 144;
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 ('06acf578b5b9db', '2026-10-14 13:20:59', '137', '30920.00', '195048', '8', '1', '178400.00', '164128.00', '0.00', '164128', '1', '2026-10-21 15:02:09', '', '1', '0', '', '1', '1','1','144','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=290
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 ('01949', '290', '158', '1949', '12.00', '510', '6120.00', '0.00', '', '2026-10-21 15:02:09', '1949','','','0','0','0','0','0',null,'510','6120','0','0','0','0','0','0','0','0','1'); -- id=1622
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1949, 0, 0
                    , 469.2, 12, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 469.2,
                        buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1138
UPDATE product SET  productBuyPrice = "510" WHERE productId = 1949 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1622 ;
UPDATE product SET productName = 'كود 1002 برو', productDescription = '', productCatId = '158', productBuyPrice = '510.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01949',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '469.2',meanbuyprice = '510',meanbuyprice_withDiscount = '489.6' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',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='510',meanbuyprice_withTax='255',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='469.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 = '1949';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 469.2, meanbuyprice_withDiscount = 489.6
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 469.2
                where buybilldetailid = 1622;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 1949;
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2966';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1949', '1', '12', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '12', '1', '2026-10-14 13:20:59','0','0'); -- id=15999
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 ('01950', '290', '158', '1950', '24.00', '530', '12720.00', '0.00', '', '2026-10-21 15:02:09', '1950','','','0','0','0','0','0',null,'530','12720','0','0','0','0','0','0','0','0','1'); -- id=1623
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1950, 0, 0
                    , 487.6, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 487.6,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1139
UPDATE product SET  productBuyPrice = "530" WHERE productId = 1950 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1623 ;
UPDATE product SET productName = 'كود 1005 برو', productDescription = '', productCatId = '158', productBuyPrice = '530.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01950',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '487.6',meanbuyprice = '530',meanbuyprice_withDiscount = '508.8' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='530',meanbuyprice_withTax='265',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='487.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 = '1950';
UPDATE buybilldetail SET  lastbuyprice = 530 , meanbuyprice = 530, lastbuyprice_withDiscount = 487.6, meanbuyprice_withDiscount = 508.8
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 487.6
                where buybilldetailid = 1623;
UPDATE productunit SET proUnitBuyPrice  = 530 * productnumber WHERE productid = 1950;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2967';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1950', '1', '24', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-14 13:20:59','0','0'); -- id=16000
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 ('01951', '290', '158', '1951', '20.00', '480', '9600.00', '0.00', '', '2026-10-21 15:02:09', '1951','','','0','0','0','0','0',null,'480','9600','0','0','0','0','0','0','0','0','1'); -- id=1624
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1951, 0, 0
                    , 441.6, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 441.6,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1140
UPDATE product SET  productBuyPrice = "480" WHERE productId = 1951 ;
UPDATE buybilldetail SET  quantitybefore = -16 WHERE buybilldetailid = 1624 ;
UPDATE product SET productName = 'كود 1015 برو', productDescription = '', productCatId = '158', productBuyPrice = '480.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01951',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '441.6',meanbuyprice = '474.38',meanbuyprice_withDiscount = '442.38' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.67' , 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='480',meanbuyprice_withTax='474.38',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='441.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 = '1951';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 474.38, lastbuyprice_withDiscount = 441.6, meanbuyprice_withDiscount = 442.38
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 474.38, lastbuyprice_withDiscountAndTax = 441.6
                where buybilldetailid = 1624;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 1951;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2968';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1951', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-16', '4', '1', '2026-10-14 13:20:59','0','0'); -- id=16001
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 ('01952', '290', '158', '1952', '20.00', '600', '12000.00', '0.00', '', '2026-10-21 15:02:09', '1952','','','0','0','0','0','0',null,'600','12000','0','0','0','0','0','0','0','0','1'); -- id=1625
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1952, 0, 0
                    , 552, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 552,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1141
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1952 ;
UPDATE buybilldetail SET  quantitybefore = -20 WHERE buybilldetailid = 1625 ;
UPDATE product SET productName = 'كود 1014 برو', productDescription = '', productCatId = '158', productBuyPrice = '600.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01952',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '552',meanbuyprice = '600',meanbuyprice_withDiscount = '552' , productbuypricereal = '570.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='570',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='600',meanbuyprice_withTax='600',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='552',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1952';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 552, meanbuyprice_withDiscount = 552
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 552
                where buybilldetailid = 1625;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1952;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2969';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1952', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-20', '0', '1', '2026-10-14 13:20:59','0','0'); -- id=16002
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 ('01953', '290', '158', '1953', '20.00', '550', '11000.00', '0.00', '', '2026-10-21 15:02:09', '1953','','','0','0','0','0','0',null,'550','11000','0','0','0','0','0','0','0','0','1'); -- id=1626
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1953, 0, 0
                    , 506, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 506,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1142
UPDATE product SET  productBuyPrice = "550" WHERE productId = 1953 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 1626 ;
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '506',meanbuyprice = '568.79',meanbuyprice_withDiscount = '523.71' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515.1',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='550',meanbuyprice_withTax='568.79',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1953';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 568.79, lastbuyprice_withDiscount = 506, meanbuyprice_withDiscount = 523.71
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 568.79, lastbuyprice_withDiscountAndTax = 506
                where buybilldetailid = 1626;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1953;
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2970';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1953', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '38', '1', '2026-10-14 13:20:59','0','0'); -- id=16003
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 ('01954', '290', '158', '1954', '20.00', '650', '13000.00', '0.00', '', '2026-10-21 15:02:09', '1954','','','0','0','0','0','0',null,'650','13000','0','0','0','0','0','0','0','0','1'); -- id=1627
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 598, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 598,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1954 ;
UPDATE buybilldetail SET  quantitybefore = -4 WHERE buybilldetailid = 1627 ;
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '598',meanbuyprice = '682.38',meanbuyprice_withDiscount = '623.86' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='682.38',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='598',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1954';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 682.38, lastbuyprice_withDiscount = 598, meanbuyprice_withDiscount = 623.86
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 682.38, lastbuyprice_withDiscountAndTax = 598
                where buybilldetailid = 1627;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-4', '16', '1', '2026-10-14 13:20:59','0','0'); -- id=16004
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 ('01954', '290', '158', '1954', '16.00', '650', '10400.00', '0.00', '', '2026-10-21 15:02:09', '1954','','','0','0','0','0','0',null,'650','10400','0','0','0','0','0','0','0','0','1'); -- id=1628
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 598, 16, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 598,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1954 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 1628 ;
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '598',meanbuyprice = '674.76',meanbuyprice_withDiscount = '617.78' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='674.76',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='598',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1954';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 674.76, lastbuyprice_withDiscount = 598, meanbuyprice_withDiscount = 617.78
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 674.76, lastbuyprice_withDiscountAndTax = 598
                where buybilldetailid = 1628;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '16', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '32', '1', '2026-10-14 13:20:59','0','0'); -- id=16005
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 ('01954', '290', '158', '1954', '20.00', '650', '13000.00', '0.00', '', '2026-10-21 15:02:09', '1954','','','0','0','0','0','0',null,'650','13000','0','0','0','0','0','0','0','0','1'); -- id=1629
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1954, 0, 0
                    , 598, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 598,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1143
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1954 ;
UPDATE buybilldetail SET  quantitybefore = 32 WHERE buybilldetailid = 1629 ;
UPDATE product SET productName = 'موديلات 650 برو', productDescription = '', productCatId = '158', productBuyPrice = '650.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01954',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '598',meanbuyprice = '667.88',meanbuyprice_withDiscount = '612.29' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615.11',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='650',meanbuyprice_withTax='667.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='598',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1954';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 667.88, lastbuyprice_withDiscount = 598, meanbuyprice_withDiscount = 612.29
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 667.88, lastbuyprice_withDiscountAndTax = 598
                where buybilldetailid = 1629;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1954;
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2971';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1954', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '32', '52', '1', '2026-10-14 13:20:59','0','0'); -- id=16006
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 ('01955', '290', '158', '1955', '20.00', '680', '13600.00', '0.00', '', '2026-10-21 15:02:09', '1955','','','0','0','0','0','0',null,'680','13600','0','0','0','0','0','0','0','0','1'); -- id=1630
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1955, 0, 0
                    , 625.6, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 625.6,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1146
UPDATE product SET  productBuyPrice = "680" WHERE productId = 1955 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1630 ;
UPDATE product SET productName = 'كود 1036 برو', productDescription = '', productCatId = '158', productBuyPrice = '680.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01955',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '680',lastbuyprice_withDiscount = '625.6',meanbuyprice = '680',meanbuyprice_withDiscount = '652.8' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',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='680',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='625.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 = '1955';
UPDATE buybilldetail SET  lastbuyprice = 680 , meanbuyprice = 680, lastbuyprice_withDiscount = 625.6, meanbuyprice_withDiscount = 652.8
        , lastbuyprice_withTax = 680, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 625.6
                where buybilldetailid = 1630;
UPDATE productunit SET proUnitBuyPrice  = 680 * productnumber WHERE productid = 1955;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1955', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-14 13:20:59','0','0'); -- id=16007
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 ('01956', '290', '158', '1956', '24.00', '580', '13920.00', '0.00', '', '2026-10-21 15:02:09', '1956','','','0','0','0','0','0',null,'580','13920','0','0','0','0','0','0','0','0','1'); -- id=1631
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1956, 0, 0
                    , 533.6, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 533.6,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1147
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1956 ;
UPDATE buybilldetail SET  quantitybefore = -14 WHERE buybilldetailid = 1631 ;
UPDATE product SET productName = 'موديلات 580 برو', productDescription = '', productCatId = '158', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '533.6',meanbuyprice = '664.06',meanbuyprice_withDiscount = '644.86' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='664.06',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='533.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 = '1956';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 664.06, lastbuyprice_withDiscount = 533.6, meanbuyprice_withDiscount = 644.86
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 664.06, lastbuyprice_withDiscountAndTax = 533.6
                where buybilldetailid = 1631;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1956;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '24', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-14', '10', '1', '2026-10-14 13:20:59','0','0'); -- id=16008
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 ('01956', '290', '158', '1956', '24.00', '580', '13920.00', '0.00', '', '2026-10-21 15:02:09', '1956','','','0','0','0','0','0',null,'580','13920','0','0','0','0','0','0','0','0','1'); -- id=1632
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1956, 0, 0
                    , 533.6, 24, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 533.6,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1147
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1956 ;
UPDATE buybilldetail SET  quantitybefore = 10 WHERE buybilldetailid = 1632 ;
UPDATE product SET productName = 'موديلات 580 برو', productDescription = '', productCatId = '158', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01956',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '533.6',meanbuyprice = '629.28',meanbuyprice_withDiscount = '598.82' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='629.28',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='533.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 = '1956';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 629.28, lastbuyprice_withDiscount = 533.6, meanbuyprice_withDiscount = 598.82
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 629.28, lastbuyprice_withDiscountAndTax = 533.6
                where buybilldetailid = 1632;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1956;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2973';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1956', '1', '24', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '10', '34', '1', '2026-10-14 13:20:59','0','0'); -- id=16009
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 ('01957', '290', '158', '1957', '20.00', '660', '13200.00', '0.00', '', '2026-10-21 15:02:09', '1957','','','0','0','0','0','0',null,'660','13200','0','0','0','0','0','0','0','0','1'); -- id=1633
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1957, 0, 0
                    , 607.2, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 607.2,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1149
UPDATE product SET  productBuyPrice = "660" WHERE productId = 1957 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 1633 ;
UPDATE product SET productName = 'موديلات 660 برو', productDescription = '', productCatId = '158', productBuyPrice = '660.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01957',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '660',lastbuyprice_withDiscount = '607.2',meanbuyprice = '672.06',meanbuyprice_withDiscount = '619.25' , productbuypricereal = '630.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='619.87',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='660',meanbuyprice_withTax='672.06',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='607.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 = '1957';
UPDATE buybilldetail SET  lastbuyprice = 660 , meanbuyprice = 672.06, lastbuyprice_withDiscount = 607.2, meanbuyprice_withDiscount = 619.25
        , lastbuyprice_withTax = 660, meanbuyprice_withTax = 672.06, lastbuyprice_withDiscountAndTax = 607.2
                where buybilldetailid = 1633;
UPDATE productunit SET proUnitBuyPrice  = 660 * productnumber WHERE productid = 1957;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2974';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1957', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '36', '1', '2026-10-14 13:20:59','0','0'); -- id=16010
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 ('01953', '290', '158', '1953', '32.00', '550', '17600.00', '0.00', '', '2026-10-21 15:02:09', '1953','','','0','0','0','0','0',null,'550','17600','0','0','0','0','0','0','0','0','1'); -- id=1634
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1953, 0, 0
                    , 506, 32, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 506,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1142
UPDATE product SET  productBuyPrice = "550" WHERE productId = 1953 ;
UPDATE buybilldetail SET  quantitybefore = 38 WHERE buybilldetailid = 1634 ;
UPDATE product SET productName = 'موديلات 550 برو', productDescription = '', productCatId = '158', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01953',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '506',meanbuyprice = '562.9',meanbuyprice_withDiscount = '518.15' , productbuypricereal = '520.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.77' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='515.1',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='550',meanbuyprice_withTax='562.9',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1953';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 562.9, lastbuyprice_withDiscount = 506, meanbuyprice_withDiscount = 518.15
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 562.9, lastbuyprice_withDiscountAndTax = 506
                where buybilldetailid = 1634;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1953;
UPDATE storedetail SET  productquantity = '70', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2970';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1953', '1', '32', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '38', '70', '1', '2026-10-14 13:20:59','0','0'); -- id=16011
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 ('01958', '290', '158', '1958', '20.00', '500', '10000.00', '0.00', '', '2026-10-21 15:02:09', '1958','','','0','0','0','0','0',null,'500','10000','0','0','0','0','0','0','0','0','1'); -- id=1635
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:20:59', 1, 1958, 0, 0
                    , 460, 20, 0, 0, 1, '2026-10-21 15:02:09')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:02:09' ; -- id=1151
UPDATE product SET  productBuyPrice = "500" WHERE productId = 1958 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1635 ;
UPDATE product SET productName = 'كود 1031 برو', productDescription = '', productCatId = '158', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01958',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '460',meanbuyprice = '500',meanbuyprice_withDiscount = '480' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='500',meanbuyprice_withTax='250',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='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 = '1958';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1635;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 1958;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2975';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1958', '1', '20', '0', '290', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-14 13:20:59','0','0'); -- id=16012
DELETE FROM productserial WHERE billid = 144
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '195048',suppliercurrentDebtInCurrency= '195048' , userid = '1', supplierdate = '2026-10-21 15:02:09'   WHERE supplierid = '137';
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 ('137', '30920.00', '164128', '0', 'اضافة فاتورة مشتريات', '290', '195048', '2026-10-21 15:02:09', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','169160','1','30920','164128','195048','0',''); -- id=806
UPDATE dailyentry SET totalcreditor = '169160.00', totaldebtor = '169160.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 13:31:23', entryComment = 'اضافة فاتورة مشتريات رقم 144', fromFlag = '1',related='0',isopeningentry='0',operationId='144',operationDetailLink='buyBillController.php?do=details&id=144' WHERE id = '2361';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '169160.00', '169160.00', '2026-10-21', '1', '0', '2361', '2026-10-21 15:02:09','تم عكس القيد رقم 2361 ','1','0','0','0','0',''); -- id=4138
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4138', '382', '169160.00', '','0'); -- id=4140
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24778926.19', 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 ('4138', '620', '169160.00', '','0'); -- id=4247
UPDATE accountstree SET name = 'برو', customName = 'برو', customNameEn = 'برو', nameEn = 'برو', parent = '81', accountNature = '1', theValue = '30920', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:09:52' WHERE id = '620';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '164128', '164128', '2026-10-21', '1', '0', '0', '2026-10-21 15:02:09','اضافة فاتورة مشتريات رقم 290','1','0',null,'0','290','buyBillController.php?do=details&id=290'); -- id=4139
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4139', '382', '164128', '','0'); -- id=4248
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24943054.19', 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 ('4139', '620', '164128', '','0'); -- id=4141
UPDATE accountstree SET name = 'برو', customName = 'برو', customNameEn = 'برو', nameEn = 'برو', parent = '81', accountNature = '1', theValue = '195048', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:09:52' WHERE id = '620';
update buybill set dailyentryid='4139,0' where buybillid=290;
UPDATE product SET overAllAveragePrice = 469.2 WHERE productId = 1949;UPDATE product SET overAllAveragePrice = 487.6 WHERE productId = 1950;UPDATE product SET overAllAveragePrice = 441.6 WHERE productId = 1951;UPDATE product SET overAllAveragePrice = 552 WHERE productId = 1952;UPDATE product SET overAllAveragePrice = 506 WHERE productId = 1953;UPDATE product SET overAllAveragePrice = 598 WHERE productId = 1954;UPDATE product SET overAllAveragePrice = 625.6 WHERE productId = 1955;UPDATE product SET overAllAveragePrice = 533.6 WHERE productId = 1956;UPDATE product SET overAllAveragePrice = 607.2 WHERE productId = 1957;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 1958;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:02:09', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=290'); -- id=16453
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:02:17', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16454
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:02:25', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16455
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:02:28', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=143'); -- id=16456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:02:39', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16457
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 15:02:54', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16458
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-21 11:32:54";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 15:02:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 15:02:54', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16459
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:32:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:02:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:02:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16460
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:03:03', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16461

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a7b2d6a49
-- ----------------------------------------------------------------------------------------------------

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-21 15:03:03', '06ad8a7b2d6a49', '1', '0.00', '0', '0', '1', '5520.00', '5520', '5520', '0', '1', '2026-10-21 15:03:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '12' ,'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-21','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=1162
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','اضافة فاتورة مبيعات','1162', '0', '2026-10-21 15:03:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5520', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:03:03','0','0','',''); -- id=1387
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1162', '147', '1884', '12', '460', '5520', '0', '', '0', '2026-10-21 15:03:03', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-12,','1','1','0','0','460','5520','0','','0','0.00','0','0','0','0'); -- id=4763
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 = 4763;
 INSERT INTO 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-21', 5520, 5148, 5148
                    , 5148, 5148, 5148, 5148
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5148, 5148, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5148
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5148, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5148
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5148, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5148
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5148
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5148
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5148
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5520, 5148, 5148
                    , 5148, 5148, 5148, 5148
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5148, 5148, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5148
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5148, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5148
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5148, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5148
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5148
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5148
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5148
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '276', userid = '2', storedetaildate = '2026-10-21 15:03:03' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '12', '1', '1162', 'اضافة فاتورة مبيعات', 'sellbillController.php', '288', '276', '2', '2026-10-21 15:03:03','0','0'); -- id=16013
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7182648.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 ('7177128.5','5520', '0', '2', 'اضافة فاتورة مبيعات', '1162', '7182648.5', '2026-10-21 15:03:03', '2',  'sellbillController.php','1','','0'); -- id=1441
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5520', '5520', '2026-10-21', '2', '0', '0', '2026-10-21 15:03:03','اضافة فاتورة مبيعات رقم 1162','1','0',null,'0','1162','sellbillController.php?do=showDetail&sellbillid=1162'); -- id=4140
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4140', '419', '5520', '','0'); -- id=4249
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7182648', 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 ('4140', '143', '5520', '','0'); -- id=4142
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13157745', 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 ( '5148', '5148', '2026-10-21', '2', '0', '0', '2026-10-21 15:03:03','اضافة فاتورة مبيعات رقم 1162 - صرف البضاعة من المخزن','1','0',null,'0','1162','sellbillController.php?do=showDetail&sellbillid=1162'); -- id=4141
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4141', '402', '5148', '','0'); -- id=4250
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12172527.31', 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 ('4141', '382', '5148', '','0'); -- id=4143
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24937906.19', 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='4140,0,4141' where sellbillid=1162;
 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-21', 5520, 5148, 5148
                    , 5148, 5148, 5148, 5148
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5148, 5148, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5148
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5148, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5148
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5148, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5148
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5148
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5148
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5148
                        , returnSellVal = returnSellVal+0, 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-21', 5520, 5148, 5148
                    , 5148, 5148, 5148, 5148
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5148, 5148, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5148
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5148, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5148
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5148, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5148
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5148
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5148
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5148
                        , returnSellVal = returnSellVal+0, 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, 5148, 5148
                    , 5148, 5148, 5148, 5148, 5148, 5148)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5520, netSellCostBuyPrice = netSellCostBuyPrice+5148
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5148
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5148
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5148
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5148
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5148
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5148
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5148;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8a7b2d6a49 and sellbillId = 1162 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:03:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16462
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:03:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16463
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:03:30', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16464

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a9f7b5a87
-- ----------------------------------------------------------------------------------------------------

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-21 15:03:30', '06ad8a9f7b5a87', '1', '0.00', '0', '0', '1', '1380.00', '1380', '1380', '0', '1', '2026-10-21 15:03:30', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1380','0','','0','0','1380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1163
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','اضافة فاتورة مبيعات','1163', '0', '2026-10-21 15:03:30', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1380', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:03:30','0','0','',''); -- id=1388
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1163', '147', '1884', '3', '460', '1380', '0', '', '0', '2026-10-21 15:03:30', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4764
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 = 4764;
 INSERT INTO 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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '273', userid = '2', storedetaildate = '2026-10-21 15:03:30' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '3', '1', '1163', 'اضافة فاتورة مبيعات', 'sellbillController.php', '276', '273', '2', '2026-10-21 15:03:30','0','0'); -- id=16014
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7184028.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 ('7182648.5','1380', '0', '2', 'اضافة فاتورة مبيعات', '1163', '7184028.5', '2026-10-21 15:03:30', '2',  'sellbillController.php','1','','0'); -- id=1442
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1380', '1380', '2026-10-21', '2', '0', '0', '2026-10-21 15:03:30','اضافة فاتورة مبيعات رقم 1163','1','0',null,'0','1163','sellbillController.php?do=showDetail&sellbillid=1163'); -- id=4142
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4142', '419', '1380', '','0'); -- id=4251
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7184028', 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 ('4142', '143', '1380', '','0'); -- id=4144
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13159125', 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 ( '1287', '1287', '2026-10-21', '2', '0', '0', '2026-10-21 15:03:30','اضافة فاتورة مبيعات رقم 1163 - صرف البضاعة من المخزن','1','0',null,'0','1163','sellbillController.php?do=showDetail&sellbillid=1163'); -- id=4143
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4143', '402', '1287', '','0'); -- id=4252
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12173814.31', 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 ('4143', '382', '1287', '','0'); -- id=4145
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24936619.19', 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='4142,0,4143' where sellbillid=1163;
 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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, 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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, 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, 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287, 1287, 1287)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1380, netSellCostBuyPrice = netSellCostBuyPrice+1287
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1287
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1287
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1287
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1287
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1287
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1287
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1287;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8a9f7b5a87 and sellbillId = 1163 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:03:30', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16465
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:03:30', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=143'); -- id=16466
UPDATE productunit SET unitid = '1', productid = '1960', productnumber = '1.00', productunitdate = '2026-10-14', userid = '1', conditions = '0',proUnitParcode='0196001',proUnitSellAllPrice='495',proUnitSellHalfPrice='495',proUnitSellUnitPrice ='495',proUnitBuyPrice='475',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1960';
UPDATE product SET productName = 'تريكو برو', productDescription = '', productCatId = '159', productBuyPrice = '495', productSellAllPrice = '495', productSellUnitPrice = '495', productSellHalfPrice = '495', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01960',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475' , buypricereal_precentage = '0' , buytotal_precentage = '4.21' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',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='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1960';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:03:52', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16467
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 143;
UPDATE buybill SET  buybillsysdate = '2026-10-21 15:03:52', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '143';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:29:15', 1, 1960, 0, 0
                    , 475, 80, 0, 0, 1, '2026-10-21 15:03:52')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:03:52' ; -- id=1137
UPDATE buybilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 475.00
        , lastbuyprice_withTax = 475.00, meanbuyprice_withTax = 475.00, lastbuyprice_withDiscountAndTax = 475.00
                where buybilldetailid = 860;
UPDATE product SET productName = 'تريكو برو', productDescription = '', productCatId = '159', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01960',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '0',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.21' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',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 = '1960';
UPDATE productunit SET proUnitBuyPrice  = 475 * productnumber WHERE productid = 1960;
UPDATE storedetail SET  productquantity = '-56', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2977';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1960', '1', '80', '1', '143', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '-56', '1', '2026-10-14 13:29:15','0','0'); -- id=16015
UPDATE supplier SET  suppliercurrentDebt = '157048',suppliercurrentDebtInCurrency= '157048' , userid = '1', supplierdate = '2026-10-21 15:03:52'   WHERE supplierid = '137';
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 ('137', '195048.00', '38000.00', '1', 'حذف فاتورة مشتريات - للتعديل', '143', '157048', '2026-10-14 13:29:15', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','38000','1','195048','38000','157048','0',''); -- id=807
UPDATE productserial SET del = 1
		 WHERE billid = 143;
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 ('06acf597bb4a63', '2026-10-14 13:29:15', '137', '157048.00', '194668', '5', '1', '39600.00', '37620.00', '0.00', '37620', '1', '2026-10-21 15:03:52', '', '1', '0', '', '1', '1','1','143','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=291
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 ('01960', '291', '159', '1960', '80.00', '495', '39600.00', '0.00', '', '2026-10-21 15:03:52', '1960','','','0','0','0','0','0',null,'495','39600','0','0','0','0','0','0','0','0','1'); -- id=1636
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 13:29:15', 1, 1960, 0, 0
                    , 470.25, 80, 0, 0, 1, '2026-10-21 15:03:52')
                ON DUPLICATE KEY UPDATE buyprice = 470.25,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 15:03:52' ; -- id=1137
UPDATE product SET  productBuyPrice = "495" WHERE productId = 1960 ;
UPDATE buybilldetail SET  quantitybefore = -56 WHERE buybilldetailid = 1636 ;
UPDATE product SET productName = 'تريكو برو', productDescription = '', productCatId = '159', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01960',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '470.25',meanbuyprice = '490.38',meanbuyprice_withDiscount = '471.35' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.21' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='495',meanbuyprice_withTax='490.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='470.25',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1960';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 490.38, lastbuyprice_withDiscount = 470.25, meanbuyprice_withDiscount = 471.35
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 490.38, lastbuyprice_withDiscountAndTax = 470.25
                where buybilldetailid = 1636;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 1960;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2977';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1960', '1', '80', '0', '291', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-56', '24', '1', '2026-10-14 13:29:15','0','0'); -- id=16016
DELETE FROM productserial WHERE billid = 143
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '194668',suppliercurrentDebtInCurrency= '194668' , userid = '1', supplierdate = '2026-10-21 15:03:52'   WHERE supplierid = '137';
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 ('137', '157048.00', '37620', '0', 'اضافة فاتورة مشتريات', '291', '194668', '2026-10-21 15:03:52', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','38000','1','157048','37620','194668','0',''); -- id=808
UPDATE dailyentry SET totalcreditor = '38000.00', totaldebtor = '38000.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 13:30:17', entryComment = 'اضافة فاتورة مشتريات رقم 143', fromFlag = '1',related='0',isopeningentry='0',operationId='143',operationDetailLink='buyBillController.php?do=details&id=143' WHERE id = '2360';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '38000.00', '38000.00', '2026-10-21', '1', '0', '2360', '2026-10-21 15:03:52','تم عكس القيد رقم 2360 ','1','0','0','0','0',''); -- id=4144
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4144', '382', '38000.00', '','0'); -- id=4146
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24898619.19', 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 ('4144', '620', '38000.00', '','0'); -- id=4253
UPDATE accountstree SET name = 'برو', customName = 'برو', customNameEn = 'برو', nameEn = 'برو', parent = '81', accountNature = '1', theValue = '157048', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:09:52' WHERE id = '620';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '37620', '37620', '2026-10-21', '1', '0', '0', '2026-10-21 15:03:52','اضافة فاتورة مشتريات رقم 291','1','0',null,'0','291','buyBillController.php?do=details&id=291'); -- id=4145
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4145', '382', '37620', '','0'); -- id=4254
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24936239.19', 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 ('4145', '620', '37620', '','0'); -- id=4147
UPDATE accountstree SET name = 'برو', customName = 'برو', customNameEn = 'برو', nameEn = 'برو', parent = '81', accountNature = '1', theValue = '194668', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:09:52' WHERE id = '620';
update buybill set dailyentryid='4145,0' where buybillid=291;
UPDATE product SET overAllAveragePrice = 470.25 WHERE productId = 1960;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:33:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:03:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 15:03:52', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=291'); -- id=16468
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:34:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:04:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:04:03', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16469
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:34:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:04:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:04:08', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16470
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:34:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:04:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 15:04:34', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=21'); -- id=16471
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:34:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:04:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:04:56', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16472

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8aa1279e1c
-- ----------------------------------------------------------------------------------------------------

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-21 15:04:56', '06ad8aa1279e1c', '1', '0.00', '0', '0', '1', '960.00', '960', '960', '0', '1', '2026-10-21 15:04:56', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','960','0','','0','0','960','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1164
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','اضافة فاتورة مبيعات','1164', '0', '2026-10-21 15:04:56', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '960', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:04:56','0','0','',''); -- id=1389
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1164', '147', '1886', '3', '320', '960', '0', '', '0', '2026-10-21 15:04:56', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6765-3,','1','1','0','0','320','960','0','','0','0.00','0','0','0','0'); -- id=4765
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4765;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 960, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 960, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '88', userid = '2', storedetaildate = '2026-10-21 15:04:56' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '3', '1', '1164', 'اضافة فاتورة مبيعات', 'sellbillController.php', '91', '88', '2', '2026-10-21 15:04:56','0','0'); -- id=16017
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7184988.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 ('7184028.5','960', '0', '2', 'اضافة فاتورة مبيعات', '1164', '7184988.5', '2026-10-21 15:04:56', '2',  'sellbillController.php','1','','0'); -- id=1443
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '960', '960', '2026-10-21', '2', '0', '0', '2026-10-21 15:04:56','اضافة فاتورة مبيعات رقم 1164','1','0',null,'0','1164','sellbillController.php?do=showDetail&sellbillid=1164'); -- id=4146
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4146', '419', '960', '','0'); -- id=4255
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7184988', 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 ('4146', '143', '960', '','0'); -- id=4148
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13160085', 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 ( '867', '867', '2026-10-21', '2', '0', '0', '2026-10-21 15:04:56','اضافة فاتورة مبيعات رقم 1164 - صرف البضاعة من المخزن','1','0',null,'0','1164','sellbillController.php?do=showDetail&sellbillid=1164'); -- id=4147
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4147', '402', '867', '','0'); -- id=4256
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12174681.31', 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 ('4147', '382', '867', '','0'); -- id=4149
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24935372.19', 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='4146,0,4147' where sellbillid=1164;
 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-21', 960, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, 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-21', 960, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, 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, 960, 867, 867
                    , 867, 867, 867, 867, 867, 867)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+960, netSellCostBuyPrice = netSellCostBuyPrice+867
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+867
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+867
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+867
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+867
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+867
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+867
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+867;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8aa1279e1c and sellbillId = 1164 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:34:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:04:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:04:56', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16473
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:35:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:05:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:05:51', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16474
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:36:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:06:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:06:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16475
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:36:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:06:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:06:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16476
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:40:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:10:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:10:22', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16477
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:40:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:10:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:10:36', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16478
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:42:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:12:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:12:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16479
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:42:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:12:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:12:45', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16480
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:49:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:19:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:19:03', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16481
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:50:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:20:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:20:22', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16482
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:50:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:20:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:20:27', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16483
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:50:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:20:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:20:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16484
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:50:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:20:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:20:51', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16485
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:50:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:20:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:20:57', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16486
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:52:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:22:10", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:22:10', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16487

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a3c69adac
-- ----------------------------------------------------------------------------------------------------

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-21 15:22:10', '06ad8a3c69adac', '1', '0.00', '0', '0', '1', '1395.00', '1395', '1395', '0', '1', '2026-10-21 15:22:10', '', '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-21','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=1165
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','اضافة فاتورة مبيعات','1165', '0', '2026-10-21 15:22:10', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1395', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:22:10','0','0','',''); -- id=1390
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', '1165', '199', '2260', '3', '465', '1395', '0', '', '0', '2026-10-21 15:22:10', '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=4766
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 = 4766;
 INSERT INTO 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-21', 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-21', 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 = '30', userid = '6', storedetaildate = '2026-10-21 15:22:10' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '3', '1', '1165', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '30', '6', '2026-10-21 15:22:10','0','0'); -- id=16018
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1007065',  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 ('1005670','1395', '0', '4', 'اضافة فاتورة مبيعات', '1165', '1007065', '2026-10-21 15:22:10', '6',  'sellbillController.php','1','','0'); -- id=1444
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1395', '1395', '2026-10-21', '6', '0', '0', '2026-10-21 15:22:10','اضافة فاتورة مبيعات رقم 1165','1','0',null,'0','1165','sellbillController.php?do=showDetail&sellbillid=1165'); -- id=4148
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4148', '568', '1395', '','0'); -- id=4257
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1007065', 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 ('4148', '143', '1395', '','0'); -- id=4150
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13161480', 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-21', '6', '0', '0', '2026-10-21 15:22:10','اضافة فاتورة مبيعات رقم 1165 - صرف البضاعة من المخزن','1','0',null,'0','1165','sellbillController.php?do=showDetail&sellbillid=1165'); -- id=4149
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4149', '402', '1350', '','0'); -- id=4258
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12176031.31', 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 ('4149', '382', '1350', '','0'); -- id=4151
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24934022.19', 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='4148,0,4149' where sellbillid=1165;
 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-21', 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-21', 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 06ad8a3c69adac and sellbillId = 1165 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:52:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:22:10", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:22:10', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16488
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:56:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:26:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 15:26:17', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16489
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-21 11:56:17";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 15:26:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 15:26:17', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16490
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:56:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:26:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:26:19', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16491
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:56:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:26:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:26:24', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16492

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8aa6908f1c
-- ----------------------------------------------------------------------------------------------------

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-21 15:26:24', '06ad8aa6908f1c', '1', '0.00', '0', '0', '1', '8290.00', '8290', '8290', '0', '1', '2026-10-21 15:26:24', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '19' ,'0','','','','','-1','0','0','0','0','0','8290','0','','0','0','8290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1166
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','اضافة فاتورة مبيعات','1166', '0', '2026-10-21 15:26:24', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8290', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:26:24','0','0','',''); -- id=1391
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 6079;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('535','02047', '1166', '42', '2047', '4', '550', '2200', '0', '', '0', '2026-10-21 15:26:24', '2047', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6079-4,','1','1','0','0','550','2200','0','','0','0.00','0','0','0','0'); -- id=4767
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 535.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 535.00
        , lastbuyprice_withTax = 535, meanbuyprice_withTax = 535, lastbuyprice_withDiscountAndTax = 535
                where sellbilldetailid = 4767;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2047, '2026-10-21', 2200, 2140, 2140
                    , 2140, 2140, 2140, 2140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2140, 2140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2200, 2140, 2140
                    , 2140, 2140, 2140, 2140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2140, 2140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 15:26:24' WHERE storedetailid = '3406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2047', '1', '4', '1', '1166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '27', '2', '2026-10-21 15:26:24','0','0'); -- id=16019
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02084', '1166', '43', '2084', '3', '360', '1080', '0', '', '0', '2026-10-21 15:26:24', '2084', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6131-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=4768
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 = 4768;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2084, '2026-10-21', 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-21', 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 = '51', userid = '2', storedetaildate = '2026-10-21 15:26:24' WHERE storedetailid = '3443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2084', '1', '3', '1', '1166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '51', '2', '2026-10-21 15:26:24','0','0'); -- id=16020
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6132;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02085', '1166', '174', '2085', '3', '460', '1380', '0', '', '0', '2026-10-21 15:26:24', '2085', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6132-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4769
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4769;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2085, '2026-10-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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-21', 1380, 1380, 1380
                    , 1380, 1242, 1242, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1242
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , 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 = '189', userid = '2', storedetaildate = '2026-10-21 15:26:24' WHERE storedetailid = '3444';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2085', '1', '3', '1', '1166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '192', '189', '2', '2026-10-21 15:26:24','0','0'); -- id=16021
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1166', '75', '1260', '6', '390', '2340', '0', '', '0', '2026-10-21 15:26:24', '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=4770
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 = 4770;
 INSERT INTO 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-21', 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-21', 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 = '544', userid = '2', storedetaildate = '2026-10-21 15:26:24' WHERE storedetailid = '1260';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1260', '1', '6', '1', '1166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '550', '544', '2', '2026-10-21 15:26:24','0','0'); -- id=16022
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1166', '188', '2152', '3', '430', '1290', '0', '', '0', '2026-10-21 15:26:24', '2152', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6244-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4771
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 = 4771;
 INSERT INTO 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-21', 1290, 1290, 1290
                    , 1290, 1186.8, 1186.8, 1186.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1290, 1290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1186.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1186.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1186.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1290, 1290, 1290
                    , 1290, 1186.8, 1186.8, 1186.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1290, 1290, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1290, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1290
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1186.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1186.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1186.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1290
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1290
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 15:26:24' WHERE storedetailid = '3511';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2152', '1', '3', '1', '1166', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '2', '2026-10-21 15:26:24','0','0'); -- id=16023
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7193278.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 ('7184988.5','8290', '0', '2', 'اضافة فاتورة مبيعات', '1166', '7193278.5', '2026-10-21 15:26:24', '2',  'sellbillController.php','1','','0'); -- id=1445
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8290', '8290', '2026-10-21', '2', '0', '0', '2026-10-21 15:26:24','اضافة فاتورة مبيعات رقم 1166','1','0',null,'0','1166','sellbillController.php?do=showDetail&sellbillid=1166'); -- id=4150
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4150', '419', '8290', '','0'); -- id=4259
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7193278', 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 ('4150', '143', '8290', '','0'); -- id=4152
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13169770', 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 ( '7760.8', '7760.8', '2026-10-21', '2', '0', '0', '2026-10-21 15:26:24','اضافة فاتورة مبيعات رقم 1166 - صرف البضاعة من المخزن','1','0',null,'0','1166','sellbillController.php?do=showDetail&sellbillid=1166'); -- id=4151
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4151', '402', '7760.8', '','0'); -- id=4260
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12183792.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 ('4151', '382', '7760.8', '','0'); -- id=4153
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24926261.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='4150,0,4151' where sellbillid=1166;
 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-21', 8290, 8110, 8110
                    , 8110, 7760.8, 7760.8, 7760.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8110, 8110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8290, sellCostBuyPrice =sellCostBuyPrice+8110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7760.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7760.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7760.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8110
                        , returnSellVal = returnSellVal+0, 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-21', 8290, 8110, 8110
                    , 8110, 7760.8, 7760.8, 7760.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8110, 8110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8290, sellCostBuyPrice =sellCostBuyPrice+8110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7760.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7760.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7760.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8110
                        , returnSellVal = returnSellVal+0, 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, 8290, 8110, 8110
                    , 8110, 7760.8, 7760.8, 7760.8, 8110, 8110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8290, netSellCostBuyPrice = netSellCostBuyPrice+8110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8110
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7760.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7760.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7760.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8aa6908f1c and sellbillId = 1166 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:56:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:26:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:26:25', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16493
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:57:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:27:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 15:27:58', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16494
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-21 11:57:58";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 15:27:58', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16495
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:58:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:28:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:28:01', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16496
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:58:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:28:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:28:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16497
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:58:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:28:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:28:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16498
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:58:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:28:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:28:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16499
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 11:59:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:29:22", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 15:29:22', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16500
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:01:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:31:49", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:31:49', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16501
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:03:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:33:15", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:33:15', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16502

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8a6016be0e
-- ----------------------------------------------------------------------------------------------------

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-21 15:33:15', '06ad8a6016be0e', '1', '0.00', '0', '10', '1', '3860.00', '3850', '3850', '0', '2', '2026-10-21 15:33:15', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '10' ,'0','','','','','-1','0','0','0','0','0','3850','0','','0','0','3850','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1167
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','اضافة فاتورة مبيعات','1167', '0', '2026-10-21 15:33:15', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3850', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:33:15','0','0','',''); -- id=1392
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01324', '1167', '86', '1324', '6', '390', '2340', '0', '', '0', '2026-10-21 15:33:15', '1324', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','131-6,','1','1','0','0','390','2340','0','','0','0.00','0','0','0','0'); -- id=4772
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.63, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.63
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 355.63, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4772;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1324, '2026-10-21', 2333.9378238342, 2160, 2160
                    , 2133.78, 2160, 2133.78, 2131.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2160, 2133.78, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2333.9378238342, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2133.78
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2133.78
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2131.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2133.78
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2333.9378238342, 2160, 2160
                    , 2133.78, 2160, 2133.78, 2131.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2160, 2133.78, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2333.9378238342, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2133.78
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2133.78
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2131.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2133.78
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1024', userid = '4', storedetaildate = '2026-10-21 15:33:15' WHERE storedetailid = '1405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '6', '1', '1167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1030', '1024', '4', '2026-10-21 15:33:15','0','0'); -- id=16024
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 495;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01551', '1167', '112', '1551', '4', '380', '1520', '0', '', '0', '2026-10-21 15:33:15', '1551', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','495-4,','1','1','0','0','380','1520','0','','0','0.00','0','0','0','0'); -- id=4773
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 = 4773;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1551, '2026-10-21', 1516.0621761658, 1280, 1280
                    , 1280, 1280, 1280, 1280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1280, 1280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1516.0621761658, sellCostBuyPrice =sellCostBuyPrice+1280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1516.0621761658, 1280, 1280
                    , 1280, 1280, 1280, 1280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1280, 1280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1516.0621761658, sellCostBuyPrice =sellCostBuyPrice+1280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '218', userid = '4', storedetaildate = '2026-10-21 15:33:15' WHERE storedetailid = '2563';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1551', '2', '4', '1', '1167', 'اضافة فاتورة مبيعات', 'sellbillController.php', '222', '218', '4', '2026-10-21 15:33:15','0','0'); -- id=16025
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1127942.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 ('1124092.875','3850', '0', '3', 'اضافة فاتورة مبيعات', '1167', '1127942.875', '2026-10-21 15:33:15', '4',  'sellbillController.php','1','','0'); -- id=1446
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3860', '3860', '2026-10-21', '4', '0', '0', '2026-10-21 15:33:15','اضافة فاتورة مبيعات رقم 1167','1','0',null,'0','1167','sellbillController.php?do=showDetail&sellbillid=1167'); -- id=4152
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4152', '501', '3850', '','0'); -- id=4261
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1127942.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 ('4152', '398', '10', '','0'); -- id=4262
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510194.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 ('4152', '143', '3860', '','0'); -- id=4154
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13173630', 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 ( '3440', '3440', '2026-10-21', '4', '0', '0', '2026-10-21 15:33:15','اضافة فاتورة مبيعات رقم 1167 - صرف البضاعة من المخزن','1','0',null,'0','1167','sellbillController.php?do=showDetail&sellbillid=1167'); -- id=4153
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4153', '402', '3440', '','0'); -- id=4263
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12187232.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 ('4153', '492', '3440', '','0'); -- id=4155
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1594507', 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='4152,0,4153' where sellbillid=1167;
 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-21', 3850, 3440, 3440
                    , 3413.78, 3440, 3413.78, 3411.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3440, 3413.78, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3413.78
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3413.78
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3411.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3413.78
                        , returnSellVal = returnSellVal+0, 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-21', 3850, 3440, 3440
                    , 3413.78, 3440, 3413.78, 3411.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3440, 3413.78, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3413.78
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3413.78
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3411.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3413.78
                        , returnSellVal = returnSellVal+0, 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, 3850, 3440, 3440
                    , 3413.78, 3440, 3413.78, 3411.2, 3440, 3413.78)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3850, netSellCostBuyPrice = netSellCostBuyPrice+3440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3413.78
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3413.78
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3411.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3440
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3413.78;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8a6016be0e and sellbillId = 1167 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:03:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:33:15", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:33:15', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16503
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:04:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:34:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:34:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16504
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:04:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:34:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 15:34:11', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16505
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:11:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:41:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:41:29', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16506

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8af711c8fe
-- ----------------------------------------------------------------------------------------------------

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-21 15:41:29', '06ad8af711c8fe', '1', '0.00', '0', '0', '1', '4170.00', '4170', '4170', '0', '1', '2026-10-21 15:41:29', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','4170','0','','0','0','4170','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1168
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','اضافة فاتورة مبيعات','1168', '0', '2026-10-21 15:41:29', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4170', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:41:29','0','0','',''); -- id=1393
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1168', '142', '1841', '9', '250', '2250', '0', '', '0', '2026-10-21 15:41:29', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-9,','1','1','0','0','250','2250','0','','0','0.00','0','0','0','0'); -- id=4774
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 = 4774;
 INSERT INTO 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-21', 2250, 2115, 2115
                    , 2115, 2115, 2115, 2115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2115, 2070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2115
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2250, 2115, 2115
                    , 2115, 2115, 2115, 2115
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2115, 2070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2115
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2115, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2115
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2115, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2115
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2115
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2115
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '244', userid = '2', storedetaildate = '2026-10-21 15:41:29' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '9', '1', '1168', 'اضافة فاتورة مبيعات', 'sellbillController.php', '253', '244', '2', '2026-10-21 15:41:29','0','0'); -- id=16026
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1168', '147', '1886', '6', '320', '1920', '0', '', '0', '2026-10-21 15:41:29', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6765-6,','1','1','0','0','320','1920','0','','0','0.00','0','0','0','0'); -- id=4775
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4775;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 1920, 1734, 1734
                    , 1734, 1734, 1734, 1734
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1734, 1734, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1734
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1734, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1734
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1734, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1734
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1734
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1734
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1734
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1920, 1734, 1734
                    , 1734, 1734, 1734, 1734
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1734, 1734, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1734
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1734, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1734
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1734, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1734
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1734
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1734
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1734
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '82', userid = '2', storedetaildate = '2026-10-21 15:41:29' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '6', '1', '1168', 'اضافة فاتورة مبيعات', 'sellbillController.php', '88', '82', '2', '2026-10-21 15:41:29','0','0'); -- id=16027
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7197448.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 ('7193278.5','4170', '0', '2', 'اضافة فاتورة مبيعات', '1168', '7197448.5', '2026-10-21 15:41:29', '2',  'sellbillController.php','1','','0'); -- id=1447
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4170', '4170', '2026-10-21', '2', '0', '0', '2026-10-21 15:41:29','اضافة فاتورة مبيعات رقم 1168','1','0',null,'0','1168','sellbillController.php?do=showDetail&sellbillid=1168'); -- id=4154
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4154', '419', '4170', '','0'); -- id=4264
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7197448', 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 ('4154', '143', '4170', '','0'); -- id=4156
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13177800', 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 ( '3849', '3849', '2026-10-21', '2', '0', '0', '2026-10-21 15:41:29','اضافة فاتورة مبيعات رقم 1168 - صرف البضاعة من المخزن','1','0',null,'0','1168','sellbillController.php?do=showDetail&sellbillid=1168'); -- id=4155
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4155', '402', '3849', '','0'); -- id=4265
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12191081.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 ('4155', '382', '3849', '','0'); -- id=4157
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24922412.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='4154,0,4155' where sellbillid=1168;
 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-21', 4170, 3849, 3849
                    , 3849, 3849, 3849, 3849
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3849, 3804, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4170, sellCostBuyPrice =sellCostBuyPrice+3849
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3849, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3849
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3849, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3849
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3849
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3849
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3804
                        , returnSellVal = returnSellVal+0, 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-21', 4170, 3849, 3849
                    , 3849, 3849, 3849, 3849
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3849, 3804, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4170, sellCostBuyPrice =sellCostBuyPrice+3849
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3849, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3849
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3849, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3849
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3849
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3849
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3804
                        , returnSellVal = returnSellVal+0, 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, 4170, 3849, 3849
                    , 3849, 3849, 3849, 3849, 3849, 3804)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4170, netSellCostBuyPrice = netSellCostBuyPrice+3849
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3849
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3849
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3849
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3849
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3849
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3849
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3804;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8af711c8fe and sellbillId = 1168 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:11:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:41:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:41:29', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16507
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:13:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:43:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:43:47', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16508
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:14:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:44:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 15:44:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16509
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:16:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:46:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:46:09', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16510

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8b2f96a1f7
-- ----------------------------------------------------------------------------------------------------

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-21 15:46:09', '06ad8b2f96a1f7', '1', '0.00', '0', '0', '1', '9780.00', '9780', '9780', '0', '1', '2026-10-21 15:46:09', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '27' ,'0','','','','','-1','0','0','0','0','0','9780','0','','0','0','9780','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1169
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','اضافة فاتورة مبيعات','1169', '0', '2026-10-21 15:46:09', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9780', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:46:09','0','0','',''); -- id=1394
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1169', '147', '1886', '9', '320', '2880', '0', '', '0', '2026-10-21 15:46:09', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6765-9,','1','1','0','0','320','2880','0','','0','0.00','0','0','0','0'); -- id=4776
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4776;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '73', userid = '2', storedetaildate = '2026-10-21 15:46:09' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '9', '1', '1169', 'اضافة فاتورة مبيعات', 'sellbillController.php', '82', '73', '2', '2026-10-21 15:46:09','0','0'); -- id=16028
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 6794;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02290', '1169', '179', '2290', '15', '390', '5850', '0', '', '0', '2026-10-21 15:46:09', '2290', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6794-15,','1','1','0','0','390','5850','0','','0','0.00','0','0','0','0'); -- id=4777
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 358.80, meanbuyprice_withDiscount = 358.80
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 358.8
                where sellbilldetailid = 4777;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2290, '2026-10-21', 5850, 5850, 5850
                    , 5850, 5382, 5382, 5382
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5850, 5850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5382, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5382
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5850, 5850, 5850
                    , 5850, 5382, 5382, 5382
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5850, 5850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5382, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5382
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2026-10-21 15:46:09' WHERE storedetailid = '3683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2290', '1', '15', '1', '1169', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '3', '2', '2026-10-21 15:46:09','0','0'); -- id=16029
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6028;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('322','02035', '1169', '166', '2035', '3', '350', '1050', '0', '', '0', '2026-10-21 15:46:09', '2035', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6028-3,','1','1','0','0','350','1050','0','','0','0.00','0','0','0','0'); -- id=4778
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 322.00, meanbuyprice_withDiscount = 322.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 322
                where sellbilldetailid = 4778;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2035, '2026-10-21', 1050, 1050, 1050
                    , 1050, 966, 966, 966
                    , 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+966, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+966
                            , 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-21', 1050, 1050, 1050
                    , 1050, 966, 966, 966
                    , 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+966, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+966
                            , 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 = '1', userid = '2', storedetaildate = '2026-10-21 15:46:09' WHERE storedetailid = '3394';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2035', '1', '3', '1', '1169', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '1', '2', '2026-10-21 15:46:09','0','0'); -- id=16030
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7207228.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 ('7197448.5','9780', '0', '2', 'اضافة فاتورة مبيعات', '1169', '7207228.5', '2026-10-21 15:46:09', '2',  'sellbillController.php','1','','0'); -- id=1448
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9780', '9780', '2026-10-21', '2', '0', '0', '2026-10-21 15:46:09','اضافة فاتورة مبيعات رقم 1169','1','0',null,'0','1169','sellbillController.php?do=showDetail&sellbillid=1169'); -- id=4156
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4156', '419', '9780', '','0'); -- id=4266
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7207228', 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 ('4156', '143', '9780', '','0'); -- id=4158
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13187580', 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 ( '8949', '8949', '2026-10-21', '2', '0', '0', '2026-10-21 15:46:09','اضافة فاتورة مبيعات رقم 1169 - صرف البضاعة من المخزن','1','0',null,'0','1169','sellbillController.php?do=showDetail&sellbillid=1169'); -- id=4157
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4157', '402', '8949', '','0'); -- id=4267
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12200030.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 ('4157', '382', '8949', '','0'); -- id=4159
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24913463.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='4156,0,4157' where sellbillid=1169;
 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-21', 9780, 9501, 9501
                    , 9501, 8949, 8949, 8949
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9501, 9501, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9780, sellCostBuyPrice =sellCostBuyPrice+9501
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9501, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9501
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8949, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8949
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8949
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9501
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9501
                        , returnSellVal = returnSellVal+0, 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-21', 9780, 9501, 9501
                    , 9501, 8949, 8949, 8949
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9501, 9501, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9780, sellCostBuyPrice =sellCostBuyPrice+9501
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9501, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9501
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8949, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8949
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8949
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9501
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9501
                        , returnSellVal = returnSellVal+0, 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, 9780, 9501, 9501
                    , 9501, 8949, 8949, 8949, 9501, 9501)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9780, netSellCostBuyPrice = netSellCostBuyPrice+9501
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9501
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9501
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8949
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8949
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8949
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9501
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9501;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8b2f96a1f7 and sellbillId = 1169 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:16:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:46:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:46:09', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16511
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:17:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:47:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:47:35', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16512

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8b411754c9
-- ----------------------------------------------------------------------------------------------------

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-21 15:47:35', '06ad8b411754c9', '1', '0.00', '0', '0', '1', '900.00', '900', '900', '0', '1', '2026-10-21 15:47:35', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','900','0','','0','0','900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1170
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','اضافة فاتورة مبيعات','1170', '0', '2026-10-21 15:47:35', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '900', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 15:47:35','0','0','',''); -- id=1395
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1170', '94', '1379', '3', '300', '900', '0', '', '0', '2026-10-21 15:47:35', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-3,','1','1','0','0','300','900','0','','0','0.00','0','0','0','0'); -- id=4779
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 = 4779;
 INSERT INTO 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '293', userid = '2', storedetaildate = '2026-10-21 15:47:35' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '3', '1', '1170', 'اضافة فاتورة مبيعات', 'sellbillController.php', '296', '293', '2', '2026-10-21 15:47:35','0','0'); -- id=16031
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7208128.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 ('7207228.5','900', '0', '2', 'اضافة فاتورة مبيعات', '1170', '7208128.5', '2026-10-21 15:47:35', '2',  'sellbillController.php','1','','0'); -- id=1449
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900', '900', '2026-10-21', '2', '0', '0', '2026-10-21 15:47:35','اضافة فاتورة مبيعات رقم 1170','1','0',null,'0','1170','sellbillController.php?do=showDetail&sellbillid=1170'); -- id=4158
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4158', '419', '900', '','0'); -- id=4268
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7208128', 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 ('4158', '143', '900', '','0'); -- id=4160
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13188480', 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 ( '810', '810', '2026-10-21', '2', '0', '0', '2026-10-21 15:47:35','اضافة فاتورة مبيعات رقم 1170 - صرف البضاعة من المخزن','1','0',null,'0','1170','sellbillController.php?do=showDetail&sellbillid=1170'); -- id=4159
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4159', '402', '810', '','0'); -- id=4269
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12200840.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 ('4159', '382', '810', '','0'); -- id=4161
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24912653.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='4158,0,4159' where sellbillid=1170;
 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, 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, 900, 810, 810
                    , 810, 810, 810, 810, 810, 810)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+900, netSellCostBuyPrice = netSellCostBuyPrice+810
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+810
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+810
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+810
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+810
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+810
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+810
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+810;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8b411754c9 and sellbillId = 1170 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:17:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:47:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 15:47:35', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16513
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:24:34";
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-21 12:24:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:54:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 15:54:43', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16514
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-21 12:24:43";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 15:54:43', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16515
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:24:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 15:54:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 15:54:48', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16516
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:31:57";
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-21 12:31:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:01:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:01:59', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16517
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-21 12:31:59";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:01:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:01:59', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16518
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:32:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:02:03", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:02:03', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16519
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-21 12:32:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:02:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:02:56', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16520
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-21 12:32:56";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:02:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:02:56', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16521
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:32:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:02:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:02:58', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16522
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:03:01', '7', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 16:03:07', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16524
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:14", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:03:14', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16525

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8b7cb29f2b
-- ----------------------------------------------------------------------------------------------------

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-21 16:03:14', '06ad8b7cb29f2b', '1', '0.00', '0', '0', '1', '4050.00', '4050', '4050', '0', '1', '2026-10-21 16:03:14', '', '6', '0', 'نقدي', '4', '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-21','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=1171
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','اضافة فاتورة مبيعات','1171', '0', '2026-10-21 16:03:14', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:03:14','0','0','',''); -- id=1396
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6799;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02291', '1171', '203', '2291', '9', '450', '4050', '0', '', '0', '2026-10-21 16:03:14', '2291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6799-9,','1','1','0','0','450','4050','0','','0','0.00','0','0','0','0'); -- id=4780
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 = 4780;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2291, '2026-10-21', 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-21', 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 = '153', userid = '6', storedetaildate = '2026-10-21 16:03:14' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '9', '1', '1171', 'اضافة فاتورة مبيعات', 'sellbillController.php', '162', '153', '6', '2026-10-21 16:03:14','0','0'); -- id=16032
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1011115',  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 ('1007065','4050', '0', '4', 'اضافة فاتورة مبيعات', '1171', '1011115', '2026-10-21 16:03:14', '6',  'sellbillController.php','1','','0'); -- id=1450
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4050', '4050', '2026-10-21', '6', '0', '0', '2026-10-21 16:03:14','اضافة فاتورة مبيعات رقم 1171','1','0',null,'0','1171','sellbillController.php?do=showDetail&sellbillid=1171'); -- id=4160
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4160', '568', '4050', '','0'); -- id=4270
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1011115', 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 ('4160', '143', '4050', '','0'); -- id=4162
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13192530', 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-21', '6', '0', '0', '2026-10-21 16:03:14','اضافة فاتورة مبيعات رقم 1171 - صرف البضاعة من المخزن','1','0',null,'0','1171','sellbillController.php?do=showDetail&sellbillid=1171'); -- id=4161
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4161', '402', '3780', '','0'); -- id=4271
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12204620.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 ('4161', '382', '3780', '','0'); -- id=4163
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24908873.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='4160,0,4161' where sellbillid=1171;
 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-21', 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-21', 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 add end - with serial 06ad8b7cb29f2b and sellbillId = 1171 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:14", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:03:14', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16526
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-21 16:03:29', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php'); -- id=16527
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-21 16:03:30', '7', 'showallajax', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php?do=showallajax'); -- id=16528
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:33:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:03:52", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-10-21 16:03:52', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=16529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:34:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:04:01", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 16:04:01', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16530
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:34:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:04:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 16:04:09', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16531
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:34:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:04:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:04:12', '7', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16532
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:34:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:04:50", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-10-21 16:04:50', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=16533
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:35:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:05:20", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 16:05:20', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16534
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:35:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:05:38", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:05:38', '7', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16535
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:35:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:05:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:05:48', '7', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16536
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:36:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:06:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:06:40', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16537
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:36:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:06:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 16:06:45', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16538
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:36:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:06:47", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:06:47', '7', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16539
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:37:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:07:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:07:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16540
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:37:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:07:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:07:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16541
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:37:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:07:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:07:53', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16542
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:38:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:08:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:08:15', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16543
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:38:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:08:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:08:31', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16544
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:38:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:08:42", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:08:42', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16545
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:39:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:09:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:09:11', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16546
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:39:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:09:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:09:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16547
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:39:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:09:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:09:23', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16548
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:39:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:09:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:09:35', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16549
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:39:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:09:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:09:35', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16550
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:40:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:10:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:10:24', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16551
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:40:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:10:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:10:35', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16552
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:40:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:10:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:10:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16553
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:43:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:13:02", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:13:02', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16554

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8b812659cc
-- ----------------------------------------------------------------------------------------------------

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-21 16:13:02', '06ad8b812659cc', '1', '0.00', '0', '0', '1', '2100.00', '2100', '2100', '0', '1', '2026-10-21 16:13:02', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','2100','0','','0','0','2100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1172
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','اضافة فاتورة مبيعات','1172', '0', '2026-10-21 16:13:02', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2100', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:13:02','0','0','',''); -- id=1397
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('675','01491', '1172', '108', '1491', '3', '700', '2100', '0', '', '0', '2026-10-21 16:13:02', '1491', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','948-3,','1','1','0','0','700','2100','0','','0','0.00','0','0','0','0'); -- id=4781
UPDATE sellbilldetail SET  lastbuyprice = 675.00 , meanbuyprice = 675.00, lastbuyprice_withDiscount = 675.00, meanbuyprice_withDiscount = 675.00
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where sellbilldetailid = 4781;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1491, '2026-10-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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
                        , 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-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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;
UPDATE storedetail SET  productquantity = '42', userid = '6', storedetaildate = '2026-10-21 16:13:02' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '3', '1', '1172', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '42', '6', '2026-10-21 16:13:02','0','0'); -- id=16033
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1013215',  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 ('1011115','2100', '0', '4', 'اضافة فاتورة مبيعات', '1172', '1013215', '2026-10-21 16:13:02', '6',  'sellbillController.php','1','','0'); -- id=1451
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2100', '2100', '2026-10-21', '6', '0', '0', '2026-10-21 16:13:02','اضافة فاتورة مبيعات رقم 1172','1','0',null,'0','1172','sellbillController.php?do=showDetail&sellbillid=1172'); -- id=4162
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4162', '568', '2100', '','0'); -- id=4272
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1013215', 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 ('4162', '143', '2100', '','0'); -- id=4164
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13194630', 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 ( '2025', '2025', '2026-10-21', '6', '0', '0', '2026-10-21 16:13:02','اضافة فاتورة مبيعات رقم 1172 - صرف البضاعة من المخزن','1','0',null,'0','1172','sellbillController.php?do=showDetail&sellbillid=1172'); -- id=4163
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4163', '402', '2025', '','0'); -- id=4273
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12206645.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 ('4163', '382', '2025', '','0'); -- id=4165
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24906848.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='4162,0,4163' where sellbillid=1172;
 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-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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-21', 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2025, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2025
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2025, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2025
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2025, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2025
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2025
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2025
                            , 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, 2100, 2025, 2025
                    , 2025, 2025, 2025, 2025, 2025, 2025)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2100, netSellCostBuyPrice = netSellCostBuyPrice+2025
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2025
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2025
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2025
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2025
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2025
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2025
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2025;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8b812659cc and sellbillId = 1172 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:43:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:13:02", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:13:02', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16555
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:43:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:13:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:13:37', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16556
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:43:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:13:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:13:42', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16557
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:43:51";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:14:09', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=269'); -- id=16558
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:14:15', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16559
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:21";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:14:23', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=41'); -- id=16560
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:14:28', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16561
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-21 12:44:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:14:38', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16562
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-21 12:44:38";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:14:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:14:38', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16563
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:40", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:14:40', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16564
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:44:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:14:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:14:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16565
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:15:03', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16566

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8bac0155f7
-- ----------------------------------------------------------------------------------------------------

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-21 16:15:03', '06ad8bac0155f7', '1', '0.00', '0', '0', '1', '1290.00', '1290', '1290', '0', '2', '2026-10-21 16:15:03', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1290','0','','0','0','1290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1173
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','اضافة فاتورة مبيعات','1173', '0', '2026-10-21 16:15:03', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1290', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:15:03','0','0','',''); -- id=1398
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 493;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01550', '1173', '112', '1550', '3', '430', '1290', '0', '', '0', '2026-10-21 16:15:03', '1550', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','493-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4782
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 = 4782;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1550, '2026-10-21', 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 (2, '2026-10-21', 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 = '72', userid = '4', storedetaildate = '2026-10-21 16:15:03' WHERE storedetailid = '2562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1550', '2', '3', '1', '1173', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '72', '4', '2026-10-21 16:15:03','0','0'); -- id=16034
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1129232.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 ('1127942.875','1290', '0', '3', 'اضافة فاتورة مبيعات', '1173', '1129232.875', '2026-10-21 16:15:03', '4',  'sellbillController.php','1','','0'); -- id=1452
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1290', '1290', '2026-10-21', '4', '0', '0', '2026-10-21 16:15:03','اضافة فاتورة مبيعات رقم 1173','1','0',null,'0','1173','sellbillController.php?do=showDetail&sellbillid=1173'); -- id=4164
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4164', '501', '1290', '','0'); -- id=4274
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1129232.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 ('4164', '143', '1290', '','0'); -- id=4166
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13195920', 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 ( '1110', '1110', '2026-10-21', '4', '0', '0', '2026-10-21 16:15:03','اضافة فاتورة مبيعات رقم 1173 - صرف البضاعة من المخزن','1','0',null,'0','1173','sellbillController.php?do=showDetail&sellbillid=1173'); -- id=4165
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4165', '402', '1110', '','0'); -- id=4275
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12207755.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 ('4165', '492', '1110', '','0'); -- id=4167
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1593397', 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='4164,0,4165' where sellbillid=1173;
 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-21', 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;
 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-21', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1290, 1110, 1110
                    , 1110, 1110, 1110, 1110, 1110, 1110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1290, netSellCostBuyPrice = netSellCostBuyPrice+1110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1110
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1110
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1110
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8bac0155f7 and sellbillId = 1173 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:15:03', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16567
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:15:05', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16568
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:15:29', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16569
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:15:37', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16570
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:45:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:15:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:15:48', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16571
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320.00',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='294.4',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 = '2028';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2028, 1,'2026-10-21 16:16:09',7)
                ON DUPLICATE KEY UPDATE productid = 2028, edited = 1, sysdate = '2026-10-21 16:16:09', userid = 7; -- id=2984
UPDATE product SET productName = 'موديل 104&107  يورو', productDescription = '', productCatId = '166', productBuyPrice = '430.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02029',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '395.6',meanbuyprice = '430.00',meanbuyprice_withDiscount = '395.6' , productbuypricereal = '430.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.6',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='395.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 = '2029';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2029, 1,'2026-10-21 16:16:25',7)
                ON DUPLICATE KEY UPDATE productid = 2029, edited = 1, sysdate = '2026-10-21 16:16:25', userid = 7; -- id=2985
UPDATE product SET productName = 'موديل 450 يورو', productDescription = '', productCatId = '166', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02030',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '414',meanbuyprice = '450.00',meanbuyprice_withDiscount = '414' , productbuypricereal = '450.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='414',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='414',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2030';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2030, 1,'2026-10-21 16:16:40',7)
                ON DUPLICATE KEY UPDATE productid = 2030, edited = 1, sysdate = '2026-10-21 16:16:40', userid = 7; -- id=2986
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '506',meanbuyprice = '550.00',meanbuyprice_withDiscount = '506' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2031';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2031, 1,'2026-10-21 16:17:13',7)
                ON DUPLICATE KEY UPDATE productid = 2031, edited = 1, sysdate = '2026-10-21 16:17:13', userid = 7; -- id=2987
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:49:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:19:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:19:19', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16572
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 يورو','','166','375','375','0','0','2026-10-21','0','7','0','','0','0','0','0','0','375','375','375','375','375','0','0','0','0','.','0','0','0','375','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','375','375','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','375','0','0','0','0','0','0','','','0','0','0','0'); -- id=2339
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375', productSellAllPrice = '375', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375',lastbuyprice_withDiscount = '375',meanbuyprice = '375',meanbuyprice_withDiscount = '375' , productbuypricereal = '375' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='375',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='375',meanbuyprice_withTax='375',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='375',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
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', '2339', '1.00', '2026-10-21', '7', '0','0233901','375','0','0','375','','0','0','0','0','0','0','0','0','0','0'); -- id=2339
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2339', '1', '0', '7', '2026-10-21'); -- id=3733
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2339', '1', '0', '0', '2339', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16035
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2339, 1,'2026-10-21 16:19:19',7)
                ON DUPLICATE KEY UPDATE productid = 2339, edited = 1, sysdate = '2026-10-21 16:19:19', userid = 7; -- id=3456
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375',lastbuyprice_withDiscount = '375',meanbuyprice = '375',meanbuyprice_withDiscount = '375' , productbuypricereal = '375' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='375',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='375',meanbuyprice_withTax='375',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='375',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
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 ('موديل 116 يورو','','166','475','475','0','0','2026-10-21','0','7','0','','0','0','0','0','0','475','475','475','475','475','0','0','0','0','.','0','0','0','475','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','475','475','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','475','0','0','0','0','0','0','','','0','0','0','0'); -- id=2340
UPDATE product SET productName = 'موديل 116 يورو', productDescription = '', productCatId = '166', productBuyPrice = '475', productSellAllPrice = '475', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '475',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',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='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2340';
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', '2340', '1.00', '2026-10-21', '7', '0','0234001','475','0','0','475','','0','0','0','0','0','0','0','0','0','0'); -- id=2340
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2340', '1', '0', '7', '2026-10-21'); -- id=3734
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2340', '1', '0', '0', '2340', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16036
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2340, 1,'2026-10-21 16:19:19',7)
                ON DUPLICATE KEY UPDATE productid = 2340, edited = 1, sysdate = '2026-10-21 16:19:19', userid = 7; -- id=3457
UPDATE product SET productName = 'موديل 116 يورو', productDescription = '', productCatId = '166', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '475',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',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='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2340';
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 ('موديل 119 يورو','','166','470','470','0','0','2026-10-21','0','7','0','','0','0','0','0','0','470','470','470','470','470','0','0','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=2341
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470', productSellAllPrice = '470', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
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', '2341', '1.00', '2026-10-21', '7', '0','0234101','470','0','0','470','','0','0','0','0','0','0','0','0','0','0'); -- id=2341
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2341', '1', '0', '7', '2026-10-21'); -- id=3735
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2341', '1', '0', '0', '2341', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16037
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:19:19',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:19:19', userid = 7; -- id=3458
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:49:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:19:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:19:21', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16573
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:49:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:19:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:19:21', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16574
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '506',meanbuyprice = '550.00',meanbuyprice_withDiscount = '506' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2031';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2031, 1,'2026-10-21 16:20:11',7)
                ON DUPLICATE KEY UPDATE productid = 2031, edited = 1, sysdate = '2026-10-21 16:20:11', userid = 7; -- id=2987
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320.00',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='294.4',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 = '2028';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2028, 1,'2026-10-21 16:20:13',7)
                ON DUPLICATE KEY UPDATE productid = 2028, edited = 1, sysdate = '2026-10-21 16:20:13', userid = 7; -- id=2984
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320.00',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='294.4',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 = '2028';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2028, 1,'2026-10-21 16:20:24',7)
                ON DUPLICATE KEY UPDATE productid = 2028, edited = 1, sysdate = '2026-10-21 16:20:24', userid = 7; -- id=2984
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320.00',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='294.4',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 = '2028';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2028, 1,'2026-10-21 16:20:39',7)
                ON DUPLICATE KEY UPDATE productid = 2028, edited = 1, sysdate = '2026-10-21 16:20:39', userid = 7; -- id=2984
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320.00',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='294.4',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 = '2028';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2028, 1,'2026-10-21 16:20:42',7)
                ON DUPLICATE KEY UPDATE productid = 2028, edited = 1, sysdate = '2026-10-21 16:20:42', userid = 7; -- id=2984
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:50:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:20:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:20:48', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16575
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375.00',lastbuyprice_withDiscount = '375',meanbuyprice = '375.00',meanbuyprice_withDiscount = '375' , productbuypricereal = '375.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='375',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='375',meanbuyprice_withTax='375',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='375',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2339, 1,'2026-10-21 16:20:59',7)
                ON DUPLICATE KEY UPDATE productid = 2339, edited = 1, sysdate = '2026-10-21 16:20:59', userid = 7; -- id=3456
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375.00',lastbuyprice_withDiscount = '375',meanbuyprice = '375.00',meanbuyprice_withDiscount = '375' , productbuypricereal = '375.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='375',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='375',meanbuyprice_withTax='375',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='375',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2339, 1,'2026-10-21 16:21:08',7)
                ON DUPLICATE KEY UPDATE productid = 2339, edited = 1, sysdate = '2026-10-21 16:21:08', userid = 7; -- id=3456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:51:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:21:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:21:16', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16576
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375.00',lastbuyprice_withDiscount = '375',meanbuyprice = '375.00',meanbuyprice_withDiscount = '375' , productbuypricereal = '375.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='375',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='375',meanbuyprice_withTax='375',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='375',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2339, 1,'2026-10-21 16:21:27',7)
                ON DUPLICATE KEY UPDATE productid = 2339, edited = 1, sysdate = '2026-10-21 16:21:27', userid = 7; -- id=3456
UPDATE product SET productName = 'موديل 450 يورو', productDescription = '', productCatId = '166', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02030',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '414',meanbuyprice = '450.00',meanbuyprice_withDiscount = '414' , productbuypricereal = '450.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='414',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='414',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2030';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2030, 1,'2026-10-21 16:21:29',7)
                ON DUPLICATE KEY UPDATE productid = 2030, edited = 1, sysdate = '2026-10-21 16:21:29', userid = 7; -- id=2986
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:51:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:21:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:21:34', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16577
UPDATE product SET productName = 'موديل 450 يورو', productDescription = '', productCatId = '166', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02030',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '414',meanbuyprice = '450.00',meanbuyprice_withDiscount = '414' , productbuypricereal = '450.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='414',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='414',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2030';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2030, 1,'2026-10-21 16:21:43',7)
                ON DUPLICATE KEY UPDATE productid = 2030, edited = 1, sysdate = '2026-10-21 16:21:43', userid = 7; -- id=2986
UPDATE product SET productName = 'موديل 116 يورو', productDescription = '', productCatId = '166', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.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='475',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='475',meanbuyprice_withTax='475',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='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2340';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2340, 1,'2026-10-21 16:21:47',7)
                ON DUPLICATE KEY UPDATE productid = 2340, edited = 1, sysdate = '2026-10-21 16:21:47', userid = 7; -- id=3457
UPDATE product SET productName = 'موديل 116 يورو', productDescription = '', productCatId = '166', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.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='475',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='475',meanbuyprice_withTax='475',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='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2340';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2340, 1,'2026-10-21 16:21:57',7)
                ON DUPLICATE KEY UPDATE productid = 2340, edited = 1, sysdate = '2026-10-21 16:21:57', userid = 7; -- id=3457
UPDATE productunit SET proUnitBuyPrice  = 550.00 * productnumber WHERE productid = 2031;
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '506',meanbuyprice = '550.00',meanbuyprice_withDiscount = '506' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2031';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2031, 1,'2026-10-21 16:21:58',7)
                ON DUPLICATE KEY UPDATE productid = 2031, edited = 1, sysdate = '2026-10-21 16:21:58', userid = 7; -- id=2987
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '506',meanbuyprice = '550.00',meanbuyprice_withDiscount = '506' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2031';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2031, 1,'2026-10-21 16:22:00',7)
                ON DUPLICATE KEY UPDATE productid = 2031, edited = 1, sysdate = '2026-10-21 16:22:00', userid = 7; -- id=2987
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '506',meanbuyprice = '550.00',meanbuyprice_withDiscount = '506' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='506',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2031';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2031, 1,'2026-10-21 16:22:16',7)
                ON DUPLICATE KEY UPDATE productid = 2031, edited = 1, sysdate = '2026-10-21 16:22:16', userid = 7; -- id=2987
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '470.00',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.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='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:22:19',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:22:19', userid = 7; -- id=3458
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:53:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:23:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:23:04', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16578
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 ('06ad8bbd970b2b', '2026-10-21 16:19:21', '176', '149510.40', '288452.4', '7', '1', '149400.00',  '138942.00', '0', '138942', '1', '2026-10-21 16:23:04', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=292
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 ('02028', '292', '166', '2028', '36', '320', '11520.00', '0', '', '2026-10-21 16:23:04', '2028','','','0','0','0','0','0',null,'320','11520','0','0','0','0','0','0','0','0','1'); -- id=1637
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2028, 0, 0
                    , 297.6, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 297.6,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6948
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2028', '320', '36', '0', 'buyBillController.php', '1637', '', '0', '0'); -- id=1196
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2028 ;
UPDATE buybilldetail SET  quantitybefore = 6 WHERE buybilldetailid = 1637 ;
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '297.6',meanbuyprice = '320',meanbuyprice_withDiscount = '297.14' , 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='294.4',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='297.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 = '2028';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 297.6, meanbuyprice_withDiscount = 297.14
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where buybilldetailid = 1637;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2028;
UPDATE storedetail SET  productquantity = '42', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '6', '42', '7', '2026-10-21 16:19:21','0','0'); -- id=16038
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 ('02028', '292', '166', '2028', '36', '320', '11520.00', '0', '', '2026-10-21 16:23:04', '2028','','','0','0','0','0','0',null,'320','11520','0','0','0','0','0','0','0','0','1'); -- id=1638
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2028, 0, 0
                    , 297.6, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 297.6,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6948
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2028', '320', '36', '0', 'buyBillController.php', '1638', '', '0', '0'); -- id=1197
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2028 ;
UPDATE buybilldetail SET  quantitybefore = 42 WHERE buybilldetailid = 1638 ;
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '297.6',meanbuyprice = '320',meanbuyprice_withDiscount = '297.53' , 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='294.4',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='297.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 = '2028';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 297.6, meanbuyprice_withDiscount = 297.53
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where buybilldetailid = 1638;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2028;
UPDATE storedetail SET  productquantity = '78', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '42', '78', '7', '2026-10-21 16:19:21','0','0'); -- id=16039
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 ('02339', '292', '166', '2339', '36', '375', '13500.00', '0', '', '2026-10-21 16:23:04', '2339','','','0','0','0','0','0',null,'375','13500','0','0','0','0','0','0','0','0','1'); -- id=1639
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2339, 0, 0
                    , 348.75, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 348.75,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6950
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2339', '375', '36', '0', 'buyBillController.php', '1639', '', '0', '0'); -- id=1198
UPDATE product SET  productBuyPrice = "375" WHERE productId = 2339 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1639 ;
UPDATE product SET productName = 'موديل 202 يورو', productDescription = '', productCatId = '166', productBuyPrice = '375.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '375',lastbuyprice_withDiscount = '348.75',meanbuyprice = '375',meanbuyprice_withDiscount = '348.75' , productbuypricereal = '375.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='375',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='375',meanbuyprice_withTax='375',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='348.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2339';
UPDATE buybilldetail SET  lastbuyprice = 375 , meanbuyprice = 375, lastbuyprice_withDiscount = 348.75, meanbuyprice_withDiscount = 348.75
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 348.75
                where buybilldetailid = 1639;
UPDATE productunit SET proUnitBuyPrice  = 375 * productnumber WHERE productid = 2339;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2339', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 16:19:21','0','0'); -- id=16040
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 ('02028', '292', '166', '2028', '36', '320', '11520.00', '0', '', '2026-10-21 16:23:04', '2028','','','0','0','0','0','0',null,'320','11520','0','0','0','0','0','0','0','0','1'); -- id=1640
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2028, 0, 0
                    , 297.6, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 297.6,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6948
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2028', '320', '36', '0', 'buyBillController.php', '1640', '', '0', '0'); -- id=1199
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2028 ;
UPDATE buybilldetail SET  quantitybefore = 78 WHERE buybilldetailid = 1640 ;
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '297.6',meanbuyprice = '320',meanbuyprice_withDiscount = '297.59' , 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='294.4',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='297.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 = '2028';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 297.6, meanbuyprice_withDiscount = 297.59
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where buybilldetailid = 1640;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2028;
UPDATE storedetail SET  productquantity = '114', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '78', '114', '7', '2026-10-21 16:19:21','0','0'); -- id=16041
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 ('02028', '292', '166', '2028', '36', '320', '11520.00', '0', '', '2026-10-21 16:23:04', '2028','','','0','0','0','0','0',null,'320','11520','0','0','0','0','0','0','0','0','1'); -- id=1641
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2028, 0, 0
                    , 297.6, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 297.6,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6948
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2028', '320', '36', '0', 'buyBillController.php', '1641', '', '0', '0'); -- id=1200
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2028 ;
UPDATE buybilldetail SET  quantitybefore = 114 WHERE buybilldetailid = 1641 ;
UPDATE product SET productName = 'موديل 320 يورو', productDescription = '', productCatId = '166', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02028',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '297.6',meanbuyprice = '320',meanbuyprice_withDiscount = '297.6' , 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='294.4',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='297.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 = '2028';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 297.6, meanbuyprice_withDiscount = 297.6
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where buybilldetailid = 1641;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2028;
UPDATE storedetail SET  productquantity = '150', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '114', '150', '7', '2026-10-21 16:19:21','0','0'); -- id=16042
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 ('02030', '292', '166', '2030', '36', '450', '16200.00', '0', '', '2026-10-21 16:23:04', '2030','','','0','0','0','0','0',null,'450','16200','0','0','0','0','0','0','0','0','1'); -- id=1642
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2030, 0, 0
                    , 418.5, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 418.5,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6953
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2030', '450', '36', '0', 'buyBillController.php', '1642', '', '0', '0'); -- id=1201
UPDATE product SET  productBuyPrice = "450" WHERE productId = 2030 ;
UPDATE buybilldetail SET  quantitybefore = 81 WHERE buybilldetailid = 1642 ;
UPDATE product SET productName = 'موديل 450 يورو', productDescription = '', productCatId = '166', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02030',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '418.5',meanbuyprice = '450',meanbuyprice_withDiscount = '415.38' , productbuypricereal = '450.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='414',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='418.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 = '2030';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 418.5, meanbuyprice_withDiscount = 415.38
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 418.5
                where buybilldetailid = 1642;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 2030;
UPDATE storedetail SET  productquantity = '117', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3389';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2030', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '81', '117', '7', '2026-10-21 16:19:21','0','0'); -- id=16043
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 ('02340', '292', '166', '2340', '36', '475', '17100.00', '0', '', '2026-10-21 16:23:04', '2340','','','0','0','0','0','0',null,'475','17100','0','0','0','0','0','0','0','0','1'); -- id=1643
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2340, 0, 0
                    , 441.75, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 441.75,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6954
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2340', '475', '36', '0', 'buyBillController.php', '1643', '', '0', '0'); -- id=1202
UPDATE product SET  productBuyPrice = "475" WHERE productId = 2340 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1643 ;
UPDATE product SET productName = 'موديل 116 يورو', productDescription = '', productCatId = '166', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '441.75',meanbuyprice = '475',meanbuyprice_withDiscount = '441.75' , productbuypricereal = '475.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='475',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='475',meanbuyprice_withTax='475',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='441.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2340';
UPDATE buybilldetail SET  lastbuyprice = 475 , meanbuyprice = 475, lastbuyprice_withDiscount = 441.75, meanbuyprice_withDiscount = 441.75
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 441.75
                where buybilldetailid = 1643;
UPDATE productunit SET proUnitBuyPrice  = 475 * productnumber WHERE productid = 2340;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3734';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2340', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 16:19:21','0','0'); -- id=16044
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 ('02031', '292', '166', '2031', '36', '550', '19800.00', '0', '', '2026-10-21 16:23:04', '2031','','','0','0','0','0','0',null,'550','19800','0','0','0','0','0','0','0','0','1'); -- id=1644
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2031, 0, 0
                    , 511.5, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 511.5,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6955
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2031', '550', '36', '0', 'buyBillController.php', '1644', '', '0', '0'); -- id=1203
UPDATE product SET  productBuyPrice = "550" WHERE productId = 2031 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1644 ;
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '511.5',meanbuyprice = '550',meanbuyprice_withDiscount = '509.3' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='511.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 = '2031';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 511.5, meanbuyprice_withDiscount = 509.3
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 511.5
                where buybilldetailid = 1644;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 2031;
UPDATE storedetail SET  productquantity = '60', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2031', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '60', '7', '2026-10-21 16:19:21','0','0'); -- id=16045
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 ('02341', '292', '166', '2341', '36', '470', '16920.00', '0', '', '2026-10-21 16:23:04', '2341','','','0','0','0','0','0',null,'470','16920','0','0','0','0','0','0','0','0','1'); -- id=1645
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2341, 0, 0
                    , 437.1, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 437.1,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6956
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2341', '470', '36', '0', 'buyBillController.php', '1645', '', '0', '0'); -- id=1204
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2341 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1645 ;
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='470',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 437.1, meanbuyprice_withDiscount = 437.1
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 437.1
                where buybilldetailid = 1645;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2341;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2341', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 16:19:21','0','0'); -- id=16046
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 ('02031', '292', '166', '2031', '36', '550', '19800.00', '0', '', '2026-10-21 16:23:04', '2031','','','0','0','0','0','0',null,'550','19800','0','0','0','0','0','0','0','0','1'); -- id=1646
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:19:21', 1, 2031, 0, 0
                    , 511.5, 36, 0, 0, 7, '2026-10-21 16:23:04')
                ON DUPLICATE KEY UPDATE buyprice = 511.5,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:23:04' ; -- id=6955
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2031', '550', '36', '0', 'buyBillController.php', '1646', '', '0', '0'); -- id=1205
UPDATE product SET  productBuyPrice = "550" WHERE productId = 2031 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1646 ;
UPDATE product SET productName = 'موديل550 يورو', productDescription = '', productCatId = '166', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02031',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '511.5',meanbuyprice = '550',meanbuyprice_withDiscount = '510.62' , productbuypricereal = '550.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='506',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='550',meanbuyprice_withTax='550',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='511.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 = '2031';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 511.5, meanbuyprice_withDiscount = 510.62
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 511.5
                where buybilldetailid = 1646;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 2031;
UPDATE storedetail SET  productquantity = '96', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2031', '1', '36', '0', '292', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '96', '7', '2026-10-21 16:19:21','0','0'); -- id=16047
UPDATE supplier SET  suppliercurrentDebt = '288452.4',suppliercurrentDebtInCurrency= '288452.4' , userid = '7', supplierdate = '2026-10-21 16:23:04'   WHERE supplierid = '176';
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 ('176', '149510.40', '138942', '0', 'اضافة فاتورة مشتريات', '292', '288452.4', '2026-10-21 16:19:21', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','138942','1','149510.4','138942','288452.4','0',''); -- id=809
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '138942', '138942', '2026-10-21', '7', '0', '0', '2026-10-21 16:23:04','اضافة فاتورة مشتريات رقم 292','1','0',null,'0','292','buyBillController.php?do=details&id=292'); -- id=4166
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4166', '382', '138942', '','0'); -- id=4276
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25045790.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 ('4166', '659', '138942', '','0'); -- id=4168
UPDATE accountstree SET name = 'يورو', customName = 'يورو', customNameEn = 'يورو', nameEn = 'يورو', parent = '81', accountNature = '1', theValue = '288452.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 19:15:02' WHERE id = '659';
update buybill set dailyentryid='4166,0' where buybillid=292;
COMMIT;
UPDATE product SET overAllAveragePrice = 296.96 WHERE productId = 2028;UPDATE product SET overAllAveragePrice = 415.12 WHERE productId = 2030;UPDATE product SET overAllAveragePrice = 510.12 WHERE productId = 2031;UPDATE product SET overAllAveragePrice = 348.75 WHERE productId = 2339;UPDATE product SET overAllAveragePrice = 441.75 WHERE productId = 2340;UPDATE product SET overAllAveragePrice = 437.1 WHERE productId = 2341;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:53:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:23:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:23:04', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=292'); -- id=16579
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:53:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:23:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:23:09', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=292&type=2'); -- id=16580
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:55:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:25:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:25:36', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16581
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:55:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:25:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:25:42', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16582
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:56:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:26:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:26:15', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16583
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:56:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:26:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 16:26:41', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16584
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:27:07', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16585

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ba5e96fe2
-- ----------------------------------------------------------------------------------------------------

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-21 16:27:07', '06ad8ba5e96fe2', '1', '0.00', '0', '0', '1', '4200.00', '4200', '4200', '0', '1', '2026-10-21 16:27:07', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','4200','0','','0','0','4200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1174
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','اضافة فاتورة مبيعات','1174', '0', '2026-10-21 16:27:07', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:27:07','0','0','',''); -- id=1399
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('675','01491', '1174', '108', '1491', '6', '700', '4200', '0', '', '0', '2026-10-21 16:27:07', '1491', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','948-6,','1','1','0','0','700','4200','0','','0','0.00','0','0','0','0'); -- id=4783
UPDATE sellbilldetail SET  lastbuyprice = 675.00 , meanbuyprice = 675.00, lastbuyprice_withDiscount = 675.00, meanbuyprice_withDiscount = 675.00
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where sellbilldetailid = 4783;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1491, '2026-10-21', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:27:07' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '6', '1', '1174', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '36', '6', '2026-10-21 16:27:07','0','0'); -- id=16048
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1017415',  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 ('1013215','4200', '0', '4', 'اضافة فاتورة مبيعات', '1174', '1017415', '2026-10-21 16:27:07', '6',  'sellbillController.php','1','','0'); -- id=1453
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4200', '4200', '2026-10-21', '6', '0', '0', '2026-10-21 16:27:07','اضافة فاتورة مبيعات رقم 1174','1','0',null,'0','1174','sellbillController.php?do=showDetail&sellbillid=1174'); -- id=4167
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4167', '568', '4200', '','0'); -- id=4277
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1017415', 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 ('4167', '143', '4200', '','0'); -- id=4169
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13200120', 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 ( '4050', '4050', '2026-10-21', '6', '0', '0', '2026-10-21 16:27:07','اضافة فاتورة مبيعات رقم 1174 - صرف البضاعة من المخزن','1','0',null,'0','1174','sellbillController.php?do=showDetail&sellbillid=1174'); -- id=4168
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4168', '402', '4050', '','0'); -- id=4278
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12211805.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 ('4168', '382', '4050', '','0'); -- id=4170
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25041740.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='4167,0,4168' where sellbillid=1174;
 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-21', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, 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-21', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, 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, 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050, 4050, 4050)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4200, netSellCostBuyPrice = netSellCostBuyPrice+4050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4050
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4050
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4050;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ba5e96fe2 and sellbillId = 1174 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:27:07', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16586
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:27:11', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16587
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:27:19', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16588
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:27:24', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16589
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:27:26', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=162'); -- id=16590
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:27:38', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16591
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 12:57:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:27:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:27:40', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=292'); -- id=16592
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:00:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:30:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 16:30:47', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16593
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:01:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:31:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:31:12', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16594
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:34:23',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:34:23', userid = 7; -- id=3458
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:34:49',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:34:49', userid = 7; -- id=3458
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:35:57',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:35:57', userid = 7; -- id=3458
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:37:02', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16595
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-21 13:07:02";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:37:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:37:02', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16596
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:37:07', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16597
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:37:12', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16598

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8bc5ea1548
-- ----------------------------------------------------------------------------------------------------

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-21 16:37:12', '06ad8bc5ea1548', '1', '0.00', '0', '0', '1', '525.00', '525', '525', '0', '1', '2026-10-21 16:37:12', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','525','0','','0','0','525','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1175
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','اضافة فاتورة مبيعات','1175', '0', '2026-10-21 16:37:12', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '525', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:37:12','0','0','',''); -- id=1400
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6114;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02072', '1175', '171', '2072', '1', '525', '525', '0', '', '0', '2026-10-21 16:37:12', '2072', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6114-1,','1','1','0','0','525','525','0','','0','0.00','0','0','0','0'); -- id=4784
UPDATE sellbilldetail SET  lastbuyprice = 505.00 , meanbuyprice = 505.00, lastbuyprice_withDiscount = 505.00, meanbuyprice_withDiscount = 505.00
        , lastbuyprice_withTax = 505, meanbuyprice_withTax = 505, lastbuyprice_withDiscountAndTax = 505
                where sellbilldetailid = 4784;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2072, '2026-10-21', 525, 505, 505
                    , 505, 505, 505, 505
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 505, 505, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+505
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+505
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+505
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+505
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+505
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 525, 505, 505
                    , 505, 505, 505, 505
                    , 0, 0, 0, 0
                    , 0, 0, 0, 505, 505, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+505
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+505
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+505
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+505
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+505
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2026-10-21 16:37:12' WHERE storedetailid = '3431';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2072', '1', '1', '1', '1175', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '2', '2026-10-21 16:37:12','0','0'); -- id=16049
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7208653.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 ('7208128.5','525', '0', '2', 'اضافة فاتورة مبيعات', '1175', '7208653.5', '2026-10-21 16:37:12', '2',  'sellbillController.php','1','','0'); -- id=1454
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '525', '525', '2026-10-21', '2', '0', '0', '2026-10-21 16:37:12','اضافة فاتورة مبيعات رقم 1175','1','0',null,'0','1175','sellbillController.php?do=showDetail&sellbillid=1175'); -- id=4169
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4169', '419', '525', '','0'); -- id=4279
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7208653', 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 ('4169', '143', '525', '','0'); -- id=4171
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13200645', 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 ( '505', '505', '2026-10-21', '2', '0', '0', '2026-10-21 16:37:12','اضافة فاتورة مبيعات رقم 1175 - صرف البضاعة من المخزن','1','0',null,'0','1175','sellbillController.php?do=showDetail&sellbillid=1175'); -- id=4170
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4170', '402', '505', '','0'); -- id=4280
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12212310.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 ('4170', '382', '505', '','0'); -- id=4172
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25041235.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='4169,0,4170' where sellbillid=1175;
 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-21', 525, 505, 505
                    , 505, 505, 505, 505
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,505, 505, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+505
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+505
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+505
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+505
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+505
                        , returnSellVal = returnSellVal+0, 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-21', 525, 505, 505
                    , 505, 505, 505, 505
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,505, 505, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+505
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+505, sellCostMeanBuyPrice = sellCostMeanBuyPrice+505
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+505, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+505
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+505
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+505
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+505
                        , returnSellVal = returnSellVal+0, 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, 525, 505, 505
                    , 505, 505, 505, 505, 505, 505)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+525, netSellCostBuyPrice = netSellCostBuyPrice+505
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+505
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+505
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+505
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+505
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+505
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+505
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+505;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8bc5ea1548 and sellbillId = 1175 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:37:12', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16599
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:37:25', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16600
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:37:29', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16601
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:07:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:37:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 16:37:49', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=19'); -- id=16602
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:38:14', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16603
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-21 13:08:14";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:38:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:38:14', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16604
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:38:16', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16605
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 16:38:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=16606
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 16:38:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=16607
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:38:27', '1', 'editreturn', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editreturn&id=19'); -- id=16608
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:38:33', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16609
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 4) and  modelid = 19;
UPDATE returnbuybill SET  returnbuybillsysdate = '2026-10-21 16:38:33', userid = null,delbyuserid = '1', conditions = '1' WHERE returnbuybillid = '19';
UPDATE returnbuybilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 435.00, meanbuyprice_withTax = 530.00, lastbuyprice_withDiscountAndTax = 435.00
                where returnbuybilldetailid = 68;
UPDATE product SET productName = 'شروال vip 450', productDescription = '', productCatId = '29', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '98761',type ='0', expireDate = '0' , dailyentryId = '317',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.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='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='98761',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='435',meanbuyprice_withTax='430',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='435',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 = '962';
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 962;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '962';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('962', '1', '20', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '-1', '19', '1', '2026-10-13 15:39:37','0','0'); -- id=16050
UPDATE returnbuybilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385.00, meanbuyprice_withTax = 0.00, lastbuyprice_withDiscountAndTax = 385.00
                where returnbuybilldetailid = 69;
UPDATE product SET productName = 'ريلاكسيد حزام و قصات VIP', productDescription = '', productCatId = '29', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08761',type ='0', expireDate = '0' , dailyentryId = '312',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '380.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='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8761',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='385',meanbuyprice_withTax='385',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='385',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 = '957';
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 957;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '957';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('957', '1', '50', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '0', '50', '1', '2026-10-13 15:39:37','0','0'); -- id=16051
UPDATE returnbuybilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500.00, meanbuyprice_withTax = 0.00, lastbuyprice_withDiscountAndTax = 500.00
                where returnbuybilldetailid = 70;
UPDATE product SET productName = 'بنطلون فليرد في اي بي', productDescription = '', productCatId = '29', productBuyPrice = '500.00', productSellAllPrice = '520.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08212',type ='0', expireDate = '0' , dailyentryId = '311',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.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='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8212',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='500',meanbuyprice_withTax='500',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='500',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 = '956';
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 956;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '956';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('956', '1', '35', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '0', '35', '1', '2026-10-13 15:39:37','0','0'); -- id=16052
UPDATE returnbuybilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 445.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 445.00
        , lastbuyprice_withTax = 450.00, meanbuyprice_withTax = 0.00, lastbuyprice_withDiscountAndTax = 450.00
                where returnbuybilldetailid = 71;
UPDATE product SET productName = 'شروال استل في رجل', productDescription = '', productCatId = '29', productBuyPrice = '445.00', productSellAllPrice = '465.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09430',type ='0', expireDate = '0' , dailyentryId = '314',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '445.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='445',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9430',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='450',meanbuyprice_withTax='450',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='450',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 = '959';
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 959;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '959';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('959', '1', '35', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '0', '35', '1', '2026-10-13 15:39:37','0','0'); -- id=16053
UPDATE returnbuybilldetail SET  lastbuyprice = 445.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 445.00, meanbuyprice_withDiscount = 395.00
        , lastbuyprice_withTax = 445.00, meanbuyprice_withTax = 395.00, lastbuyprice_withDiscountAndTax = 445.00
                where returnbuybilldetailid = 72;
UPDATE product SET productName = 'بنطلون قصات في اي بي 460', productDescription = '', productCatId = '29', productBuyPrice = '445.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09354',type ='0', expireDate = '0' , dailyentryId = '313',isService = '0',isOptic = '0',lastbuyprice = '445',lastbuyprice_withDiscount = '445',meanbuyprice = '440',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='9354',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='445',meanbuyprice_withTax='440',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='445',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 = '958';
UPDATE productunit SET proUnitBuyPrice  = 445 * productnumber WHERE productid = 958;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '958';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('958', '1', '45', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '5', '50', '1', '2026-10-13 15:39:37','0','0'); -- id=16054
UPDATE returnbuybilldetail SET  lastbuyprice = 405.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 405.00, meanbuyprice_withTax = 0.00, lastbuyprice_withDiscountAndTax = 405.00
                where returnbuybilldetailid = 73;
UPDATE product SET productName = 'بنطلون بالون في اي بي 420', productDescription = '', productCatId = '29', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '40078',type ='0', expireDate = '0' , dailyentryId = '308',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='40078',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 = '953';
UPDATE productunit SET proUnitBuyPrice  = 405 * productnumber WHERE productid = 953;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '953';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('953', '1', '15', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '0', '15', '1', '2026-10-13 15:39:37','0','0'); -- id=16055
UPDATE returnbuybilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 575.00, lastbuyprice_withDiscount = 480.00, meanbuyprice_withDiscount = 575.00
        , lastbuyprice_withTax = 480.00, meanbuyprice_withTax = 575.00, lastbuyprice_withDiscountAndTax = 480.00
                where returnbuybilldetailid = 74;
UPDATE product SET productName = 'بنطلون طوكيو vip', productDescription = '', productCatId = '29', productBuyPrice = '480.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '06292',type ='0', expireDate = '0' , dailyentryId = '309',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.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='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='6292',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='480',meanbuyprice_withTax='475',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='480',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 = '954';
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 954;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '954';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('954', '1', '20', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '-1', '19', '1', '2026-10-13 15:39:37','0','0'); -- id=16056
UPDATE returnbuybilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435.00, meanbuyprice_withTax = 0.00, lastbuyprice_withDiscountAndTax = 435.00
                where returnbuybilldetailid = 75;
UPDATE product SET productName = 'ال في و حزام في اي بي 450', productDescription = '', productCatId = '29', productBuyPrice = '435.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09670',type ='0', expireDate = '0' , dailyentryId = '315',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '430.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='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9670',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='435',meanbuyprice_withTax='435',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='435',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 = '960';
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 960;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '960';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('960', '1', '90', '0', '19', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '0', '90', '1', '2026-10-13 15:39:37','0','0'); -- id=16057
UPDATE supplier SET  suppliercurrentDebt = '162890',suppliercurrentDebtInCurrency= '162890' , userid = '1', supplierdate = '2026-10-21 16:38:33'   WHERE supplierid = '8';
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 ('8', '26840.00', '136050', '0', 'حذف فاتورة مردودات مشتريات', '19', '162890', '2026-10-13 15:39:37', '1', 'returnBuyBillController.php', 'حذف فاتورة مردودات مشتريات', '0','', '0','1','1','136050','1','26840','-136050','162890','0',''); -- id=810
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 ('-41945306.00','0', '1', '1', 'حذف فاتورة مردودات مشتريات', '19', '-41945306', '2026-10-13 15:39:37', '1',  'returnBuyBillController.php','0','','0'); -- id=1455
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06ace26898aae4', '2026-10-13 15:39:37', '8', '162890.00', '27275', '0', '0', '-135615.00', '-135615.00', '0.00', '-135615', '1', '2026-10-21 16:38:33', '', '1', '0', '', '1', '6' ,'1' ,'19','returnBuyBillController.php','0.00','-1','1','0','0','0','0','0'); -- id=33
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('98761', '33', '29', '962', '19', '435', '8265', '0.00', '', '962','','','0','0','0','0','0','435','8265','0','0','0','0','0','0','0','1'); -- id=172
UPDATE product SET productName = 'شروال vip 450', productDescription = '', productCatId = '29', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '98761',type ='0', expireDate = '0' , dailyentryId = '317',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '434.75',meanbuyprice_withDiscount = '434.75' , productbuypricereal = '430.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='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='98761',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='435',meanbuyprice_withTax='434.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='1',lastbuyprice_withDiscountAndTax='435',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 = '962';
UPDATE returnbuybilldetail SET  lastbuyprice = 435 , meanbuyprice = 434.75, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 434.75
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 434.75, lastbuyprice_withDiscountAndTax = 435
                where returnbuybilldetailid = 172;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 962;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '962';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('962', '1', '19', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '19', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16058
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('08761', '33', '29', '957', '50.00', '385', '19250', '0.00', '', '957','','','0','0','0','0','0','385','19250','0','0','0','0','0','0','0','1'); -- id=173
UPDATE product SET productName = 'ريلاكسيد حزام و قصات VIP', productDescription = '', productCatId = '29', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08761',type ='0', expireDate = '0' , dailyentryId = '312',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '380.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='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8761',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='385',meanbuyprice_withTax='385',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='385',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 = '957';
UPDATE returnbuybilldetail SET  lastbuyprice = 385 , meanbuyprice = 385, lastbuyprice_withDiscount = 385, meanbuyprice_withDiscount = 385
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where returnbuybilldetailid = 173;
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 957;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '957';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('957', '1', '50', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '50', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16059
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('08212', '33', '29', '956', '35.00', '500', '17500', '0.00', '', '956','','','0','0','0','0','0','500','17500','0','0','0','0','0','0','0','1'); -- id=174
UPDATE product SET productName = 'بنطلون فليرد في اي بي', productDescription = '', productCatId = '29', productBuyPrice = '500.00', productSellAllPrice = '520.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08212',type ='0', expireDate = '0' , dailyentryId = '311',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.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='500',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8212',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='500',meanbuyprice_withTax='500',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='500',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 = '956';
UPDATE returnbuybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 500, meanbuyprice_withDiscount = 500
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where returnbuybilldetailid = 174;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 956;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '956';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('956', '1', '35', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '35', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16060
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09430', '33', '29', '959', '35.00', '450', '15750', '0.00', '', '959','','','0','0','0','0','0','450','15750','0','0','0','0','0','0','0','1'); -- id=175
UPDATE product SET productName = 'شروال استل في رجل', productDescription = '', productCatId = '29', productBuyPrice = '445.00', productSellAllPrice = '465.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09430',type ='0', expireDate = '0' , dailyentryId = '314',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '445.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='445',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9430',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='450',meanbuyprice_withTax='450',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='450',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 = '959';
UPDATE returnbuybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 450, meanbuyprice_withDiscount = 450
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where returnbuybilldetailid = 175;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 959;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '959';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('959', '1', '35', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '35', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16061
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09354', '33', '29', '958', '45.00', '445', '20025', '0.00', '', '958','','','0','0','0','0','0','445','20025','0','0','0','0','0','0','0','1'); -- id=176
UPDATE product SET productName = 'بنطلون قصات في اي بي 460', productDescription = '', productCatId = '29', productBuyPrice = '445.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09354',type ='0', expireDate = '0' , dailyentryId = '313',isService = '0',isOptic = '0',lastbuyprice = '445',lastbuyprice_withDiscount = '445',meanbuyprice = '445.63',meanbuyprice_withDiscount = '445.63' , 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='9354',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='445',meanbuyprice_withTax='445.63',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='445',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 = '958';
UPDATE returnbuybilldetail SET  lastbuyprice = 445 , meanbuyprice = 445.63, lastbuyprice_withDiscount = 445, meanbuyprice_withDiscount = 445.63
        , lastbuyprice_withTax = 445, meanbuyprice_withTax = 445.63, lastbuyprice_withDiscountAndTax = 445
                where returnbuybilldetailid = 176;
UPDATE productunit SET proUnitBuyPrice  = 445 * productnumber WHERE productid = 958;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '958';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('958', '1', '45', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '50', '5', '1', '2026-10-13 15:39:37','0','0'); -- id=16062
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('40078', '33', '29', '953', '15.00', '405', '6075', '0.00', '', '953','','','0','0','0','0','0','405','6075','0','0','0','0','0','0','0','1'); -- id=177
UPDATE product SET productName = 'بنطلون بالون في اي بي 420', productDescription = '', productCatId = '29', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '40078',type ='0', expireDate = '0' , dailyentryId = '308',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='40078',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 = '953';
UPDATE returnbuybilldetail SET  lastbuyprice = 405 , meanbuyprice = 405, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 405, meanbuyprice_withTax = 405, lastbuyprice_withDiscountAndTax = 405
                where returnbuybilldetailid = 177;
UPDATE productunit SET proUnitBuyPrice  = 405 * productnumber WHERE productid = 953;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '953';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('953', '1', '15', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '15', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16063
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('06292', '33', '29', '954', '20.00', '480', '9600', '0.00', '', '954','','','0','0','0','0','0','480','9600','0','0','0','0','0','0','0','1'); -- id=178
UPDATE product SET productName = 'بنطلون طوكيو vip', productDescription = '', productCatId = '29', productBuyPrice = '480.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '06292',type ='0', expireDate = '0' , dailyentryId = '309',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '479.76',meanbuyprice_withDiscount = '479.76' , productbuypricereal = '475.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='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='6292',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='480',meanbuyprice_withTax='479.76',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='480',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 = '954';
UPDATE returnbuybilldetail SET  lastbuyprice = 480 , meanbuyprice = 479.76, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 479.76
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 479.76, lastbuyprice_withDiscountAndTax = 480
                where returnbuybilldetailid = 178;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 954;
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '954';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('954', '1', '20', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '19', '-1', '1', '2026-10-13 15:39:37','0','0'); -- id=16064
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09670', '33', '29', '960', '90.00', '435', '39150', '0.00', '', '960','','','0','0','0','0','0','435','39150','0','0','0','0','0','0','0','1'); -- id=179
UPDATE product SET productName = 'ال في و حزام في اي بي 450', productDescription = '', productCatId = '29', productBuyPrice = '435.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09670',type ='0', expireDate = '0' , dailyentryId = '315',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '430.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='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9670',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='435',meanbuyprice_withTax='435',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='435',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 = '960';
UPDATE returnbuybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where returnbuybilldetailid = 179;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 960;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '960';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('960', '1', '90', '1', '33', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '90', '0', '1', '2026-10-13 15:39:37','0','0'); -- id=16065
UPDATE supplier SET  suppliercurrentDebt = '27275',suppliercurrentDebtInCurrency= '27275' , userid = '1', supplierdate = '2026-10-21 16:38:33'   WHERE supplierid = '8';
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 ('8', '162890.00', '135615', '1', 'اضافة فاتورة مردوات مشتريات', '33', '27275', '2026-10-13 15:39:37', '1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','136050','1','162890','135615','27275','0',''); -- id=811
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 ('-41945306.00','0', '0', '1', 'اضافة فاتورة مردوات مشتريات', '33', '-41945306', '2026-10-13 15:39:37', '1',  'returnBuyBillController.php','0','','0'); -- id=1456
UPDATE dailyentry SET totalcreditor = '136050.00', totaldebtor = '136050.00', thedate = '2026-10-13', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-13 15:47:23', entryComment = 'اضافة فاتورة مردود مشتريات رقم 19', fromFlag = '1',related='0',isopeningentry='0',operationId='19',operationDetailLink='returnBuyBillController.php?do=details&id=19' WHERE id = '2265';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '136050.00', '136050.00', '2026-10-21', '1', '0', '2265', '2026-10-21 16:38:33','تم عكس القيد رقم 2265 ','1','0','0','0','0',''); -- id=4171
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4171', '427', '136050.00', '','0'); -- id=4173
UPDATE accountstree SET name = 'رامي في اي بي - مورد', customName = 'رامي في اي بي - مورد', customNameEn = 'رامي في اي بي - مورد', nameEn = 'رامي في اي بي - مورد', parent = '81', accountNature = '1', theValue = '-20000', 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 = '427';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4171', '382', '136050.00', '','0'); -- id=4281
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25177285.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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '135615', '135615', '2026-10-21', '1', '0', '0', '2026-10-21 16:38:33','اضافة فاتورة مردود مشتريات رقم 33','1','0',null,'0','33','returnBuyBillController.php?do=details&id=33'); -- id=4172
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4172', '427', '135615', '','0'); -- id=4282
UPDATE accountstree SET name = 'رامي في اي بي - مورد', customName = 'رامي في اي بي - مورد', customNameEn = 'رامي في اي بي - مورد', nameEn = 'رامي في اي بي - مورد', parent = '81', accountNature = '1', theValue = '-155615', 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 = '427';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4172', '382', '135615', '','0'); -- id=4174
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25041670.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 returnbuybill set dailyentryid='4172,0' where returnbuybillid=33;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 16:38:34', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=editprint&id=33'); -- id=16610
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:38:56', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16611

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8bea08bdbd
-- ----------------------------------------------------------------------------------------------------

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-21 16:38:56', '06ad8bea08bdbd', '1', '0.00', '0', '0', '1', '20350.00', '20350', '20350', '0', '1', '2026-10-21 16:38:56', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '35' ,'0','','','','','-1','0','0','0','0','0','20350','0','','0','0','20350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1176
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','اضافة فاتورة مبيعات','1176', '0', '2026-10-21 16:38:56', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '20350', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:38:56','0','0','',''); -- id=1401
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6899;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('720','02329', '1176', '28', '2329', '5', '740', '3700', '0', '', '0', '2026-10-21 16:38:56', '2329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6899-5,','1','1','0','0','740','3700','0','','0','0.00','0','0','0','0'); -- id=4785
UPDATE sellbilldetail SET  lastbuyprice = 720.00 , meanbuyprice = 720.00, lastbuyprice_withDiscount = 720.00, meanbuyprice_withDiscount = 720.00
        , lastbuyprice_withTax = 720, meanbuyprice_withTax = 720, lastbuyprice_withDiscountAndTax = 720
                where sellbilldetailid = 4785;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2329, '2026-10-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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+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-21', 3700, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3700, 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 = '0', userid = '2', storedetaildate = '2026-10-21 16:38:56' WHERE storedetailid = '3723';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2329', '1', '5', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 16:38:56','0','0'); -- id=16066
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09511', '1176', '19', '841', '10', '450', '4500', '0', '', '0', '2026-10-21 16:38:56', '841', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','450','4500','0','','0','0.00','0','0','0','0'); -- id=4786
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 = 4786;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (841, '2026-10-21', 4500, 4300, 4300
                    , 4300, 4300, 4300, 4300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 4300, 4300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-21', 4500, 4300, 4300
                    , 4300, 4300, 4300, 4300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4300, 4300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '2', storedetaildate = '2026-10-21 16:38:56' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '10', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '25', '2', '2026-10-21 16:38:56','0','0'); -- id=16067
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6877;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('652','02323', '1176', '8', '2323', '5', '680', '3400', '0', '', '0', '2026-10-21 16:38:56', '2323', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6877-5,','1','1','0','0','680','3400','0','','0','0.00','0','0','0','0'); -- id=4787
UPDATE sellbilldetail SET  lastbuyprice = 652.00 , meanbuyprice = 652.00, lastbuyprice_withDiscount = 652.00, meanbuyprice_withDiscount = 652.00
        , lastbuyprice_withTax = 652, meanbuyprice_withTax = 652, lastbuyprice_withDiscountAndTax = 652
                where sellbilldetailid = 4787;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2323, '2026-10-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3400, 3260, 3260
                    , 3260, 3260, 3260, 3260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3260, 3260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3400, sellCostBuyPrice =sellCostBuyPrice+3260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:38:56' WHERE storedetailid = '3717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2323', '1', '5', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 16:38:56','0','0'); -- id=16068
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6898;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','02328', '1176', '28', '2328', '5', '590', '2950', '0', '', '0', '2026-10-21 16:38:56', '2328', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6898-5,','1','1','0','0','590','2950','0','','0','0.00','0','0','0','0'); -- id=4788
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4788;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2328, '2026-10-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:38:56' WHERE storedetailid = '3722';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2328', '1', '5', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 16:38:56','0','0'); -- id=16069
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6873;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('512','02319', '1176', '8', '2319', '5', '540', '2700', '0', '', '0', '2026-10-21 16:38:56', '2319', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6873-5,','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=4789
UPDATE sellbilldetail SET  lastbuyprice = 512.00 , meanbuyprice = 512.00, lastbuyprice_withDiscount = 512.00, meanbuyprice_withDiscount = 512.00
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where sellbilldetailid = 4789;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2319, '2026-10-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:38:56' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 16:38:56','0','0'); -- id=16070
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6896;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','02326', '1176', '28', '2326', '5', '620', '3100', '0', '', '0', '2026-10-21 16:38:56', '2326', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6896-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=4790
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 4790;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2326, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2026-10-21 16:38:56' WHERE storedetailid = '3720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '5', '1', '1176', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 16:38:56','0','0'); -- id=16071
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7229003.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 ('7208653.5','20350', '0', '2', 'اضافة فاتورة مبيعات', '1176', '7229003.5', '2026-10-21 16:38:56', '2',  'sellbillController.php','1','','0'); -- id=1457
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20350', '20350', '2026-10-21', '2', '0', '0', '2026-10-21 16:38:56','اضافة فاتورة مبيعات رقم 1176','1','0',null,'0','1176','sellbillController.php?do=showDetail&sellbillid=1176'); -- id=4173
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4173', '419', '20350', '','0'); -- id=4283
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7229003', 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 ('4173', '143', '20350', '','0'); -- id=4175
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13220995', 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 ( '19570', '19570', '2026-10-21', '2', '0', '0', '2026-10-21 16:38:56','اضافة فاتورة مبيعات رقم 1176 - صرف البضاعة من المخزن','1','0',null,'0','1176','sellbillController.php?do=showDetail&sellbillid=1176'); -- id=4174
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4174', '402', '19570', '','0'); -- id=4284
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12231880.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 ('4174', '382', '19570', '','0'); -- id=4176
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25022100.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='4173,0,4174' where sellbillid=1176;
 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-21', 20350, 19570, 19570
                    , 19570, 19570, 19570, 19570
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,19570, 19570, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20350, sellCostBuyPrice =sellCostBuyPrice+19570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19570
                        , returnSellVal = returnSellVal+0, 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-21', 20350, 19570, 19570
                    , 19570, 19570, 19570, 19570
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,19570, 19570, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20350, sellCostBuyPrice =sellCostBuyPrice+19570
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19570, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19570
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19570, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19570
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19570
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19570
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19570
                        , returnSellVal = returnSellVal+0, 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, 20350, 19570, 19570
                    , 19570, 19570, 19570, 19570, 19570, 19570)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+20350, netSellCostBuyPrice = netSellCostBuyPrice+19570
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+19570
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+19570
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+19570
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+19570
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+19570
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+19570
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+19570;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8bea08bdbd and sellbillId = 1176 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:08:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:38:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:38:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16612
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:09:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:39:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:39:37', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16613
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:09:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:39:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:39:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16614
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:39:47',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:39:47', userid = 7; -- id=3458
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:09:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:39:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:39:48', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16615
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:10:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:40:16", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:40:16', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16616
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:10:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:40:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:40:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16617
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:10:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:40:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:40:30', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16618
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:10:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:40:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:40:39', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16619
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:11:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:41:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:41:37', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16620

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c0713b824
-- ----------------------------------------------------------------------------------------------------

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-21 16:41:37', '06ad8c0713b824', '1', '0.00', '0', '0', '1', '9240.00', '9240', '9240', '0', '1', '2026-10-21 16:41:37', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','9240','0','','0','0','9240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1177
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','اضافة فاتورة مبيعات','1177', '0', '2026-10-21 16:41:37', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9240', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:41:37','0','0','',''); -- id=1402
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 861;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('515.2','01836', '1177', '124', '1836', '9', '560', '5040', '0', '', '0', '2026-10-21 16:41:37', '1836', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','861-9,','1','1','0','0','560','5040','0','','0','0.00','0','0','0','0'); -- id=4791
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 515.20, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where sellbilldetailid = 4791;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1836, '2026-10-21', 5040, 5040, 5040
                    , 5040, 4636.8, 4636.8, 4636.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4636.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4636.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4636.8
                            , 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+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-21', 5040, 5040, 5040
                    , 5040, 4636.8, 4636.8, 4636.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4636.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4636.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4636.8
                            , 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 = '6', userid = '2', storedetaildate = '2026-10-21 16:41:37' WHERE storedetailid = '2851';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1836', '1', '9', '1', '1177', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '6', '2', '2026-10-21 16:41:37','0','0'); -- id=16072
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1177', '147', '1884', '3', '460', '1380', '0', '', '0', '2026-10-21 16:41:37', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4792
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 = 4792;
 INSERT INTO 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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1380, 1287, 1287
                    , 1287, 1287, 1287, 1287
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1287, 1287, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1380, sellCostBuyPrice =sellCostBuyPrice+1287
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1287, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1287
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1287, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1287
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1287
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1287
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1287
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 16:41:37' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '3', '1', '1177', 'اضافة فاتورة مبيعات', 'sellbillController.php', '273', '270', '2', '2026-10-21 16:41:37','0','0'); -- id=16073
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1177', '173', '2199', '6', '470', '2820', '0', '', '0', '2026-10-21 16:41:37', '2199', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6424-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=4793
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 = 4793;
 INSERT INTO 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-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2820, 2820, 2820
                    , 2820, 2594.4, 2594.4, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2594.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:41:37' WHERE storedetailid = '3568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2199', '1', '6', '1', '1177', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '21', '2', '2026-10-21 16:41:37','0','0'); -- id=16074
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7238243.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 ('7229003.5','9240', '0', '2', 'اضافة فاتورة مبيعات', '1177', '7238243.5', '2026-10-21 16:41:37', '2',  'sellbillController.php','1','','0'); -- id=1458
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9240', '9240', '2026-10-21', '2', '0', '0', '2026-10-21 16:41:37','اضافة فاتورة مبيعات رقم 1177','1','0',null,'0','1177','sellbillController.php?do=showDetail&sellbillid=1177'); -- id=4175
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4175', '419', '9240', '','0'); -- id=4285
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7238243', 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 ('4175', '143', '9240', '','0'); -- id=4177
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13230235', 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 ( '8518.2', '8518.2', '2026-10-21', '2', '0', '0', '2026-10-21 16:41:37','اضافة فاتورة مبيعات رقم 1177 - صرف البضاعة من المخزن','1','0',null,'0','1177','sellbillController.php?do=showDetail&sellbillid=1177'); -- id=4176
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4176', '402', '8518.2', '','0'); -- id=4286
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12240398.31', 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 ('4176', '382', '8518.2', '','0'); -- id=4178
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25013582.19', 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='4175,0,4176' where sellbillid=1177;
 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-21', 9240, 9147, 9147
                    , 9147, 8518.2, 8518.2, 8518.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9147, 9147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9240, sellCostBuyPrice =sellCostBuyPrice+9147
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9147, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9147
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8518.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8518.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8518.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9147
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9147
                        , returnSellVal = returnSellVal+0, 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-21', 9240, 9147, 9147
                    , 9147, 8518.2, 8518.2, 8518.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9147, 9147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9240, sellCostBuyPrice =sellCostBuyPrice+9147
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9147, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9147
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8518.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8518.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8518.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9147
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9147
                        , returnSellVal = returnSellVal+0, 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, 9240, 9147, 9147
                    , 9147, 8518.2, 8518.2, 8518.2, 9147, 9147)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9240, netSellCostBuyPrice = netSellCostBuyPrice+9147
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9147
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9147
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8518.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8518.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8518.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9147
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9147;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c0713b824 and sellbillId = 1177 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:11:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:41:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:41:37', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16621
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:13:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:43:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:43:12', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16622

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8bad7816d0
-- ----------------------------------------------------------------------------------------------------

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-21 16:43:12', '06ad8bad7816d0', '1', '0.00', '0', '30', '1', '22680.00', '22650', '22650', '0', '2', '2026-10-21 16:43:12', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '56' ,'0','','','','','-1','0','0','0','0','0','22650','0','','0','0','22650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1178
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','اضافة فاتورة مبيعات','1178', '0', '2026-10-21 16:43:12', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '22650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:43:12','0','0','',''); -- id=1403
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', '1178', '88', '1442', '12', '440', '5280', '0', '', '0', '2026-10-21 16:43:12', '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=4794
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 = 4794;
 INSERT INTO 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-21', 5273.0158730159, 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+5273.0158730159, 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-21', 5273.0158730159, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5273.0158730159, 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 = '60', userid = '4', storedetaildate = '2026-10-21 16:43:12' WHERE storedetailid = '1473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '2', '12', '1', '1178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '60', '4', '2026-10-21 16:43:12','0','0'); -- id=16075
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1178', '88', '1443', '12', '410', '4920', '0', '', '0', '2026-10-21 16:43:12', '1443', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6729-12,','1','1','0','0','410','4920','0','','0','0.00','0','0','0','0'); -- id=4795
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 = 4795;
 INSERT INTO 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-21', 4913.4920634921, 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+4913.4920634921, 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-21', 4913.4920634921, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4913.4920634921, 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 = '11', userid = '4', storedetaildate = '2026-10-21 16:43:12' WHERE storedetailid = '1474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1443', '2', '12', '1', '1178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23', '11', '4', '2026-10-21 16:43:12','0','0'); -- id=16076
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+32 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01324', '1178', '86', '1324', '32', '390', '12480', '0', '', '0', '2026-10-21 16:43:12', '1324', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','131-32,','1','1','0','0','390','12480','0','','0','0.00','0','0','0','0'); -- id=4796
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.63, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.63
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 355.63, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4796;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1324, '2026-10-21', 12463.492063492, 11520, 11520
                    , 11380.16, 11520, 11380.16, 11366.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 32, 0, 11520, 11380.16, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12463.492063492, sellCostBuyPrice =sellCostBuyPrice+11520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11380.16
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11380.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11366.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11380.16
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-21', 12463.492063492, 11520, 11520
                    , 11380.16, 11520, 11380.16, 11366.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11520, 11380.16, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12463.492063492, sellCostBuyPrice =sellCostBuyPrice+11520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11380.16
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11380.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11366.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11380.16
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '992', userid = '4', storedetaildate = '2026-10-21 16:43:12' WHERE storedetailid = '1405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '32', '1', '1178', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1024', '992', '4', '2026-10-21 16:43:12','0','0'); -- id=16077
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1151882.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 ('1129232.875','22650', '0', '3', 'اضافة فاتورة مبيعات', '1178', '1151882.875', '2026-10-21 16:43:12', '4',  'sellbillController.php','1','','0'); -- id=1459
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:13:12";
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '22680', '22680', '2026-10-21', '4', '0', '0', '2026-10-21 16:43:12','اضافة فاتورة مبيعات رقم 1178','1','0',null,'0','1178','sellbillController.php?do=showDetail&sellbillid=1178'); -- id=4177
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4177', '501', '22650', '','0'); -- id=4287
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1151882.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';
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:43:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4177', '398', '30', '','0'); -- id=4288
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510224.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 ('4177', '143', '22680', '','0'); -- id=4179
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13252915', 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 movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:43:12', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add');INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '21000', '21000', '2026-10-21', '4', '0', '0', '2026-10-21 16:43:12','اضافة فاتورة مبيعات رقم 1178 - صرف البضاعة من المخزن','1','0',null,'0','1178','sellbillController.php?do=showDetail&sellbillid=1178'); -- id=16623
 -- id=4178
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4178', '402', '21000', '','0'); -- id=4289
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12261398.31', 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 ('4178', '492', '21000', '','0'); -- id=4180
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1572397', 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='4177,0,4178' where sellbillid=1178;
 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-21', 22650, 21000, 21000
                    , 20860.16, 21000, 20860.16, 20846.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,21000, 20860.16, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22650, sellCostBuyPrice =sellCostBuyPrice+21000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+21000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20860.16
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+21000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20860.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20846.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+21000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20860.16
                        , returnSellVal = returnSellVal+0, 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-21', 22650, 21000, 21000
                    , 20860.16, 21000, 20860.16, 20846.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,21000, 20860.16, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22650, sellCostBuyPrice =sellCostBuyPrice+21000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+21000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20860.16
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+21000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20860.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20846.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+21000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20860.16
                        , returnSellVal = returnSellVal+0, 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, 22650, 21000, 21000
                    , 20860.16, 21000, 20860.16, 20846.4, 21000, 20860.16)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+22650, netSellCostBuyPrice = netSellCostBuyPrice+21000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+21000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+20860.16
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+21000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+20860.16
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+20846.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+21000
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+20860.16;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8bad7816d0 and sellbillId = 1178 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

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 ('موديل 400 زد وبروفيت','','116','530','530','0','0','2026-10-21','0','7','0','','0','0','0','0','0','530','530','530','530','530','0','0','0','0','.','0','0','0','530','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','530','530','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','530','0','0','0','0','0','0','','','0','0','0','0'); -- id=2342
UPDATE product SET productName = 'موديل 400 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '530', productSellAllPrice = '530', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',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='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2342';
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', '2342', '1.00', '2026-10-21', '7', '0','0234201','530','0','0','530','','0','0','0','0','0','0','0','0','0','0'); -- id=2342
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2342', '1', '0', '7', '2026-10-21'); -- id=3736
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2342', '1', '0', '0', '2342', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16078
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2342, 1,'2026-10-21 16:43:12',7)
                ON DUPLICATE KEY UPDATE productid = 2342, edited = 1, sysdate = '2026-10-21 16:43:12', userid = 7; -- id=3479
UPDATE product SET productName = 'موديل 400 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '530.00', productSellAllPrice = '530.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',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='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2342';
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 ('موديل 1005 زد وبروفيت','','116','560','560','0','0','2026-10-21','0','7','0','','0','0','0','0','0','560','560','560','560','560','0','0','0','0','.','0','0','0','560','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','560','560','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','560','0','0','0','0','0','0','','','0','0','0','0'); -- id=2343
UPDATE product SET productName = 'موديل 1005 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '560', productSellAllPrice = '560', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2343';
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', '2343', '1.00', '2026-10-21', '7', '0','0234301','560','0','0','560','','0','0','0','0','0','0','0','0','0','0'); -- id=2343
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2343', '1', '0', '7', '2026-10-21'); -- id=3737
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2343', '1', '0', '0', '2343', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16079
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2343, 1,'2026-10-21 16:43:12',7)
                ON DUPLICATE KEY UPDATE productid = 2343, edited = 1, sysdate = '2026-10-21 16:43:12', userid = 7; -- id=3480
UPDATE product SET productName = 'موديل 1005 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2343';
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 ('بيزك جلد زد وبروفيت','','116','460','460','0','0','2026-10-21','0','7','0','','0','0','0','0','0','460','460','460','460','460','0','0','0','0','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=2344
UPDATE product SET productName = 'بيزك جلد زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '460', productSellAllPrice = '460', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2344';
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', '2344', '1.00', '2026-10-21', '7', '0','0234401','460','0','0','460','','0','0','0','0','0','0','0','0','0','0'); -- id=2344
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2344', '1', '0', '7', '2026-10-21'); -- id=3738
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2344', '1', '0', '0', '2344', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16080
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2344, 1,'2026-10-21 16:43:12',7)
                ON DUPLICATE KEY UPDATE productid = 2344, edited = 1, sysdate = '2026-10-21 16:43:12', userid = 7; -- id=3481
UPDATE product SET productName = 'بيزك جلد زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2344';
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 ('بيزك ياقه زد وبريفت','','116','500','500','0','0','2026-10-21','0','7','0','','0','0','0','0','0','500','500','500','500','500','0','0','0','0','.','0','0','0','500','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','500','500','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','500','0','0','0','0','0','0','','','0','0','0','0'); -- id=2345
UPDATE product SET productName = 'بيزك ياقه زد وبريفت', productDescription = '', productCatId = '116', productBuyPrice = '500', productSellAllPrice = '500', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2345';
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', '2345', '1.00', '2026-10-21', '7', '0','0234501','500','0','0','500','','0','0','0','0','0','0','0','0','0','0'); -- id=2345
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2345', '1', '0', '7', '2026-10-21'); -- id=3739
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2345', '1', '0', '0', '2345', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16081
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2345, 1,'2026-10-21 16:43:12',7)
                ON DUPLICATE KEY UPDATE productid = 2345, edited = 1, sysdate = '2026-10-21 16:43:12', userid = 7; -- id=3482
UPDATE product SET productName = 'بيزك ياقه زد وبريفت', productDescription = '', productCatId = '116', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2345';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:13:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:43:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:43:12', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16624
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:13:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:43:13", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:43:13', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16625
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580.00',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2026-10-21 16:43:38',7)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2026-10-21 16:43:38', userid = 7; -- id=2404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:13:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:43:42", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:43:42', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16626
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 16:44:42',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 16:44:42', userid = 7; -- id=3458
UPDATE product SET productName = 'موديل 504 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '410.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01590',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '377.2',meanbuyprice = '410.00',meanbuyprice_withDiscount = '377.2' , productbuypricereal = '410.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='377.2',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='377.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 = '1590';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1590, 1,'2026-10-21 16:44:46',7)
                ON DUPLICATE KEY UPDATE productid = 1590, edited = 1, sysdate = '2026-10-21 16:44:46', userid = 7; -- id=2405
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580.00',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2026-10-21 16:44:46',7)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2026-10-21 16:44:46', userid = 7; -- id=2404
UPDATE product SET productName = 'موديل 504 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '410.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01590',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '377.2',meanbuyprice = '410.00',meanbuyprice_withDiscount = '377.2' , productbuypricereal = '410.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='377.2',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='377.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 = '1590';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1590, 1,'2026-10-21 16:44:47',7)
                ON DUPLICATE KEY UPDATE productid = 1590, edited = 1, sysdate = '2026-10-21 16:44:47', userid = 7; -- id=2405
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580.00',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2026-10-21 16:44:49',7)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2026-10-21 16:44:49', userid = 7; -- id=2404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:15:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:45:47", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:45:47', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16627
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 ('06ad8c18e41c3d', '2026-10-21 16:43:42', '112', '110290.40', '188085.6', '8', '1', '84560.00',  '77795.20', '0', '77795.2', '1', '2026-10-21 16:45:47', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=293
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 ('02342', '293', '116', '2342', '32', '530', '16960.00', '0', '', '2026-10-21 16:45:47', '2342','','','0','0','0','0','0',null,'530','16960','0','0','0','0','0','0','0','0','1'); -- id=1647
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:43:42', 1, 2342, 0, 0
                    , 487.6, 32, 0, 0, 7, '2026-10-21 16:45:47')
                ON DUPLICATE KEY UPDATE buyprice = 487.6,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:45:47' ; -- id=6958
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2342', '530', '32', '0', 'buyBillController.php', '1647', '', '0', '0'); -- id=1206
UPDATE product SET  productBuyPrice = "530" WHERE productId = 2342 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1647 ;
UPDATE product SET productName = 'موديل 400 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '530.00', productSellAllPrice = '530.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '487.6',meanbuyprice = '530',meanbuyprice_withDiscount = '487.6' , productbuypricereal = '530.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='530',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='530',meanbuyprice_withTax='530',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='487.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 = '2342';
UPDATE buybilldetail SET  lastbuyprice = 530 , meanbuyprice = 530, lastbuyprice_withDiscount = 487.6, meanbuyprice_withDiscount = 487.6
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 487.6
                where buybilldetailid = 1647;
UPDATE productunit SET proUnitBuyPrice  = 530 * productnumber WHERE productid = 2342;
UPDATE storedetail SET  productquantity = '32', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3736';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2342', '1', '32', '0', '293', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '7', '2026-10-21 16:43:42','0','0'); -- id=16082
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 ('01589', '293', '116', '1589', '32', '580', '18560.00', '0', '', '2026-10-21 16:45:47', '1589','','','0','0','0','0','0',null,'580','18560','0','0','0','0','0','0','0','0','1'); -- id=1648
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:43:42', 1, 1589, 0, 0
                    , 533.6, 32, 0, 0, 7, '2026-10-21 16:45:47')
                ON DUPLICATE KEY UPDATE buyprice = 533.6,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:45:47' ; -- id=6959
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1589', '580', '32', '0', 'buyBillController.php', '1648', '', '0', '0'); -- id=1207
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1589 ;
UPDATE buybilldetail SET  quantitybefore = 36 WHERE buybilldetailid = 1648 ;
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 533.6, meanbuyprice_withDiscount = 533.6
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 533.6
                where buybilldetailid = 1648;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1589;
UPDATE storedetail SET  productquantity = '68', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '1614';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1589', '1', '32', '0', '293', 'اضافة فاتورة مشتريات', 'buyBillController.php', '36', '68', '7', '2026-10-21 16:43:42','0','0'); -- id=16083
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 ('02343', '293', '116', '2343', '36', '560', '20160.00', '0', '', '2026-10-21 16:45:47', '2343','','','0','0','0','0','0',null,'560','20160','0','0','0','0','0','0','0','0','1'); -- id=1649
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:43:42', 1, 2343, 0, 0
                    , 515.2, 36, 0, 0, 7, '2026-10-21 16:45:47')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:45:47' ; -- id=6960
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2343', '560', '36', '0', 'buyBillController.php', '1649', '', '0', '0'); -- id=1208
UPDATE product SET  productBuyPrice = "560" WHERE productId = 2343 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1649 ;
UPDATE product SET productName = 'موديل 1005 زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.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 = '2343';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 1649;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 2343;
UPDATE storedetail SET  productquantity = '36', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3737';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2343', '1', '36', '0', '293', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '7', '2026-10-21 16:43:42','0','0'); -- id=16084
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 ('02344', '293', '116', '2344', '28', '460', '12880.00', '0', '', '2026-10-21 16:45:47', '2344','','','0','0','0','0','0',null,'460','12880','0','0','0','0','0','0','0','0','1'); -- id=1650
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:43:42', 1, 2344, 0, 0
                    , 423.2, 28, 0, 0, 7, '2026-10-21 16:45:47')
                ON DUPLICATE KEY UPDATE buyprice = 423.2,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:45:47' ; -- id=6961
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2344', '460', '28', '0', 'buyBillController.php', '1650', '', '0', '0'); -- id=1209
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2344 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1650 ;
UPDATE product SET productName = 'بيزك جلد زد وبروفيت', productDescription = '', productCatId = '116', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '423.2',meanbuyprice = '460',meanbuyprice_withDiscount = '423.2' , productbuypricereal = '460.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='423.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 = '2344';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 423.2, meanbuyprice_withDiscount = 423.2
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where buybilldetailid = 1650;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2344;
UPDATE storedetail SET  productquantity = '28', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3738';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2344', '1', '28', '0', '293', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '7', '2026-10-21 16:43:42','0','0'); -- id=16085
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 ('02345', '293', '116', '2345', '32', '500', '16000.00', '0', '', '2026-10-21 16:45:47', '2345','','','0','0','0','0','0',null,'500','16000','0','0','0','0','0','0','0','0','1'); -- id=1651
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 16:43:42', 1, 2345, 0, 0
                    , 460, 32, 0, 0, 7, '2026-10-21 16:45:47')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 16:45:47' ; -- id=6962
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2345', '500', '32', '0', 'buyBillController.php', '1651', '', '0', '0'); -- id=1210
UPDATE product SET  productBuyPrice = "500" WHERE productId = 2345 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1651 ;
UPDATE product SET productName = 'بيزك ياقه زد وبريفت', productDescription = '', productCatId = '116', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '460',meanbuyprice = '500',meanbuyprice_withDiscount = '460' , productbuypricereal = '500.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='500',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='500',meanbuyprice_withTax='500',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='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 = '2345';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1651;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 2345;
UPDATE storedetail SET  productquantity = '32', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3739';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2345', '1', '32', '0', '293', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '7', '2026-10-21 16:43:42','0','0'); -- id=16086
UPDATE supplier SET  suppliercurrentDebt = '188085.6',suppliercurrentDebtInCurrency= '188085.6' , userid = '7', supplierdate = '2026-10-21 16:45:47'   WHERE supplierid = '112';
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 ('112', '110290.40', '77795.2', '0', 'اضافة فاتورة مشتريات', '293', '188085.6', '2026-10-21 16:43:42', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','77795.2','1','110290.4','77795.2','188085.6','0',''); -- id=812
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '77795.2', '77795.2', '2026-10-21', '7', '0', '0', '2026-10-21 16:45:48','اضافة فاتورة مشتريات رقم 293','1','0',null,'0','293','buyBillController.php?do=details&id=293'); -- id=4179
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4179', '382', '77795.2', '','0'); -- id=4290
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25091377.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 ('4179', '595', '77795.2', '','0'); -- id=4181
UPDATE accountstree SET name = 'زد و بروفت', customName = 'زد و بروفت', customNameEn = 'زد و بروفت', nameEn = 'زد و بروفت', parent = '81', accountNature = '1', theValue = '188085.6', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-07 18:26:15' WHERE id = '595';
update buybill set dailyentryid='4179,0' where buybillid=293;
COMMIT;
UPDATE product SET overAllAveragePrice = 533.6 WHERE productId = 1589;UPDATE product SET overAllAveragePrice = 487.6 WHERE productId = 2342;UPDATE product SET overAllAveragePrice = 515.2 WHERE productId = 2343;UPDATE product SET overAllAveragePrice = 423.2 WHERE productId = 2344;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 2345;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:15:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:45:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 16:45:48', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=293'); -- id=16628
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:15:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:45:52", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:45:52', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=293&type=2'); -- id=16629
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:17:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:47:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:47:35', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16630
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:17:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:47:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:47:53', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16631
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-21 13:17:53";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:47:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:47:53', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16632
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:17:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:47:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:47:55', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16633
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:17:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:47:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:47:59', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16634

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c111e7376
-- ----------------------------------------------------------------------------------------------------

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-21 16:47:59', '06ad8c111e7376', '1', '0.00', '0', '0', '1', '19125.00', '19125', '19125', '0', '1', '2026-10-21 16:47:59', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '37' ,'0','','','','','-1','0','0','0','0','0','19125','0','','0','0','19125','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1179
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','اضافة فاتورة مبيعات','1179', '0', '2026-10-21 16:47:59', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '19125', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:47:59','0','0','',''); -- id=1404
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 5971;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('515','02002', '1179', '162', '2002', '3', '550', '1650', '0', '', '0', '2026-10-21 16:47:59', '2002', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5971-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=4797
UPDATE sellbilldetail SET  lastbuyprice = 515.00 , meanbuyprice = 515.00, lastbuyprice_withDiscount = 515.00, meanbuyprice_withDiscount = 515.00
        , lastbuyprice_withTax = 515, meanbuyprice_withTax = 257.5, lastbuyprice_withDiscountAndTax = 515
                where sellbilldetailid = 4797;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2002, '2026-10-21', 1650, 1545, 1545
                    , 1545, 1545, 1545, 1545
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1545, 772.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1545
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1545, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1545
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1545, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1545
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1545
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1545
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+772.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-21', 1650, 1545, 1545
                    , 1545, 1545, 1545, 1545
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1545, 772.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1545
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1545, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1545
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1545, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1545
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1545
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1545
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+772.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 = '0', userid = '2', storedetaildate = '2026-10-21 16:47:59' WHERE storedetailid = '3360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2002', '1', '3', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '0', '2', '2026-10-21 16:47:59','0','0'); -- id=16087
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 940;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01870', '1179', '146', '1870', '8', '500', '4000', '0', '', '0', '2026-10-21 16:47:59', '1870', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','940-8,','1','1','0','0','500','4000','0','','0','0.00','0','0','0','0'); -- id=4798
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 480.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 4798;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1870, '2026-10-21', 4000, 4000, 4000
                    , 4000, 3680, 3840, 3680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 4000, 4000, 4000
                    , 4000, 3680, 3840, 3680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 16:47:59' WHERE storedetailid = '2887';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1870', '1', '8', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '0', '2', '2026-10-21 16:47:59','0','0'); -- id=16088
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6874;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('657','02320', '1179', '8', '2320', '5', '685', '3425', '0', '', '0', '2026-10-21 16:47:59', '2320', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6874-5,','1','1','0','0','685','3425','0','','0','0.00','0','0','0','0'); -- id=4799
UPDATE sellbilldetail SET  lastbuyprice = 657.00 , meanbuyprice = 657.00, lastbuyprice_withDiscount = 657.00, meanbuyprice_withDiscount = 657.00
        , lastbuyprice_withTax = 657, meanbuyprice_withTax = 657, lastbuyprice_withDiscountAndTax = 657
                where sellbilldetailid = 4799;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2320, '2026-10-21', 3425, 3285, 3285
                    , 3285, 3285, 3285, 3285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3285, 3285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3425, 3285, 3285
                    , 3285, 3285, 3285, 3285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3285, 3285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:47:59' WHERE storedetailid = '3714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2320', '1', '5', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 16:47:59','0','0'); -- id=16089
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6247;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('616.4','02155', '1179', '188', '2155', '6', '670', '4020', '0', '', '0', '2026-10-21 16:47:59', '2155', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6247-6,','1','1','0','0','670','4020','0','','0','0.00','0','0','0','0'); -- id=4800
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 616.40, meanbuyprice_withDiscount = 616.40
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 616.4
                where sellbilldetailid = 4800;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2155, '2026-10-21', 4020, 4020, 4020
                    , 4020, 3698.4, 3698.4, 3698.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 4020, 4020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4020, sellCostBuyPrice =sellCostBuyPrice+4020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3698.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3698.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3698.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4020, 4020, 4020
                    , 4020, 3698.4, 3698.4, 3698.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4020, 4020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4020, sellCostBuyPrice =sellCostBuyPrice+4020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3698.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3698.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3698.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 16:47:59' WHERE storedetailid = '3514';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2155', '1', '6', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '42', '2', '2026-10-21 16:47:59','0','0'); -- id=16090
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6249;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('598','02157', '1179', '188', '2157', '3', '650', '1950', '0', '', '0', '2026-10-21 16:47:59', '2157', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6249-3,','1','1','0','0','650','1950','0','','0','0.00','0','0','0','0'); -- id=4801
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 598.00, meanbuyprice_withDiscount = 598.00
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 598
                where sellbilldetailid = 4801;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2157, '2026-10-21', 1950, 1950, 1950
                    , 1950, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , 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+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-21', 1950, 1950, 1950
                    , 1950, 1794, 1794, 1794
                    , 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+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , 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 = '0', userid = '2', storedetaildate = '2026-10-21 16:47:59' WHERE storedetailid = '3516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2157', '1', '3', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '0', '2', '2026-10-21 16:47:59','0','0'); -- id=16091
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1179', '104', '1467', '12', '340', '4080', '0', '', '0', '2026-10-21 16:47:59', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','688-12,','1','1','0','0','340','4080','0','','0','0.00','0','0','0','0'); -- id=4802
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 = 4802;
 INSERT INTO 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-21', 4080, 3312, 3312
                    , 3312, 3312, 3312, 3312
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3312, 3312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+3312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3312, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3312
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4080, 3312, 3312
                    , 3312, 3312, 3312, 3312
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3312, 3312, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+3312
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3312, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3312
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3312, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3312
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3312
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3312
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3312
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '243', userid = '2', storedetaildate = '2026-10-21 16:47:59' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '12', '1', '1179', 'اضافة فاتورة مبيعات', 'sellbillController.php', '255', '243', '2', '2026-10-21 16:47:59','0','0'); -- id=16092
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7257368.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 ('7238243.5','19125', '0', '2', 'اضافة فاتورة مبيعات', '1179', '7257368.5', '2026-10-21 16:47:59', '2',  'sellbillController.php','1','','0'); -- id=1460
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '19125', '19125', '2026-10-21', '2', '0', '0', '2026-10-21 16:47:59','اضافة فاتورة مبيعات رقم 1179','1','0',null,'0','1179','sellbillController.php?do=showDetail&sellbillid=1179'); -- id=4180
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4180', '419', '19125', '','0'); -- id=4291
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7257368', 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 ('4180', '143', '19125', '','0'); -- id=4182
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13272040', 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 ( '17314.4', '17314.4', '2026-10-21', '2', '0', '0', '2026-10-21 16:47:59','اضافة فاتورة مبيعات رقم 1179 - صرف البضاعة من المخزن','1','0',null,'0','1179','sellbillController.php?do=showDetail&sellbillid=1179'); -- id=4181
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4181', '402', '17314.4', '','0'); -- id=4292
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12278712.71', 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 ('4181', '382', '17314.4', '','0'); -- id=4183
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25074062.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='4180,0,4181' where sellbillid=1179;
 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-21', 19125, 18112, 18112
                    , 18112, 17314.4, 17474.4, 17314.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18112, 15339.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19125, sellCostBuyPrice =sellCostBuyPrice+18112
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18112, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17314.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17474.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17314.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18112
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15339.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-21', 19125, 18112, 18112
                    , 18112, 17314.4, 17474.4, 17314.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18112, 15339.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19125, sellCostBuyPrice =sellCostBuyPrice+18112
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18112, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18112
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17314.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17474.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17314.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18112
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15339.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, 19125, 18112, 18112
                    , 18112, 17314.4, 17474.4, 17314.4, 18112, 15339.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+19125, netSellCostBuyPrice = netSellCostBuyPrice+18112
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18112
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18112
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+17314.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+17474.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+17314.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18112
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+15339.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c111e7376 and sellbillId = 1179 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:18:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:48:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:48:00', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16635
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:22:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:52:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 16:52:25', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16636
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:23:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:53:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:53:40', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16637
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:23:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:53:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:53:46', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16638
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:24:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:54:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:54:33', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16639
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:25:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:55:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 16:55:11', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16640
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:27:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:57:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 16:57:09', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16641
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:27:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:57:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:57:20', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16642
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:27:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:57:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 16:57:25', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16643
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:27:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:57:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:57:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16644
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:29:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:59:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 16:59:46', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16645
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-21 13:29:46";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 16:59:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 16:59:46', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16646
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:29:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:59:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:59:48', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16647
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:29:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:59:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:59:52', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16648

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c2901e5d8
-- ----------------------------------------------------------------------------------------------------

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-21 16:59:52', '06ad8c2901e5d8', '1', '0.00', '0', '0', '1', '11960.00', '11960', '11960', '0', '1', '2026-10-21 16:59:52', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '23' ,'0','','','','','-1','0','0','0','0','0','11960','0','','0','0','11960','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1180
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','اضافة فاتورة مبيعات','1180', '0', '2026-10-21 16:59:52', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11960', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 16:59:52','0','0','',''); -- id=1405
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+23 where id = 1136;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('500','01948', '1180', '157', '1948', '23', '520', '11960', '0', '', '0', '2026-10-21 16:59:52', '1948', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1136-23,','1','1','0','0','520','11960','0','','0','0.00','0','0','0','0'); -- id=4803
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where sellbilldetailid = 4803;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1948, '2026-10-21', 11960, 11500, 11500
                    , 11500, 11500, 11500, 11500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 23, 0, 11500, 11500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11960, sellCostBuyPrice =sellCostBuyPrice+11500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+23
                        , netQuantityRet = netQuantityRet+0;
 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-21', 11960, 11500, 11500
                    , 11500, 11500, 11500, 11500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11500, 11500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11960, sellCostBuyPrice =sellCostBuyPrice+11500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '97', userid = '2', storedetaildate = '2026-10-21 16:59:52' WHERE storedetailid = '2965';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1948', '1', '23', '1', '1180', 'اضافة فاتورة مبيعات', 'sellbillController.php', '120', '97', '2', '2026-10-21 16:59:52','0','0'); -- id=16093
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7269328.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 ('7257368.5','11960', '0', '2', 'اضافة فاتورة مبيعات', '1180', '7269328.5', '2026-10-21 16:59:52', '2',  'sellbillController.php','1','','0'); -- id=1461
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11960', '11960', '2026-10-21', '2', '0', '0', '2026-10-21 16:59:52','اضافة فاتورة مبيعات رقم 1180','1','0',null,'0','1180','sellbillController.php?do=showDetail&sellbillid=1180'); -- id=4182
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4182', '419', '11960', '','0'); -- id=4293
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7269328', 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 ('4182', '143', '11960', '','0'); -- id=4184
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13284000', 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 ( '11500', '11500', '2026-10-21', '2', '0', '0', '2026-10-21 16:59:52','اضافة فاتورة مبيعات رقم 1180 - صرف البضاعة من المخزن','1','0',null,'0','1180','sellbillController.php?do=showDetail&sellbillid=1180'); -- id=4183
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4183', '402', '11500', '','0'); -- id=4294
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12290212.71', 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 ('4183', '382', '11500', '','0'); -- id=4185
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25062562.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='4182,0,4183' where sellbillid=1180;
 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-21', 11960, 11500, 11500
                    , 11500, 11500, 11500, 11500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11500, 11500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11960, sellCostBuyPrice =sellCostBuyPrice+11500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11500
                        , returnSellVal = returnSellVal+0, 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-21', 11960, 11500, 11500
                    , 11500, 11500, 11500, 11500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11500, 11500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11960, sellCostBuyPrice =sellCostBuyPrice+11500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11500
                        , returnSellVal = returnSellVal+0, 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, 11960, 11500, 11500
                    , 11500, 11500, 11500, 11500, 11500, 11500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11960, netSellCostBuyPrice = netSellCostBuyPrice+11500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c2901e5d8 and sellbillId = 1180 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:29:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 16:59:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 16:59:53', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16649
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:30:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:00:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:00:10', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16650

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c4e5f0b8a
-- ----------------------------------------------------------------------------------------------------

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-21 17:00:10', '06ad8c4e5f0b8a', '1', '0.00', '0', '0', '1', '7020.00', '7020', '7020', '0', '1', '2026-10-21 17:00:10', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '21' ,'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-21','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=1181
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','اضافة فاتورة مبيعات','1181', '0', '2026-10-21 17:00:10', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7020', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:00:10','0','0','',''); -- id=1406
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 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', '1181', '94', '1378', '12', '360', '4320', '0', '', '0', '2026-10-21 17:00:10', '1378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','70-12,','1','1','0','0','360','4320','0','','0','0.00','0','0','0','0'); -- id=4804
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 = 4804;
 INSERT INTO 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-21', 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-21', 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 = '400', userid = '2', storedetaildate = '2026-10-21 17:00:10' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '12', '1', '1181', 'اضافة فاتورة مبيعات', 'sellbillController.php', '412', '400', '2', '2026-10-21 17:00:10','0','0'); -- id=16094
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1181', '94', '1379', '9', '300', '2700', '0', '', '0', '2026-10-21 17:00:10', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-9,','1','1','0','0','300','2700','0','','0','0.00','0','0','0','0'); -- id=4805
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 = 4805;
 INSERT INTO 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-21', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '284', userid = '2', storedetaildate = '2026-10-21 17:00:10' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '9', '1', '1181', 'اضافة فاتورة مبيعات', 'sellbillController.php', '293', '284', '2', '2026-10-21 17:00:10','0','0'); -- id=16095
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7276348.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 ('7269328.5','7020', '0', '2', 'اضافة فاتورة مبيعات', '1181', '7276348.5', '2026-10-21 17:00:10', '2',  'sellbillController.php','1','','0'); -- id=1462
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7020', '7020', '2026-10-21', '2', '0', '0', '2026-10-21 17:00:10','اضافة فاتورة مبيعات رقم 1181','1','0',null,'0','1181','sellbillController.php?do=showDetail&sellbillid=1181'); -- id=4184
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4184', '419', '7020', '','0'); -- id=4295
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7276348', 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 ('4184', '143', '7020', '','0'); -- id=4186
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13291020', 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 ( '6270', '6270', '2026-10-21', '2', '0', '0', '2026-10-21 17:00:10','اضافة فاتورة مبيعات رقم 1181 - صرف البضاعة من المخزن','1','0',null,'0','1181','sellbillController.php?do=showDetail&sellbillid=1181'); -- id=4185
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4185', '402', '6270', '','0'); -- id=4296
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12296482.71', 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 ('4185', '382', '6270', '','0'); -- id=4187
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25056292.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='4184,0,4185' where sellbillid=1181;
 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-21', 7020, 6270, 6270
                    , 6270, 6270, 6270, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6270, 6270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6270
                        , returnSellVal = returnSellVal+0, 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-21', 7020, 6270, 6270
                    , 6270, 6270, 6270, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6270, 6270, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6270
                        , returnSellVal = returnSellVal+0, 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, 6270, 6270
                    , 6270, 6270, 6270, 6270, 6270, 6270)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7020, netSellCostBuyPrice = netSellCostBuyPrice+6270
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6270
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6270
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6270
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6270
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6270
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6270
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6270;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c4e5f0b8a and sellbillId = 1181 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:30:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:00:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:00:10', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16651
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:34:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:04:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:04:30', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16652
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-21 13:34:30";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:04:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:04:30', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16653
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:34:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:04:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:04:32', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16654
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:34:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:04:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:04:39', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16655

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c56a7ce7d
-- ----------------------------------------------------------------------------------------------------

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-21 17:04:39', '06ad8c56a7ce7d', '1', '0.00', '0', '0', '1', '21150.00', '21150', '21150', '0', '1', '2026-10-21 17:04:39', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '57' ,'0','','','','','-1','0','0','0','0','0','21150','0','','0','0','21150','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1182
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','اضافة فاتورة مبيعات','1182', '0', '2026-10-21 17:04:39', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '21150', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:04:39','0','0','',''); -- id=1407
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 985;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('364','01891', '1182', '147', '1891', '12', '395', '4740', '0', '', '0', '2026-10-21 17:04:39', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-12,','1','1','0','0','395','4740','0','','0','0.00','0','0','0','0'); -- id=4806
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 4806;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4740, sellCostBuyPrice =sellCostBuyPrice+4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4368
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4740, 4368, 4368
                    , 4368, 4368, 4368, 4368
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4368, 4368, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4740, sellCostBuyPrice =sellCostBuyPrice+4368
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4368, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4368
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4368, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4368
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4368
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4368
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4368
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '198', userid = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '12', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '210', '198', '2', '2026-10-21 17:04:39','0','0'); -- id=16096
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 981;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('379','01887', '1182', '147', '1887', '6', '410', '2460', '0', '', '0', '2026-10-21 17:04:39', '1887', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','981-6,','1','1','0','0','410','2460','0','','0','0.00','0','0','0','0'); -- id=4807
UPDATE sellbilldetail SET  lastbuyprice = 379.00 , meanbuyprice = 379.00, lastbuyprice_withDiscount = 379.00, meanbuyprice_withDiscount = 379.00
        , lastbuyprice_withTax = 379, meanbuyprice_withTax = 379, lastbuyprice_withDiscountAndTax = 379
                where sellbilldetailid = 4807;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1887, '2026-10-21', 2460, 2274, 2274
                    , 2274, 2274, 2274, 2274
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2274, 2274, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2274
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2274, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2274
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2274, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2274
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2274
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2274
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2274
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2460, 2274, 2274
                    , 2274, 2274, 2274, 2274
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2274, 2274, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2460, sellCostBuyPrice =sellCostBuyPrice+2274
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2274, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2274
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2274, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2274
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2274
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2274
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2274
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '276', userid = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2904';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1887', '1', '6', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '282', '276', '2', '2026-10-21 17:04:39','0','0'); -- id=16097
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 983;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('319','01889', '1182', '147', '1889', '18', '350', '6300', '0', '', '0', '2026-10-21 17:04:39', '1889', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','983-18,','1','1','0','0','350','6300','0','','0','0.00','0','0','0','0'); -- id=4808
UPDATE sellbilldetail SET  lastbuyprice = 319.00 , meanbuyprice = 319.00, lastbuyprice_withDiscount = 319.00, meanbuyprice_withDiscount = 319.00
        , lastbuyprice_withTax = 319, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 319
                where sellbilldetailid = 4808;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1889, '2026-10-21', 6300, 5742, 5742
                    , 5742, 5742, 5742, 5742
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 5742, 5742, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6300, sellCostBuyPrice =sellCostBuyPrice+5742
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5742, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5742
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5742, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5742
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5742
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5742
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5742
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6300, 5742, 5742
                    , 5742, 5742, 5742, 5742
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5742, 5742, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6300, sellCostBuyPrice =sellCostBuyPrice+5742
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5742, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5742
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5742, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5742
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5742
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5742
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5742
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2906';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1889', '1', '18', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '126', '2', '2026-10-21 17:04:39','0','0'); -- id=16098
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6765;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('289','01886', '1182', '147', '1886', '9', '320', '2880', '0', '', '0', '2026-10-21 17:04:39', '1886', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6765-9,','1','1','0','0','320','2880','0','','0','0.00','0','0','0','0'); -- id=4809
UPDATE sellbilldetail SET  lastbuyprice = 289.00 , meanbuyprice = 289.00, lastbuyprice_withDiscount = 289.00, meanbuyprice_withDiscount = 289.00
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where sellbilldetailid = 4809;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1886, '2026-10-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2880, 2601, 2601
                    , 2601, 2601, 2601, 2601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2601, 2601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '9', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '73', '64', '2', '2026-10-21 17:04:39','0','0'); -- id=16099
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 903;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('367.35','01856', '1182', '144', '1856', '6', '395', '2370', '0', '', '0', '2026-10-21 17:04:39', '1856', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','903-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=4810
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 367.35, meanbuyprice_withDiscount = 367.35
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 367.35
                where sellbilldetailid = 4810;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1856, '2026-10-21', 2370, 2370, 2370
                    , 2370, 2204.1, 2204.1, 2204.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2370, 2370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2204.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2204.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2204.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2370, 2370, 2370
                    , 2370, 2204.1, 2204.1, 2204.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2370, 2370, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2370
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2204.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2204.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2204.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2370
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2370
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1856', '1', '6', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '96', '2', '2026-10-21 17:04:39','0','0'); -- id=16100
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 902;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('372','01855', '1182', '144', '1855', '6', '400', '2400', '0', '', '0', '2026-10-21 17:04:39', '1855', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','902-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=4811
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 372.00, meanbuyprice_withDiscount = 372.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where sellbilldetailid = 4811;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1855, '2026-10-21', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , 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-21', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , 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 = '162', userid = '2', storedetaildate = '2026-10-21 17:04:39' WHERE storedetailid = '2872';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1855', '1', '6', '1', '1182', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '162', '2', '2026-10-21 17:04:39','0','0'); -- id=16101
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7297498.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 ('7276348.5','21150', '0', '2', 'اضافة فاتورة مبيعات', '1182', '7297498.5', '2026-10-21 17:04:39', '2',  'sellbillController.php','1','','0'); -- id=1463
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '21150', '21150', '2026-10-21', '2', '0', '0', '2026-10-21 17:04:39','اضافة فاتورة مبيعات رقم 1182','1','0',null,'0','1182','sellbillController.php?do=showDetail&sellbillid=1182'); -- id=4186
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4186', '419', '21150', '','0'); -- id=4297
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7297498', 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 ('4186', '143', '21150', '','0'); -- id=4188
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13312170', 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 ( '19421.1', '19421.1', '2026-10-21', '2', '0', '0', '2026-10-21 17:04:39','اضافة فاتورة مبيعات رقم 1182 - صرف البضاعة من المخزن','1','0',null,'0','1182','sellbillController.php?do=showDetail&sellbillid=1182'); -- id=4187
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4187', '402', '19421.1', '','0'); -- id=4298
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12315903.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 ('4187', '382', '19421.1', '','0'); -- id=4189
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25036871.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='4186,0,4187' where sellbillid=1182;
 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-21', 21150, 19755, 19755
                    , 19755, 19421.1, 19421.1, 19421.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,19755, 19755, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21150, sellCostBuyPrice =sellCostBuyPrice+19755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19755, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19755
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19421.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19421.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19421.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19755
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19755
                        , returnSellVal = returnSellVal+0, 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-21', 21150, 19755, 19755
                    , 19755, 19421.1, 19421.1, 19421.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,19755, 19755, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21150, sellCostBuyPrice =sellCostBuyPrice+19755
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19755, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19755
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19421.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19421.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19421.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19755
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19755
                        , returnSellVal = returnSellVal+0, 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, 21150, 19755, 19755
                    , 19755, 19421.1, 19421.1, 19421.1, 19755, 19755)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+21150, netSellCostBuyPrice = netSellCostBuyPrice+19755
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+19755
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+19755
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+19421.1
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+19421.1
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+19421.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+19755
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+19755;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c56a7ce7d and sellbillId = 1182 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:34:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:04:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:04:39', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16656
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:36:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:06:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:06:15', '2', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1182'); -- id=16657
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:36:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:06:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:06:18', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16658
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:37:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:07:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 17:07:06', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16659
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580.00',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2026-10-21 17:12:18',7)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2026-10-21 17:12:18', userid = 7; -- id=2404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:42:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:12:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:12:24', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16660
UPDATE product SET productName = 'موديل 119 يورو', productDescription = '', productCatId = '166', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '437.1',meanbuyprice = '470.00',meanbuyprice_withDiscount = '437.1' , productbuypricereal = '470.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='437.1',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='470',meanbuyprice_withTax='470',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='437.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2341';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2341, 1,'2026-10-21 17:12:25',7)
                ON DUPLICATE KEY UPDATE productid = 2341, edited = 1, sysdate = '2026-10-21 17:12:25', userid = 7; -- id=3458
UPDATE product SET productName = 'موديلات 580 زد و بروفيت', productDescription = '', productCatId = '116', productBuyPrice = '580.00', productSellAllPrice = '580.00', productSellUnitPrice = '580.00', productSellHalfPrice = '580.00', productDate = '2026-10-07', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580.00',lastbuyprice_withDiscount = '533.6',meanbuyprice = '580.00',meanbuyprice_withDiscount = '533.6' , productbuypricereal = '580.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='533.6',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='580',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='533.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 = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2026-10-21 17:12:54',7)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2026-10-21 17:12:54', userid = 7; -- id=2404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:42:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:12:55", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:12:55', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16661
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:43:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:13:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:13:19', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16662
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:43:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:13:27", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:13:27', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16663
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:44:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:14:51", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:14:51', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16664
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:45:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:15:55", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:15:55', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16665
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 ('هودي سوبر صاصا','','177','510','550','0','0','2026-10-21','0','7','0','','0','0','0','0','0','510','510','510','510','510','0','7.84','0','0','.','0','0','0','510','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','510','510','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','510','0','0','0','0','0','0','','','0','0','0','0'); -- id=2346
UPDATE product SET productName = 'هودي سوبر صاصا', productDescription = '', productCatId = '177', productBuyPrice = '510', productSellAllPrice = '550', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '7.84' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',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='510',meanbuyprice_withTax='510',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='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2346';
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', '2346', '1', '2026-10-21', '7', '0','0234601','550','0','0','510','','0','0','0','0','0','0','0','0','0','0'); -- id=2346
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2346', '1', '0', '7', '2026-10-21'); -- id=3740
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2346', '1', '0', '0', '2346', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16102
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2346, 1,'2026-10-21 17:15:55',7)
                ON DUPLICATE KEY UPDATE productid = 2346, edited = 1, sysdate = '2026-10-21 17:15:55', userid = 7; -- id=3492
UPDATE product SET productName = 'هودي سوبر صاصا', productDescription = '', productCatId = '177', productBuyPrice = '510.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '7.84' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',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='510',meanbuyprice_withTax='510',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='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2346';
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 ('هودي نجمه صاصا','','177','500','540','0','0','2026-10-21','0','7','0','','0','0','0','0','0','500','500','500','500','500','0','8','0','0','.','0','0','0','500','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','500','500','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','500','0','0','0','0','0','0','','','0','0','0','0'); -- id=2347
UPDATE product SET productName = 'هودي نجمه صاصا', productDescription = '', productCatId = '177', productBuyPrice = '500', productSellAllPrice = '540', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2347';
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', '2347', '1', '2026-10-21', '7', '0','0234701','540','0','0','500','','0','0','0','0','0','0','0','0','0','0'); -- id=2347
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2347', '1', '0', '7', '2026-10-21'); -- id=3741
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2347', '1', '0', '0', '2347', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16103
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2347, 1,'2026-10-21 17:15:55',7)
                ON DUPLICATE KEY UPDATE productid = 2347, edited = 1, sysdate = '2026-10-21 17:15:55', userid = 7; -- id=3493
UPDATE product SET productName = 'هودي نجمه صاصا', productDescription = '', productCatId = '177', productBuyPrice = '500.00', productSellAllPrice = '540.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2347';
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 ('هودي جينز صاصا','','177','580','630','0','0','2026-10-21','0','7','0','','0','0','0','0','0','580','580','580','580','580','0','8.62','0','0','.','0','0','0','580','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','580','580','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','580','0','0','0','0','0','0','','','0','0','0','0'); -- id=2348
UPDATE product SET productName = 'هودي جينز صاصا', productDescription = '', productCatId = '177', productBuyPrice = '580', productSellAllPrice = '630', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02348',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580' , buypricereal_precentage = '0' , buytotal_precentage = '8.62' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',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='580',meanbuyprice_withTax='580',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 = '2348';
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', '2348', '1', '2026-10-21', '7', '0','0234801','630','0','0','580','','0','0','0','0','0','0','0','0','0','0'); -- id=2348
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2348', '1', '0', '7', '2026-10-21'); -- id=3742
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2348', '1', '0', '0', '2348', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16104
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2348, 1,'2026-10-21 17:15:55',7)
                ON DUPLICATE KEY UPDATE productid = 2348, edited = 1, sysdate = '2026-10-21 17:15:55', userid = 7; -- id=3494
UPDATE product SET productName = 'هودي جينز صاصا', productDescription = '', productCatId = '177', productBuyPrice = '580.00', productSellAllPrice = '630.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02348',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580' , buypricereal_precentage = '0' , buytotal_precentage = '8.62' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',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='580',meanbuyprice_withTax='580',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 = '2348';
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 ('راوند شاو صاصا','','177','470','500','0','0','2026-10-21','0','7','0','','0','0','0','0','0','470','470','470','470','470','0','6.38','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=2349
UPDATE product SET productName = 'راوند شاو صاصا', productDescription = '', productCatId = '177', productBuyPrice = '470', productSellAllPrice = '500', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '6.38' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2349';
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', '2349', '1', '2026-10-21', '7', '0','0234901','500','0','0','470','','0','0','0','0','0','0','0','0','0','0'); -- id=2349
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2349', '1', '0', '7', '2026-10-21'); -- id=3743
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2349', '1', '0', '0', '2349', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16105
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2349, 1,'2026-10-21 17:15:55',7)
                ON DUPLICATE KEY UPDATE productid = 2349, edited = 1, sysdate = '2026-10-21 17:15:55', userid = 7; -- id=3495
UPDATE product SET productName = 'راوند شاو صاصا', productDescription = '', productCatId = '177', productBuyPrice = '470.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '6.38' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2349';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:45:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:15:56", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:15:56', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16666
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:46:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:16:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:16:04', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16667
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:47:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:17:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:17:21', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16668
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 ('06ad8c9245b748', '2026-10-21 17:16:04', '183', '30000.00', '67120', '0', '0', '37120.00',  '37120.00', '0', '37120', '1', '2026-10-21 17:17:21', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=294
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 ('02346', '294', '177', '2346', '20', '510', '10200.00', '0', '', '2026-10-21 17:17:21', '2346','','','0','0','0','0','0',null,'510','10200','0','0','0','0','0','0','0','0','1'); -- id=1652
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:16:04', 1, 2346, 0, 0
                    , 510, 20, 0, 0, 7, '2026-10-21 17:17:21')
                ON DUPLICATE KEY UPDATE buyprice = 510,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:17:21' ; -- id=6963
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2346', '510', '20', '0', 'buyBillController.php', '1652', '', '0', '0'); -- id=1211
UPDATE product SET  productBuyPrice = "510" WHERE productId = 2346 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1652 ;
UPDATE product SET productName = 'هودي سوبر صاصا', productDescription = '', productCatId = '177', productBuyPrice = '510.00', productSellAllPrice = '550.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.84' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',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='510',meanbuyprice_withTax='510',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='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2346';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 510, meanbuyprice_withDiscount = 510
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where buybilldetailid = 1652;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 2346;
UPDATE storedetail SET  productquantity = '20', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3740';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2346', '1', '20', '0', '294', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '7', '2026-10-21 17:16:04','0','0'); -- id=16106
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 ('02347', '294', '177', '2347', '24', '500', '12000.00', '0', '', '2026-10-21 17:17:21', '2347','','','0','0','0','0','0',null,'500','12000','0','0','0','0','0','0','0','0','1'); -- id=1653
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:16:04', 1, 2347, 0, 0
                    , 500, 24, 0, 0, 7, '2026-10-21 17:17:21')
                ON DUPLICATE KEY UPDATE buyprice = 500,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:17:21' ; -- id=6964
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2347', '500', '24', '0', 'buyBillController.php', '1653', '', '0', '0'); -- id=1212
UPDATE product SET  productBuyPrice = "500" WHERE productId = 2347 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1653 ;
UPDATE product SET productName = 'هودي نجمه صاصا', productDescription = '', productCatId = '177', productBuyPrice = '500.00', productSellAllPrice = '540.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2347';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 500, meanbuyprice_withDiscount = 500
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where buybilldetailid = 1653;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 2347;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3741';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2347', '1', '24', '0', '294', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-21 17:16:04','0','0'); -- id=16107
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 ('02348', '294', '177', '2348', '16', '580', '9280.00', '0', '', '2026-10-21 17:17:21', '2348','','','0','0','0','0','0',null,'580','9280','0','0','0','0','0','0','0','0','1'); -- id=1654
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:16:04', 1, 2348, 0, 0
                    , 580, 16, 0, 0, 7, '2026-10-21 17:17:21')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:17:21' ; -- id=6965
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2348', '580', '16', '0', 'buyBillController.php', '1654', '', '0', '0'); -- id=1213
UPDATE product SET  productBuyPrice = "580" WHERE productId = 2348 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1654 ;
UPDATE product SET productName = 'هودي جينز صاصا', productDescription = '', productCatId = '177', productBuyPrice = '580.00', productSellAllPrice = '630.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02348',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 = '8.62' , 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='580',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 = '2348';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 1654;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 2348;
UPDATE storedetail SET  productquantity = '16', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3742';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2348', '1', '16', '0', '294', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '16', '7', '2026-10-21 17:16:04','0','0'); -- id=16108
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 ('02349', '294', '177', '2349', '12', '470', '5640.00', '0', '', '2026-10-21 17:17:21', '2349','','','0','0','0','0','0',null,'470','5640','0','0','0','0','0','0','0','0','1'); -- id=1655
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:16:04', 1, 2349, 0, 0
                    , 470, 12, 0, 0, 7, '2026-10-21 17:17:21')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:17:21' ; -- id=6966
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2349', '470', '12', '0', 'buyBillController.php', '1655', '', '0', '0'); -- id=1214
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2349 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1655 ;
UPDATE product SET productName = 'راوند شاو صاصا', productDescription = '', productCatId = '177', productBuyPrice = '470.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2349';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 1655;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2349;
UPDATE storedetail SET  productquantity = '12', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3743';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2349', '1', '12', '0', '294', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '12', '7', '2026-10-21 17:16:04','0','0'); -- id=16109
UPDATE supplier SET  suppliercurrentDebt = '67120',suppliercurrentDebtInCurrency= '67120' , userid = '7', supplierdate = '2026-10-21 17:17:21'   WHERE supplierid = '183';
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 ('183', '30000.00', '37120', '0', 'اضافة فاتورة مشتريات', '294', '67120', '2026-10-21 17:16:04', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','37120','1','30000','37120','67120','0',''); -- id=813
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '37120', '37120', '2026-10-21', '7', '0', '0', '2026-10-21 17:17:21','اضافة فاتورة مشتريات رقم 294','1','0',null,'0','294','buyBillController.php?do=details&id=294'); -- id=4188
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4188', '382', '37120', '','0'); -- id=4299
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25073991.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 ('4188', '666', '37120', '','0'); -- id=4190
UPDATE accountstree SET name = 'صاصا', customName = 'صاصا', customNameEn = 'صاصا', nameEn = 'صاصا', parent = '81', accountNature = '1', theValue = '67120', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-15 08:46:29' WHERE id = '666';
update buybill set dailyentryid='4188,0' where buybillid=294;
COMMIT;
UPDATE product SET overAllAveragePrice = 510 WHERE productId = 2346;UPDATE product SET overAllAveragePrice = 500 WHERE productId = 2347;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 2348;UPDATE product SET overAllAveragePrice = 470 WHERE productId = 2349;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:47:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:17:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:17:21', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=294'); -- id=16669
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:47:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:17:52", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:17:52', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=294&type=2'); -- id=16670
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:48:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:18:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:18:28', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16671

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c8dbcee48
-- ----------------------------------------------------------------------------------------------------

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-21 17:18:28', '06ad8c8dbcee48', '1', '0.00', '0', '0', '1', '13600.00', '13600', '13600', '0', '2', '2026-10-21 17:18:28', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '16' ,'0','','','','','-1','0','0','0','0','0','13600','0','','0','0','13600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1183
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','اضافة فاتورة مبيعات','1183', '0', '2026-10-21 17:18:28', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '13600', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:18:28','0','0','',''); -- id=1408
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1369;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('850','01928', '1183', '155', '1928', '3', '900', '2700', '0', '', '0', '2026-10-21 17:18:28', '1928', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','1369-3,','1','1','0','0','900','2700','0','','0','0.00','0','0','0','0'); -- id=4812
UPDATE sellbilldetail SET  lastbuyprice = 850.00 , meanbuyprice = 850.00, lastbuyprice_withDiscount = 850.00, meanbuyprice_withDiscount = 850.00
        , lastbuyprice_withTax = 850, meanbuyprice_withTax = 1396.43, lastbuyprice_withDiscountAndTax = 850
                where sellbilldetailid = 4812;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1928, '2026-10-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-21 17:18:28' WHERE storedetailid = '3088';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '2', '3', '1', '1183', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '6', '4', '2026-10-21 17:18:28','0','0'); -- id=16110
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6311;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('800','02115', '1183', '181', '2115', '10', '850', '8500', '0', '', '0', '2026-10-21 17:18:28', '2115', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6311-10,','1','1','0','0','850','8500','0','','0','0.00','0','0','0','0'); -- id=4813
UPDATE sellbilldetail SET  lastbuyprice = 800.00 , meanbuyprice = 800.00, lastbuyprice_withDiscount = 800.00, meanbuyprice_withDiscount = 800.00
        , lastbuyprice_withTax = 800, meanbuyprice_withTax = 800, lastbuyprice_withDiscountAndTax = 800
                where sellbilldetailid = 4813;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2115, '2026-10-21', 8500, 8000, 8000
                    , 8000, 8000, 8000, 8000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8500, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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 (2, '2026-10-21', 8500, 8000, 8000
                    , 8000, 8000, 8000, 8000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8500, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '4', storedetaildate = '2026-10-21 17:18:28' WHERE storedetailid = '3552';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2115', '2', '10', '1', '1183', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '44', '4', '2026-10-21 17:18:28','0','0'); -- id=16111
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6374;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('730','02191', '1183', '94', '2191', '3', '800', '2400', '0', '', '0', '2026-10-21 17:18:28', '2191', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6374-3,','1','1','0','0','800','2400','0','','0','0.00','0','0','0','0'); -- id=4814
UPDATE sellbilldetail SET  lastbuyprice = 730.00 , meanbuyprice = 730.00, lastbuyprice_withDiscount = 730.00, meanbuyprice_withDiscount = 730.00
        , lastbuyprice_withTax = 730, meanbuyprice_withTax = 730, lastbuyprice_withDiscountAndTax = 730
                where sellbilldetailid = 4814;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2191, '2026-10-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-21 17:18:28' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2191', '2', '3', '1', '1183', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '33', '4', '2026-10-21 17:18:28','0','0'); -- id=16112
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1165482.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 ('1151882.875','13600', '0', '3', 'اضافة فاتورة مبيعات', '1183', '1165482.875', '2026-10-21 17:18:28', '4',  'sellbillController.php','1','','0'); -- id=1464
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13600', '13600', '2026-10-21', '4', '0', '0', '2026-10-21 17:18:28','اضافة فاتورة مبيعات رقم 1183','1','0',null,'0','1183','sellbillController.php?do=showDetail&sellbillid=1183'); -- id=4189
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4189', '501', '13600', '','0'); -- id=4300
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1165482.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 ('4189', '143', '13600', '','0'); -- id=4191
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13325770', 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 ( '12740', '12740', '2026-10-21', '4', '0', '0', '2026-10-21 17:18:28','اضافة فاتورة مبيعات رقم 1183 - صرف البضاعة من المخزن','1','0',null,'0','1183','sellbillController.php?do=showDetail&sellbillid=1183'); -- id=4190
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4190', '402', '12740', '','0'); -- id=4301
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12328643.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 ('4190', '492', '12740', '','0'); -- id=4192
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1559657', 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='4189,0,4190' where sellbillid=1183;
 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-21', 13600, 12740, 12740
                    , 12740, 12740, 12740, 12740
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12740, 14379.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13600, sellCostBuyPrice =sellCostBuyPrice+12740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14379.29
                        , returnSellVal = returnSellVal+0, 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-21', 13600, 12740, 12740
                    , 12740, 12740, 12740, 12740
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12740, 14379.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13600, sellCostBuyPrice =sellCostBuyPrice+12740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14379.29
                        , returnSellVal = returnSellVal+0, 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, 13600, 12740, 12740
                    , 12740, 12740, 12740, 12740, 12740, 14379.29)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+13600, netSellCostBuyPrice = netSellCostBuyPrice+12740
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+12740
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+12740
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+12740
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+12740
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+12740
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+12740
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14379.29;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c8dbcee48 and sellbillId = 1183 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:48:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:18:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:18:28', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16672
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:50:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:20:47", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:20:47', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16673
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:50:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:20:51", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:20:51', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16674
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:51:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:21:10", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:21:10', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16675
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:51:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:21:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:21:17', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16676
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:51:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:21:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:21:42', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16677
UPDATE product SET productName = 'موديل جاكت 450 محمد سعدون', productDescription = '', productCatId = '170', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02070',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '405',meanbuyprice = '450.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2070';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2070, 1,'2026-10-21 17:21:57',7)
                ON DUPLICATE KEY UPDATE productid = 2070, edited = 1, sysdate = '2026-10-21 17:21:57', userid = 7; -- id=3028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:52:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:22:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:22:11', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16678
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:52:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:22:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:22:25', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16679
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:52:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:22:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:22:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16680
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:52:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:22:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:22:36', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16681
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:54:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:24:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:24:00', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16682
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 ('06ad8caa1d123f', '2026-10-21 17:22:25', '178', '36450.00', '64395', '10', '1', '31050.00',  '27945.00', '0', '27945', '1', '2026-10-21 17:24:00', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=295
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 ('02070', '295', '170', '2070', '36', '450', '16200.00', '0', '', '2026-10-21 17:24:00', '2070','','','0','0','0','0','0',null,'450','16200','0','0','0','0','0','0','0','0','1'); -- id=1656
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:22:25', 1, 2070, 0, 0
                    , 405, 36, 0, 0, 7, '2026-10-21 17:24:00')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:24:00' ; -- id=6967
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2070', '450', '36', '0', 'buyBillController.php', '1656', '', '0', '0'); -- id=1215
UPDATE product SET  productBuyPrice = "450" WHERE productId = 2070 ;
UPDATE buybilldetail SET  quantitybefore = 19 WHERE buybilldetailid = 1656 ;
UPDATE product SET productName = 'موديل جاكت 450 محمد سعدون', productDescription = '', productCatId = '170', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02070',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '405',meanbuyprice = '450',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2070';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 1656;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 2070;
UPDATE storedetail SET  productquantity = '55', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3429';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2070', '1', '36', '0', '295', 'اضافة فاتورة مشتريات', 'buyBillController.php', '19', '55', '7', '2026-10-21 17:22:25','0','0'); -- id=16113
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 ('02070', '295', '170', '2070', '33', '450', '14850.00', '0', '', '2026-10-21 17:24:00', '2070','','','0','0','0','0','0',null,'450','14850','0','0','0','0','0','0','0','0','1'); -- id=1657
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:22:25', 1, 2070, 0, 0
                    , 405, 33, 0, 0, 7, '2026-10-21 17:24:00')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:24:00' ; -- id=6967
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2070', '450', '33', '0', 'buyBillController.php', '1657', '', '0', '0'); -- id=1216
UPDATE product SET  productBuyPrice = "450" WHERE productId = 2070 ;
UPDATE buybilldetail SET  quantitybefore = 55 WHERE buybilldetailid = 1657 ;
UPDATE product SET productName = 'موديل جاكت 450 محمد سعدون', productDescription = '', productCatId = '170', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '02070',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '405',meanbuyprice = '450',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2070';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 1657;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 2070;
UPDATE storedetail SET  productquantity = '88', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3429';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2070', '1', '33', '0', '295', 'اضافة فاتورة مشتريات', 'buyBillController.php', '55', '88', '7', '2026-10-21 17:22:25','0','0'); -- id=16114
UPDATE supplier SET  suppliercurrentDebt = '64395',suppliercurrentDebtInCurrency= '64395' , userid = '7', supplierdate = '2026-10-21 17:24:00'   WHERE supplierid = '178';
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 ('178', '36450.00', '27945', '0', 'اضافة فاتورة مشتريات', '295', '64395', '2026-10-21 17:22:25', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','27945','1','36450','27945','64395','0',''); -- id=814
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '27945', '27945', '2026-10-21', '7', '0', '0', '2026-10-21 17:24:00','اضافة فاتورة مشتريات رقم 295','1','0',null,'0','295','buyBillController.php?do=details&id=295'); -- id=4191
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4191', '382', '27945', '','0'); -- id=4302
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25101936.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 ('4191', '661', '27945', '','0'); -- id=4193
UPDATE accountstree SET name = 'محمد سعدون - مورد', customName = 'محمد سعدون - مورد', customNameEn = 'محمد سعدون - مورد', nameEn = 'محمد سعدون - مورد', parent = '81', accountNature = '1', theValue = '64395', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 21:34:05' WHERE id = '661';
update buybill set dailyentryid='4191,0' where buybillid=295;
COMMIT;
UPDATE product SET overAllAveragePrice = 405 WHERE productId = 2070;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:54:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:24:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:24:00', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=295'); -- id=16683
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:54:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:24:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:24:07', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=295&type=2'); -- id=16684
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:55:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:25:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:25:42', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16685
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-21 13:55:42";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:25:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:25:42', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16686
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:55:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:25:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:25:45', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16687
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:55:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:25:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:25:46', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16688
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:55:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:25:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:25:52', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16689

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c6706851f
-- ----------------------------------------------------------------------------------------------------

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-21 17:25:52', '06ad8c6706851f', '1', '0.00', '0', '0', '1', '38160.00', '38160', '38160', '0', '1', '2026-10-21 17:25:52', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '84' ,'0','','','','','-1','0','0','0','0','0','38160','0','','0','0','38160','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1184
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','اضافة فاتورة مبيعات','1184', '0', '2026-10-21 17:25:52', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '38160', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:25:52','0','0','',''); -- id=1409
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+21 where id = 6132;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02085', '1184', '174', '2085', '21', '460', '9660', '0', '', '0', '2026-10-21 17:25:52', '2085', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6132-21,','1','1','0','0','460','9660','0','','0','0.00','0','0','0','0'); -- id=4815
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4815;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2085, '2026-10-21', 9660, 9660, 9660
                    , 9660, 8694, 8694, 8694
                    , 0, 0, 0, 0
                    , 0, 0, 0, 21, 0, 9660, 9660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9660, sellCostBuyPrice =sellCostBuyPrice+9660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8694, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8694
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8694
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9660
                            , 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
                        , 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-21', 9660, 9660, 9660
                    , 9660, 8694, 8694, 8694
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9660, 9660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9660, sellCostBuyPrice =sellCostBuyPrice+9660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8694, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8694
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8694
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9660
                            , 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;
UPDATE storedetail SET  productquantity = '168', userid = '2', storedetaildate = '2026-10-21 17:25:52' WHERE storedetailid = '3444';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2085', '1', '21', '1', '1184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '189', '168', '2', '2026-10-21 17:25:52','0','0'); -- id=16115
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6021;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('506','02031', '1184', '166', '2031', '12', '550', '6600', '0', '', '0', '2026-10-21 17:25:52', '2031', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6021-12,','1','1','0','0','550','6600','0','','0','0.00','0','0','0','0'); -- id=4816
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 511.50, meanbuyprice_withDiscount = 510.62
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 511.5
                where sellbilldetailid = 4816;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2031, '2026-10-21', 6600, 6600, 6600
                    , 6600, 6138, 6127.44, 6121.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6138, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6127.44
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6121.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 6600, 6600, 6600
                    , 6600, 6138, 6127.44, 6121.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6138, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6127.44
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6121.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 17:25:52' WHERE storedetailid = '3390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2031', '1', '12', '1', '1184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '96', '84', '2', '2026-10-21 17:25:52','0','0'); -- id=16116
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6956;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('437.1','02341', '1184', '166', '2341', '12', '470', '5640', '0', '', '0', '2026-10-21 17:25:52', '2341', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6956-12,','1','1','0','0','470','5640','0','','0','0.00','0','0','0','0'); -- id=4817
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 437.10, meanbuyprice_withDiscount = 437.10
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 437.1
                where sellbilldetailid = 4817;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2341, '2026-10-21', 5640, 5640, 5640
                    , 5640, 5245.2, 5245.2, 5245.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5640, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5245.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5245.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5245.2
                            , 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-21', 5640, 5640, 5640
                    , 5640, 5245.2, 5245.2, 5245.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5640, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5245.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5245.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5245.2
                            , 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 = '2', storedetaildate = '2026-10-21 17:25:52' WHERE storedetailid = '3735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2341', '1', '12', '1', '1184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '24', '2', '2026-10-21 17:25:52','0','0'); -- id=16117
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6018;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('296','02028', '1184', '166', '2028', '12', '320', '3840', '0', '', '0', '2026-10-21 17:25:52', '2028', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6018-6,6948-6,','1','1','0','0','320','3840','0','','0','0.00','0','0','0','0'); -- id=4818
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 297.60, meanbuyprice_withDiscount = 297.60
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where sellbilldetailid = 4818;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2028, '2026-10-21', 3840, 3840, 3840
                    , 3840, 3571.2, 3571.2, 3563.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3571.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3563.52
                            , 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-21', 3840, 3840, 3840
                    , 3840, 3571.2, 3571.2, 3563.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3571.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3563.52
                            , 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 = '138', userid = '2', storedetaildate = '2026-10-21 17:25:52' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '12', '1', '1184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '150', '138', '2', '2026-10-21 17:25:52','0','0'); -- id=16118
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+27 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', '1184', '147', '1884', '27', '460', '12420', '0', '', '0', '2026-10-21 17:25:52', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-27,','1','1','0','0','460','12420','0','','0','0.00','0','0','0','0'); -- id=4819
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 = 4819;
 INSERT INTO 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-21', 12420, 11583, 11583
                    , 11583, 11583, 11583, 11583
                    , 0, 0, 0, 0
                    , 0, 0, 0, 27, 0, 11583, 11583, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12420, sellCostBuyPrice =sellCostBuyPrice+11583
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11583, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11583, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11583
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11583
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11583
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 12420, 11583, 11583
                    , 11583, 11583, 11583, 11583
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11583, 11583, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12420, sellCostBuyPrice =sellCostBuyPrice+11583
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11583, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11583
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11583, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11583
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11583
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11583
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11583
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '243', userid = '2', storedetaildate = '2026-10-21 17:25:52' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '27', '1', '1184', 'اضافة فاتورة مبيعات', 'sellbillController.php', '270', '243', '2', '2026-10-21 17:25:52','0','0'); -- id=16119
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7335658.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 ('7297498.5','38160', '0', '2', 'اضافة فاتورة مبيعات', '1184', '7335658.5', '2026-10-21 17:25:52', '2',  'sellbillController.php','1','','0'); -- id=1465
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '38160', '38160', '2026-10-21', '2', '0', '0', '2026-10-21 17:25:52','اضافة فاتورة مبيعات رقم 1184','1','0',null,'0','1184','sellbillController.php?do=showDetail&sellbillid=1184'); -- id=4192
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4192', '419', '38160', '','0'); -- id=4303
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7335658', 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 ('4192', '143', '38160', '','0'); -- id=4194
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13363930', 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 ( '35231.4', '35231.4', '2026-10-21', '2', '0', '0', '2026-10-21 17:25:52','اضافة فاتورة مبيعات رقم 1184 - صرف البضاعة من المخزن','1','0',null,'0','1184','sellbillController.php?do=showDetail&sellbillid=1184'); -- id=4193
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4193', '402', '35231.4', '','0'); -- id=4304
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12363875.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 ('4193', '382', '35231.4', '','0'); -- id=4195
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25066705.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='4192,0,4193' where sellbillid=1184;
 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-21', 38160, 37323, 37323
                    , 37323, 35231.4, 35220.84, 35207.16
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,37323, 37323, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+38160, sellCostBuyPrice =sellCostBuyPrice+37323
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37323, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37323
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35231.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35220.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35207.16
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37323
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37323
                        , returnSellVal = returnSellVal+0, 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-21', 38160, 37323, 37323
                    , 37323, 35231.4, 35220.84, 35207.16
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,37323, 37323, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+38160, sellCostBuyPrice =sellCostBuyPrice+37323
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37323, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37323
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35231.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35220.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35207.16
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37323
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37323
                        , returnSellVal = returnSellVal+0, 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, 38160, 37323, 37323
                    , 37323, 35231.4, 35220.84, 35207.16, 37323, 37323)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+38160, netSellCostBuyPrice = netSellCostBuyPrice+37323
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+37323
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+37323
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+35231.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+35220.84
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+35207.16
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+37323
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+37323;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c6706851f and sellbillId = 1184 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:55:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:25:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:25:52', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16690
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:56:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:26:14", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:26:14', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16691
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:59:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:29:18", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:29:18', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16692
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-21 13:59:19";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:29:19', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16693
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 13:59:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:29:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:29:30', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16694
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:00:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:30:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:30:07', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16695
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:00:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:30:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:30:27', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16696
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-21 14:00:27";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:30:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:30:27', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16697
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:00:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:30:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:30:29', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16698
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:01:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:31:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:31:57', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16699
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:13", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:33:13', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16700
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:33:14', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16701
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:33:47', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16702
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 ('جاكيت فرو كابيشو تمبو','','108','480','500','0','0','2026-10-21','0','1','0','','0','0','0','0','0','480','480','480','480','480','0','4.17','0','0','.','0','0','0','480','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','480','480','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','480','0','0','0','0','0','0','','','0','0','0','0'); -- id=2350
UPDATE product SET productName = 'جاكيت فرو كابيشو تمبو', productDescription = '', productCatId = '108', productBuyPrice = '480', productSellAllPrice = '500', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '4.17' , 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 = '',webApiId='0',weightedDiscount='0',sortby='0',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='480',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='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 = '2350';
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', '2350', '1.00', '2026-10-21', '1', '0','0235001','500','0','0','480','','0','0','0','0','0','0','0','0','0','0'); -- id=2350
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2350', '1', '0', '1', '2026-10-21'); -- id=3744
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2350', '1', '0', '0', '2350', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16120
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2350, 1,'2026-10-21 17:33:47',1)
                ON DUPLICATE KEY UPDATE productid = 2350, edited = 1, sysdate = '2026-10-21 17:33:47', userid = 1; -- id=3497
UPDATE product SET productName = 'جاكيت فرو كابيشو تمبو', productDescription = '', productCatId = '108', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '4.17' , 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 = '',webApiId='0',weightedDiscount='0',sortby='0',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='480',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='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 = '2350';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:33:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16703
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:33:52', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16704
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-21 14:03:52";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:33:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:33:52', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16705
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:33:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16706
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:33:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16707
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:03:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:33:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:33:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16708
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:04:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:34:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:34:05', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16709

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8cc853b121
-- ----------------------------------------------------------------------------------------------------

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-21 17:34:05', '06ad8cc853b121', '1', '0.00', '0', '0', '1', '11040.00', '11040', '11040', '0', '1', '2026-10-21 17:34:05', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','11040','0','','0','0','11040','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1185
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','اضافة فاتورة مبيعات','1185', '0', '2026-10-21 17:34:05', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11040', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:34:05','0','0','',''); -- id=1410
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+24 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', '1185', '147', '1884', '24', '460', '11040', '0', '', '0', '2026-10-21 17:34:05', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-24,','1','1','0','0','460','11040','0','','0','0.00','0','0','0','0'); -- id=4820
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 = 4820;
 INSERT INTO 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-21', 11040, 10296, 10296
                    , 10296, 10296, 10296, 10296
                    , 0, 0, 0, 0
                    , 0, 0, 0, 24, 0, 10296, 10296, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11040, sellCostBuyPrice =sellCostBuyPrice+10296
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10296, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10296
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10296, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10296
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10296
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10296
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+24
                        , netQuantityRet = netQuantityRet+0;
 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-21', 11040, 10296, 10296
                    , 10296, 10296, 10296, 10296
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10296, 10296, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11040, sellCostBuyPrice =sellCostBuyPrice+10296
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10296, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10296
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10296, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10296
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10296
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10296
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '219', userid = '2', storedetaildate = '2026-10-21 17:34:05' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '24', '1', '1185', 'اضافة فاتورة مبيعات', 'sellbillController.php', '243', '219', '2', '2026-10-21 17:34:05','0','0'); -- id=16121
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7346698.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 ('7335658.5','11040', '0', '2', 'اضافة فاتورة مبيعات', '1185', '7346698.5', '2026-10-21 17:34:05', '2',  'sellbillController.php','1','','0'); -- id=1466
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11040', '11040', '2026-10-21', '2', '0', '0', '2026-10-21 17:34:05','اضافة فاتورة مبيعات رقم 1185','1','0',null,'0','1185','sellbillController.php?do=showDetail&sellbillid=1185'); -- id=4194
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4194', '419', '11040', '','0'); -- id=4305
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7346698', 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 ('4194', '143', '11040', '','0'); -- id=4196
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13374970', 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 ( '10296', '10296', '2026-10-21', '2', '0', '0', '2026-10-21 17:34:05','اضافة فاتورة مبيعات رقم 1185 - صرف البضاعة من المخزن','1','0',null,'0','1185','sellbillController.php?do=showDetail&sellbillid=1185'); -- id=4195
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4195', '402', '10296', '','0'); -- id=4306
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12374171.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 ('4195', '382', '10296', '','0'); -- id=4197
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25056409.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='4194,0,4195' where sellbillid=1185;
 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-21', 11040, 10296, 10296
                    , 10296, 10296, 10296, 10296
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10296, 10296, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11040, sellCostBuyPrice =sellCostBuyPrice+10296
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10296, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10296
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10296, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10296
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10296
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10296
                        , returnSellVal = returnSellVal+0, 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-21', 11040, 10296, 10296
                    , 10296, 10296, 10296, 10296
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10296, 10296, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11040, sellCostBuyPrice =sellCostBuyPrice+10296
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10296, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10296
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10296, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10296
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10296
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10296
                        , returnSellVal = returnSellVal+0, 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, 11040, 10296, 10296
                    , 10296, 10296, 10296, 10296, 10296, 10296)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11040, netSellCostBuyPrice = netSellCostBuyPrice+10296
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10296
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10296
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+10296
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+10296
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+10296
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10296
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+10296;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8cc853b121 and sellbillId = 1185 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:04:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:34:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:34:05', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16710
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:35:19', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16711
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-21 14:05:19";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:35:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:35:19', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16712
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:35:21', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16713
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:35:26', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16714

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8cb70711f0
-- ----------------------------------------------------------------------------------------------------

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-21 17:35:26', '06ad8cb70711f0', '1', '0.00', '0', '0', '1', '32670.00', '32670', '32670', '0', '1', '2026-10-21 17:35:26', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '72' ,'0','','','','','-1','0','0','0','0','0','32670','0','','0','0','32670','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1186
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','اضافة فاتورة مبيعات','1186', '0', '2026-10-21 17:35:26', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '32670', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:35:26','0','0','',''); -- id=1411
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6021;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6955;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('507.83','02031', '1186', '166', '2031', '18', '550', '9900', '0', '', '0', '2026-10-21 17:35:26', '2031', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6021-12,6955-6,','1','1','0','0','550','9900','0','','0','0.00','0','0','0','0'); -- id=4821
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 511.50, meanbuyprice_withDiscount = 510.62
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 511.5
                where sellbilldetailid = 4821;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2031, '2026-10-21', 9900, 9900, 9900
                    , 9900, 9207, 9191.16, 9182.16
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 9900, 9900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9900, sellCostBuyPrice =sellCostBuyPrice+9900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9207, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9191.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9182.16
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 9900, 9900, 9900
                    , 9900, 9207, 9191.16, 9182.16
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9900, 9900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9900, sellCostBuyPrice =sellCostBuyPrice+9900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9207, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9191.16
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9182.16
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '3390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2031', '1', '18', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '66', '2', '2026-10-21 17:35:26','0','0'); -- id=16122
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6132;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02085', '1186', '174', '2085', '9', '460', '4140', '0', '', '0', '2026-10-21 17:35:26', '2085', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6132-9,','1','1','0','0','460','4140','0','','0','0.00','0','0','0','0'); -- id=4822
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4822;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2085, '2026-10-21', 4140, 4140, 4140
                    , 4140, 3726, 3726, 3726
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3726, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3726
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3726
                            , 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-21', 4140, 4140, 4140
                    , 4140, 3726, 3726, 3726
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4140, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3726, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3726
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3726
                            , 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 = '159', userid = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '3444';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2085', '1', '9', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '159', '2', '2026-10-21 17:35:26','0','0'); -- id=16123
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 997;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01903', '1186', '149', '1903', '6', '460', '2760', '0', '', '0', '2026-10-21 17:35:26', '1903', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','997-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=4823
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 423.20, meanbuyprice_withDiscount = 441.60
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 423.2
                where sellbilldetailid = 4823;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1903, '2026-10-21', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , 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-21', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , 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 = '6', userid = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '2920';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1903', '1', '6', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-21 17:35:26','0','0'); -- id=16124
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '1186', '153', '1920', '6', '395', '2370', '0', '', '0', '2026-10-21 17:35:26', '1920', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1081-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=4824
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 = 4824;
 INSERT INTO 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-21', 2370, 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+2370, 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-21', 2370, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, 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 = '6', userid = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '2937';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1920', '1', '6', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-21 17:35:26','0','0'); -- id=16125
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6948;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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.6','02028', '1186', '166', '2028', '12', '320', '3840', '0', '', '0', '2026-10-21 17:35:26', '2028', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6948-12,','1','1','0','0','320','3840','0','','0','0.00','0','0','0','0'); -- id=4825
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 297.60, meanbuyprice_withDiscount = 297.60
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 297.6
                where sellbilldetailid = 4825;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2028, '2026-10-21', 3840, 3840, 3840
                    , 3840, 3571.2, 3571.2, 3563.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3571.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3563.52
                            , 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-21', 3840, 3840, 3840
                    , 3840, 3571.2, 3571.2, 3563.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3571.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3563.52
                            , 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 = '126', userid = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '3387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2028', '1', '12', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '138', '126', '2', '2026-10-21 17:35:26','0','0'); -- id=16126
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+21 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', '1186', '147', '1884', '21', '460', '9660', '0', '', '0', '2026-10-21 17:35:26', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-21,','1','1','0','0','460','9660','0','','0','0.00','0','0','0','0'); -- id=4826
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 = 4826;
 INSERT INTO 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-21', 9660, 9009, 9009
                    , 9009, 9009, 9009, 9009
                    , 0, 0, 0, 0
                    , 0, 0, 0, 21, 0, 9009, 9009, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9660, sellCostBuyPrice =sellCostBuyPrice+9009
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9009, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9009
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9009, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9009
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9009
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9009
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9009
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 9660, 9009, 9009
                    , 9009, 9009, 9009, 9009
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9009, 9009, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9660, sellCostBuyPrice =sellCostBuyPrice+9009
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9009, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9009
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9009, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9009
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9009
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9009
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9009
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '198', userid = '2', storedetaildate = '2026-10-21 17:35:26' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '21', '1', '1186', 'اضافة فاتورة مبيعات', 'sellbillController.php', '219', '198', '2', '2026-10-21 17:35:26','0','0'); -- id=16127
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7379368.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 ('7346698.5','32670', '0', '2', 'اضافة فاتورة مبيعات', '1186', '7379368.5', '2026-10-21 17:35:26', '2',  'sellbillController.php','1','','0'); -- id=1467
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32670', '32670', '2026-10-21', '2', '0', '0', '2026-10-21 17:35:26','اضافة فاتورة مبيعات رقم 1186','1','0',null,'0','1186','sellbillController.php?do=showDetail&sellbillid=1186'); -- id=4196
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4196', '419', '32670', '','0'); -- id=4307
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7379368', 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 ('4196', '143', '32670', '','0'); -- id=4198
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13407640', 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 ( '30272.4', '30272.4', '2026-10-21', '2', '0', '0', '2026-10-21 17:35:26','اضافة فاتورة مبيعات رقم 1186 - صرف البضاعة من المخزن','1','0',null,'0','1186','sellbillController.php?do=showDetail&sellbillid=1186'); -- id=4197
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4197', '402', '30272.4', '','0'); -- id=4308
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12404443.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 ('4197', '382', '30272.4', '','0'); -- id=4199
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25026137.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='4196,0,4197' where sellbillid=1186;
 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-21', 32670, 31869, 31869
                    , 31869, 30272.4, 30366.96, 30239.88
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,31869, 30489, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32670, sellCostBuyPrice =sellCostBuyPrice+31869
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+31869, sellCostMeanBuyPrice = sellCostMeanBuyPrice+31869
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30272.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30366.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30239.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+31869
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30489
                        , returnSellVal = returnSellVal+0, 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-21', 32670, 31869, 31869
                    , 31869, 30272.4, 30366.96, 30239.88
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,31869, 30489, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32670, sellCostBuyPrice =sellCostBuyPrice+31869
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+31869, sellCostMeanBuyPrice = sellCostMeanBuyPrice+31869
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30272.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30366.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30239.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+31869
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30489
                        , returnSellVal = returnSellVal+0, 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, 32670, 31869, 31869
                    , 31869, 30272.4, 30366.96, 30239.88, 31869, 30489)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+32670, netSellCostBuyPrice = netSellCostBuyPrice+31869
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+31869
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+31869
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+30272.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+30366.96
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+30239.88
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+31869
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+30489;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8cb70711f0 and sellbillId = 1186 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:35:27', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16715
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:35:28', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16716
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 ('ترينج بوكس فيت تمبو','','103','725','750','0','0','2026-10-21','0','1','0','','0','0','0','0','0','725','725','725','725','725','0','3.45','0','0','.','0','0','0','725','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','725','725','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','725','0','0','0','0','0','0','','','0','0','0','0'); -- id=2351
UPDATE product SET productName = 'ترينج بوكس فيت تمبو', productDescription = '', productCatId = '103', productBuyPrice = '725', productSellAllPrice = '750', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '725',lastbuyprice_withDiscount = '725',meanbuyprice = '725',meanbuyprice_withDiscount = '725' , productbuypricereal = '725' , buypricereal_precentage = '0' , buytotal_precentage = '3.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='725',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='725',meanbuyprice_withTax='725',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='725',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2351';
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', '2351', '1.00', '2026-10-21', '1', '0','0235101','750','0','0','725','','0','0','0','0','0','0','0','0','0','0'); -- id=2351
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2351', '1', '0', '1', '2026-10-21'); -- id=3745
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2351', '1', '0', '0', '2351', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16128
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2351, 1,'2026-10-21 17:35:29',1)
                ON DUPLICATE KEY UPDATE productid = 2351, edited = 1, sysdate = '2026-10-21 17:35:29', userid = 1; -- id=3498
UPDATE product SET productName = 'ترينج بوكس فيت تمبو', productDescription = '', productCatId = '103', productBuyPrice = '725.00', productSellAllPrice = '750.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '725',lastbuyprice_withDiscount = '725',meanbuyprice = '725',meanbuyprice_withDiscount = '725' , productbuypricereal = '725' , buypricereal_precentage = '0' , buytotal_precentage = '3.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='725',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='725',meanbuyprice_withTax='725',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='725',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2351';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:35:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16717
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:35:31', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16718
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 ('شروال ابيض فورجيت','','27','400','415','0','0','2026-10-21','0','7','0','','0','0','0','0','0','400','400','400','400','400','0','3.75','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=2352
UPDATE product SET productName = 'شروال ابيض فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '400', productSellAllPrice = '415', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02352',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 = '3.75' , 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 = '2352';
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', '2352', '1', '2026-10-21', '7', '0','0235201','415','0','0','400','','0','0','0','0','0','0','0','0','0','0'); -- id=2352
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2352', '1', '0', '7', '2026-10-21'); -- id=3746
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2352', '1', '0', '0', '2352', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16129
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2352, 1,'2026-10-21 17:35:31',7)
                ON DUPLICATE KEY UPDATE productid = 2352, edited = 1, sysdate = '2026-10-21 17:35:31', userid = 7; -- id=3499
UPDATE product SET productName = 'شروال ابيض فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02352',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 = '3.75' , 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 = '2352';
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 ('مو فورجيت','','27','350','365','0','0','2026-10-21','0','7','0','','0','0','0','0','0','350','350','350','350','350','0','4.29','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=2353
UPDATE product SET productName = 'مو فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '350', productSellAllPrice = '365', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02353',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 = '4.29' , 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 = '2353';
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', '2353', '1', '2026-10-21', '7', '0','0235301','365','0','0','350','','0','0','0','0','0','0','0','0','0','0'); -- id=2353
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2353', '1', '0', '7', '2026-10-21'); -- id=3747
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2353', '1', '0', '0', '2353', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16130
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2353, 1,'2026-10-21 17:35:31',7)
                ON DUPLICATE KEY UPDATE productid = 2353, edited = 1, sysdate = '2026-10-21 17:35:31', userid = 7; -- id=3500
UPDATE product SET productName = 'مو فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '350.00', productSellAllPrice = '365.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02353',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 = '4.29' , 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 = '2353';
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 ('بلن فورجيت','','27','415','430','0','0','2026-10-21','0','7','0','','0','0','0','0','0','415','415','415','415','415','0','3.61','0','0','.','0','0','0','415','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','415','415','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','415','0','0','0','0','0','0','','','0','0','0','0'); -- id=2354
UPDATE product SET productName = 'بلن فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '415', productSellAllPrice = '430', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415' , buypricereal_precentage = '0' , buytotal_precentage = '3.61' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2354';
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', '2354', '1', '2026-10-21', '7', '0','0235401','430','0','0','415','','0','0','0','0','0','0','0','0','0','0'); -- id=2354
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2354', '1', '0', '7', '2026-10-21'); -- id=3748
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2354', '1', '0', '0', '2354', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16131
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2354, 1,'2026-10-21 17:35:31',7)
                ON DUPLICATE KEY UPDATE productid = 2354, edited = 1, sysdate = '2026-10-21 17:35:31', userid = 7; -- id=3501
UPDATE product SET productName = 'بلن فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '415.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415' , buypricereal_precentage = '0' , buytotal_precentage = '3.61' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2354';
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 ('واي لك فورجيت','','27','320','335','0','0','2026-10-21','0','7','0','','0','0','0','0','0','320','320','320','320','320','0','4.69','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=2355
UPDATE product SET productName = 'واي لك فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '320', productSellAllPrice = '335', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02355',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 = '4.69' , 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 = '2355';
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', '2355', '1', '2026-10-21', '7', '0','0235501','335','0','0','320','','0','0','0','0','0','0','0','0','0','0'); -- id=2355
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2355', '1', '0', '7', '2026-10-21'); -- id=3749
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2355', '1', '0', '0', '2355', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16132
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2355, 1,'2026-10-21 17:35:31',7)
                ON DUPLICATE KEY UPDATE productid = 2355, edited = 1, sysdate = '2026-10-21 17:35:31', userid = 7; -- id=3502
UPDATE product SET productName = 'واي لك فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '320.00', productSellAllPrice = '335.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02355',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 = '4.69' , 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 = '2355';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:35:33', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16719
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:35:33', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16720
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:35:35', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16721
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:05:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:35:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:35:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16722
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:36:05', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16723
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:36:14', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16724
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:36:30', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16725
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:36:35', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16726
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:36:49', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=16727
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:53", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:36:53', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16728

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8bdaba2703
-- ----------------------------------------------------------------------------------------------------

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-21 17:36:53', '06ad8bdaba2703', '1', '0.00', '0', '0', '1', '2975.00', '2975', '2975', '0', '1', '2026-10-21 17:36:53', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2975','0','','0','0','2975','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1187
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','اضافة فاتورة مبيعات','1187', '0', '2026-10-21 17:36:53', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2975', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:36:53','0','0','',''); -- id=1412
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1187', '175', '2088', '5', '595', '2975', '0', '', '0', '2026-10-21 17:36:53', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-5,','1','1','0','0','595','2975','0','','0','0.00','0','0','0','0'); -- id=4827
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 = 4827;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1106', userid = '6', storedetaildate = '2026-10-21 17:36:53' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '5', '1', '1187', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1111', '1106', '6', '2026-10-21 17:36:53','0','0'); -- id=16133
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1020390',  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 ('1017415','2975', '0', '4', 'اضافة فاتورة مبيعات', '1187', '1020390', '2026-10-21 17:36:53', '6',  'sellbillController.php','1','','0'); -- id=1468
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2975', '2975', '2026-10-21', '6', '0', '0', '2026-10-21 17:36:53','اضافة فاتورة مبيعات رقم 1187','1','0',null,'0','1187','sellbillController.php?do=showDetail&sellbillid=1187'); -- id=4198
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4198', '568', '2975', '','0'); -- id=4309
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1020390', 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 ('4198', '143', '2975', '','0'); -- id=4200
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13410615', 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 ( '2300', '2300', '2026-10-21', '6', '0', '0', '2026-10-21 17:36:53','اضافة فاتورة مبيعات رقم 1187 - صرف البضاعة من المخزن','1','0',null,'0','1187','sellbillController.php?do=showDetail&sellbillid=1187'); -- id=4199
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4199', '402', '2300', '','0'); -- id=4310
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12406743.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 ('4199', '382', '2300', '','0'); -- id=4201
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25023837.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='4198,0,4199' where sellbillid=1187;
 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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, 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300, 2300, 2300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2975, netSellCostBuyPrice = netSellCostBuyPrice+2300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8bdaba2703 and sellbillId = 1187 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:06:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:36:54", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:36:54', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16729
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:12', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16730
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:18', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16731
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16732
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:26", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:37:26', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16733
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 ('06ad8cdb761d85', '2026-10-21 17:35:35', '21', '546030.00', '691630', '0', '0', '145600.00',  '145600.00', '0', '145600', '1', '2026-10-21 17:37:26', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=296
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 ('02352', '296', '27', '2352', '80', '400', '32000.00', '0', '', '2026-10-21 17:37:26', '2352','','','0','0','0','0','0',null,'400','32000','0','0','0','0','0','0','0','0','1'); -- id=1658
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2352, 0, 0
                    , 400, 80, 0, 0, 7, '2026-10-21 17:37:26')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:37:26' ; -- id=6969
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2352', '400', '80', '0', 'buyBillController.php', '1658', '', '0', '0'); -- id=1217
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2352 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1658 ;
UPDATE product SET productName = 'شروال ابيض فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02352',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 = '3.75' , 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 = '2352';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 1658;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2352;
UPDATE storedetail SET  productquantity = '80', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3746';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2352', '1', '80', '0', '296', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '7', '2026-10-21 17:35:35','0','0'); -- id=16134
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 ('07945', '296', '27', '909', '80', '335', '26800.00', '0', '', '2026-10-21 17:37:26', '909','','','0','0','0','0','0',null,'335','26800','0','0','0','0','0','0','0','0','1'); -- id=1659
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 909, 0, 0
                    , 335, 80, 0, 0, 7, '2026-10-21 17:37:26')
                ON DUPLICATE KEY UPDATE buyprice = 335,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:37:26' ; -- id=6970
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('909', '335', '80', '0', 'buyBillController.php', '1659', '', '0', '0'); -- id=1218
UPDATE product SET  productBuyPrice = "335" WHERE productId = 909 ;
UPDATE buybilldetail SET  quantitybefore = 10 WHERE buybilldetailid = 1659 ;
UPDATE product SET productName = 'توشكا وا فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '335.00', productSellAllPrice = '355.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07945',type ='0', expireDate = '0' , dailyentryId = '264',isService = '0',isOptic = '0',lastbuyprice = '335',lastbuyprice_withDiscount = '335',meanbuyprice = '335',meanbuyprice_withDiscount = '335' , productbuypricereal = '335.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='335',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7945',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='335',meanbuyprice_withTax='335',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='335',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 = '909';
UPDATE buybilldetail SET  lastbuyprice = 335 , meanbuyprice = 335, lastbuyprice_withDiscount = 335, meanbuyprice_withDiscount = 335
        , lastbuyprice_withTax = 335, meanbuyprice_withTax = 335, lastbuyprice_withDiscountAndTax = 335
                where buybilldetailid = 1659;
UPDATE productunit SET proUnitBuyPrice  = 335 * productnumber WHERE productid = 909;
UPDATE storedetail SET  productquantity = '90', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '909';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('909', '1', '80', '0', '296', 'اضافة فاتورة مشتريات', 'buyBillController.php', '10', '90', '7', '2026-10-21 17:35:35','0','0'); -- id=16135
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 ('02353', '296', '27', '2353', '80', '350', '28000.00', '0', '', '2026-10-21 17:37:26', '2353','','','0','0','0','0','0',null,'350','28000','0','0','0','0','0','0','0','0','1'); -- id=1660
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2353, 0, 0
                    , 350, 80, 0, 0, 7, '2026-10-21 17:37:26')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:37:26' ; -- id=6971
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2353', '350', '80', '0', 'buyBillController.php', '1660', '', '0', '0'); -- id=1219
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2353 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1660 ;
UPDATE product SET productName = 'مو فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '350.00', productSellAllPrice = '365.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02353',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 = '4.29' , 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 = '2353';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 1660;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2353;
UPDATE storedetail SET  productquantity = '80', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2353', '1', '80', '0', '296', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '7', '2026-10-21 17:35:35','0','0'); -- id=16136
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 ('02354', '296', '27', '2354', '80', '415', '33200.00', '0', '', '2026-10-21 17:37:26', '2354','','','0','0','0','0','0',null,'415','33200','0','0','0','0','0','0','0','0','1'); -- id=1661
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2354, 0, 0
                    , 415, 80, 0, 0, 7, '2026-10-21 17:37:26')
                ON DUPLICATE KEY UPDATE buyprice = 415,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:37:26' ; -- id=6972
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2354', '415', '80', '0', 'buyBillController.php', '1661', '', '0', '0'); -- id=1220
UPDATE product SET  productBuyPrice = "415" WHERE productId = 2354 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1661 ;
UPDATE product SET productName = 'بلن فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '415.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.61' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2354';
UPDATE buybilldetail SET  lastbuyprice = 415 , meanbuyprice = 415, lastbuyprice_withDiscount = 415, meanbuyprice_withDiscount = 415
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 415, lastbuyprice_withDiscountAndTax = 415
                where buybilldetailid = 1661;
UPDATE productunit SET proUnitBuyPrice  = 415 * productnumber WHERE productid = 2354;
UPDATE storedetail SET  productquantity = '80', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2354', '1', '80', '0', '296', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '7', '2026-10-21 17:35:35','0','0'); -- id=16137
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 ('02355', '296', '27', '2355', '80', '320', '25600.00', '0', '', '2026-10-21 17:37:26', '2355','','','0','0','0','0','0',null,'320','25600','0','0','0','0','0','0','0','0','1'); -- id=1662
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2355, 0, 0
                    , 320, 80, 0, 0, 7, '2026-10-21 17:37:26')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:37:26' ; -- id=6973
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2355', '320', '80', '0', 'buyBillController.php', '1662', '', '0', '0'); -- id=1221
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2355 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1662 ;
UPDATE product SET productName = 'واي لك فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '320.00', productSellAllPrice = '335.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02355',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 = '4.69' , 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 = '2355';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 1662;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2355;
UPDATE storedetail SET  productquantity = '80', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3749';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2355', '1', '80', '0', '296', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '7', '2026-10-21 17:35:35','0','0'); -- id=16138
UPDATE supplier SET  suppliercurrentDebt = '379545',suppliercurrentDebtInCurrency= '691630' , userid = '7', supplierdate = '2026-10-21 17:37:26'   WHERE supplierid = '21';
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 ('21', '233945.00', '145600', '0', 'اضافة فاتورة مشتريات', '296', '379545', '2026-10-21 17:35:35', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','145600','1','546030','145600','691630','0',''); -- id=815
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '145600', '145600', '2026-10-21', '7', '0', '0', '2026-10-21 17:37:26','اضافة فاتورة مشتريات رقم 296','1','0',null,'0','296','buyBillController.php?do=details&id=296'); -- id=4200
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4200', '382', '145600', '','0'); -- id=4311
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25169437.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 ('4200', '440', '145600', '','0'); -- id=4202
UPDATE accountstree SET name = 'فورجيت - مورد', customName = 'فورجيت - مورد', customNameEn = 'فورجيت - مورد', nameEn = 'فورجيت - مورد', parent = '81', accountNature = '1', theValue = '145600', 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 = '440';
update buybill set dailyentryid='4200,0' where buybillid=296;
COMMIT;
UPDATE product SET overAllAveragePrice = 335 WHERE productId = 909;UPDATE product SET overAllAveragePrice = 400 WHERE productId = 2352;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 2353;UPDATE product SET overAllAveragePrice = 415 WHERE productId = 2354;UPDATE product SET overAllAveragePrice = 320 WHERE productId = 2355;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:26", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:37:26', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=296'); -- id=16734
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:29', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16735
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:37:31', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=296&type=2'); -- id=16736
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=16737
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16738
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16739
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:07:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:37:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-21 17:37:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=16740
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:08:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:38:35", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:38:35', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16741

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ce0635d77
-- ----------------------------------------------------------------------------------------------------

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-21 17:38:35', '06ad8ce0635d77', '1', '0.00', '0', '0', '1', '2975.00', '2975', '2975', '0', '1', '2026-10-21 17:38:35', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2975','0','','0','0','2975','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1188
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','اضافة فاتورة مبيعات','1188', '0', '2026-10-21 17:38:35', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2975', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:38:35','0','0','',''); -- id=1413
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1188', '175', '2088', '5', '595', '2975', '0', '', '0', '2026-10-21 17:38:35', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-5,','1','1','0','0','595','2975','0','','0','0.00','0','0','0','0'); -- id=4828
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 = 4828;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1101', userid = '6', storedetaildate = '2026-10-21 17:38:35' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '5', '1', '1188', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1106', '1101', '6', '2026-10-21 17:38:35','0','0'); -- id=16139
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1023365',  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 ('1020390','2975', '0', '4', 'اضافة فاتورة مبيعات', '1188', '1023365', '2026-10-21 17:38:35', '6',  'sellbillController.php','1','','0'); -- id=1469
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2975', '2975', '2026-10-21', '6', '0', '0', '2026-10-21 17:38:35','اضافة فاتورة مبيعات رقم 1188','1','0',null,'0','1188','sellbillController.php?do=showDetail&sellbillid=1188'); -- id=4201
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4201', '568', '2975', '','0'); -- id=4312
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1023365', 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 ('4201', '143', '2975', '','0'); -- id=4203
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13413590', 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 ( '2300', '2300', '2026-10-21', '6', '0', '0', '2026-10-21 17:38:35','اضافة فاتورة مبيعات رقم 1188 - صرف البضاعة من المخزن','1','0',null,'0','1188','sellbillController.php?do=showDetail&sellbillid=1188'); -- id=4202
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4202', '402', '2300', '','0'); -- id=4313
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12409043.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 ('4202', '382', '2300', '','0'); -- id=4204
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25167137.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='4201,0,4202' where sellbillid=1188;
 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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-21', 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2300, 2300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2975, sellCostBuyPrice =sellCostBuyPrice+2300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2300
                        , returnSellVal = returnSellVal+0, 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, 2975, 2300, 2300
                    , 2300, 2300, 2300, 2300, 2300, 2300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2975, netSellCostBuyPrice = netSellCostBuyPrice+2300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ce0635d77 and sellbillId = 1188 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:08:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:38:36", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:38:36', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16742
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:10:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:40:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:40:02', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16743
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:10:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:40:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:40:19', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16744
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:11";
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-21 14:11:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:14", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:41:14', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16745
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-21 14:11:14";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:41:14', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16746
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:16";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:17";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:18", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:41:18', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16747
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:31", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:41:31', '1', 'show', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16748
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:33", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:41:33', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16749
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 ('سوستا فورجت','','27','355','370','0','0','2026-10-21','0','7','0','','0','0','0','0','0','355','355','355','355','355','0','4.23','0','0','.','0','0','0','355','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','355','355','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','355','0','0','0','0','0','0','','','0','0','0','0'); -- id=2356
UPDATE product SET productName = 'سوستا فورجت', productDescription = '', productCatId = '27', productBuyPrice = '355', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02356',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355' , buypricereal_precentage = '0' , buytotal_precentage = '4.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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='355',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2356';
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', '2356', '1', '2026-10-21', '7', '0','0235601','370','0','0','355','','0','0','0','0','0','0','0','0','0','0'); -- id=2356
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2356', '1', '0', '7', '2026-10-21'); -- id=3750
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2356', '1', '0', '0', '2356', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16140
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2356, 1,'2026-10-21 17:41:33',7)
                ON DUPLICATE KEY UPDATE productid = 2356, edited = 1, sysdate = '2026-10-21 17:41:33', userid = 7; -- id=3503
UPDATE product SET productName = 'سوستا فورجت', productDescription = '', productCatId = '27', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02356',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355' , buypricereal_precentage = '0' , buytotal_precentage = '4.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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='355',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2356';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:41:35', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:11:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:41:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:41:37', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16751
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:14:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:44:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:44:07', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16752
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-21 14:14:07";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:44:08', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16753
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:14:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:44:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:44:08', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16754
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-21 14:14:08";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:44:08', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16755
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:14:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:44:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:44:12', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16756
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:14:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:44:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:44:22', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16757
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:16:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:46:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:46:28', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16758
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:16:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:46:38", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:46:38', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16759
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:18:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:48:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:48:31', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16760
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:49:20', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16761
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-21 14:19:20";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:49:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:49:20', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16762
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:49:22', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16763
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:49:23', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16764
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:49:29', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16765

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8cdaf34acc
-- ----------------------------------------------------------------------------------------------------

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-21 17:49:29', '06ad8cdaf34acc', '1', '0.00', '0', '0', '1', '10050.00', '10050', '10050', '0', '1', '2026-10-21 17:49:29', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','10050','0','','0','0','10050','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1189
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','اضافة فاتورة مبيعات','1189', '0', '2026-10-21 17:49:29', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:49:29','0','0','',''); -- id=1414
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', '1189', '147', '1884', '6', '460', '2760', '0', '', '0', '2026-10-21 17:49:29', '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=4829
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 = 4829;
 INSERT INTO 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-21', 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-21', 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 = '192', userid = '2', storedetaildate = '2026-10-21 17:49:29' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '6', '1', '1189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '198', '192', '2', '2026-10-21 17:49:29','0','0'); -- id=16141
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1189', '103', '1462', '3', '430', '1290', '0', '', '0', '2026-10-21 17:49:29', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4830
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 = 4830;
 INSERT INTO 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-21', 1290, 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+1290, 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-21', 1290, 1230, 1230
                    , 1230, 1230, 1230, 1230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1230, 1230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, 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 = '165', userid = '2', storedetaildate = '2026-10-21 17:49:29' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '3', '1', '1189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '165', '2', '2026-10-21 17:49:29','0','0'); -- id=16142
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6873;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('512','02319', '1189', '8', '2319', '5', '540', '2700', '0', '', '0', '2026-10-21 17:49:29', '2319', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6873-5,','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=4831
UPDATE sellbilldetail SET  lastbuyprice = 512.00 , meanbuyprice = 512.00, lastbuyprice_withDiscount = 512.00, meanbuyprice_withDiscount = 512.00
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where sellbilldetailid = 4831;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2319, '2026-10-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 17:49:29' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '1', '1189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 17:49:29','0','0'); -- id=16143
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6955;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('511.5','02031', '1189', '166', '2031', '6', '550', '3300', '0', '', '0', '2026-10-21 17:49:29', '2031', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6955-6,','1','1','0','0','550','3300','0','','0','0.00','0','0','0','0'); -- id=4832
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 511.50, meanbuyprice_withDiscount = 510.62
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 511.5
                where sellbilldetailid = 4832;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2031, '2026-10-21', 3300, 3300, 3300
                    , 3300, 3069, 3063.72, 3060.72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3069, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3063.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060.72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-21', 3300, 3300, 3300
                    , 3300, 3069, 3063.72, 3060.72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3069, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3063.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060.72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '2', storedetaildate = '2026-10-21 17:49:29' WHERE storedetailid = '3390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2031', '1', '6', '1', '1189', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '60', '2', '2026-10-21 17:49:29','0','0'); -- id=16144
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7389418.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 ('7379368.5','10050', '0', '2', 'اضافة فاتورة مبيعات', '1189', '7389418.5', '2026-10-21 17:49:29', '2',  'sellbillController.php','1','','0'); -- id=1470
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10050', '10050', '2026-10-21', '2', '0', '0', '2026-10-21 17:49:29','اضافة فاتورة مبيعات رقم 1189','1','0',null,'0','1189','sellbillController.php?do=showDetail&sellbillid=1189'); -- id=4203
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4203', '419', '10050', '','0'); -- id=4314
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7389418', 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 ('4203', '143', '10050', '','0'); -- id=4205
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13423640', 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 ( '9433', '9433', '2026-10-21', '2', '0', '0', '2026-10-21 17:49:29','اضافة فاتورة مبيعات رقم 1189 - صرف البضاعة من المخزن','1','0',null,'0','1189','sellbillController.php?do=showDetail&sellbillid=1189'); -- id=4204
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4204', '402', '9433', '','0'); -- id=4315
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12418476.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 ('4204', '382', '9433', '','0'); -- id=4206
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25157704.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='4203,0,4204' where sellbillid=1189;
 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-21', 10050, 9664, 9664
                    , 9664, 9433, 9427.72, 9424.72
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9664, 9664, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10050, sellCostBuyPrice =sellCostBuyPrice+9664
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9664, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9664
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9427.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9424.72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9664
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9664
                        , returnSellVal = returnSellVal+0, 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-21', 10050, 9664, 9664
                    , 9664, 9433, 9427.72, 9424.72
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9664, 9664, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10050, sellCostBuyPrice =sellCostBuyPrice+9664
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9664, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9664
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9427.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9424.72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9664
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9664
                        , returnSellVal = returnSellVal+0, 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, 10050, 9664, 9664
                    , 9664, 9433, 9427.72, 9424.72, 9664, 9664)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10050, netSellCostBuyPrice = netSellCostBuyPrice+9664
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9664
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9664
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9433
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9427.72
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9424.72
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9664
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9664;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8cdaf34acc and sellbillId = 1189 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:49:29', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16766
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:19:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:49:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:49:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16767
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:20:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:50:02", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:50:02', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16768
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:20:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:50:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:50:02', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=296'); -- id=16769
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:20:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:50:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:50:37', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16770

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8d0f96a3e5
-- ----------------------------------------------------------------------------------------------------

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-21 17:50:37', '06ad8d0f96a3e5', '1', '0.00', '0', '0', '1', '900.00', '900', '900', '0', '1', '2026-10-21 17:50:37', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','900','0','','0','0','900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1190
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','اضافة فاتورة مبيعات','1190', '0', '2026-10-21 17:50:37', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '900', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:50:37','0','0','',''); -- id=1415
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1190', '94', '1379', '3', '300', '900', '0', '', '0', '2026-10-21 17:50:37', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-3,','1','1','0','0','300','900','0','','0','0.00','0','0','0','0'); -- id=4833
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 = 4833;
 INSERT INTO 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '281', userid = '2', storedetaildate = '2026-10-21 17:50:37' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '3', '1', '1190', 'اضافة فاتورة مبيعات', 'sellbillController.php', '284', '281', '2', '2026-10-21 17:50:37','0','0'); -- id=16145
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7390318.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 ('7389418.5','900', '0', '2', 'اضافة فاتورة مبيعات', '1190', '7390318.5', '2026-10-21 17:50:37', '2',  'sellbillController.php','1','','0'); -- id=1471
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900', '900', '2026-10-21', '2', '0', '0', '2026-10-21 17:50:37','اضافة فاتورة مبيعات رقم 1190','1','0',null,'0','1190','sellbillController.php?do=showDetail&sellbillid=1190'); -- id=4205
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4205', '419', '900', '','0'); -- id=4316
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7390318', 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 ('4205', '143', '900', '','0'); -- id=4207
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13424540', 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 ( '810', '810', '2026-10-21', '2', '0', '0', '2026-10-21 17:50:37','اضافة فاتورة مبيعات رقم 1190 - صرف البضاعة من المخزن','1','0',null,'0','1190','sellbillController.php?do=showDetail&sellbillid=1190'); -- id=4206
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4206', '402', '810', '','0'); -- id=4317
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12419286.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 ('4206', '382', '810', '','0'); -- id=4208
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25156894.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='4205,0,4206' where sellbillid=1190;
 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, 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-21', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, 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, 900, 810, 810
                    , 810, 810, 810, 810, 810, 810)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+900, netSellCostBuyPrice = netSellCostBuyPrice+810
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+810
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+810
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+810
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+810
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+810
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+810
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+810;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8d0f96a3e5 and sellbillId = 1190 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:20:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:50:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:50:38', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16771
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:21:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:51:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:51:05', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16772
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 296;
UPDATE buybill SET  buybillsysdate = '2026-10-21 17:51:05', userid = '7',delbyuserid = '1', conditions = '1' WHERE buybillid = '296';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2352, 0, 0
                    , 400, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6969
UPDATE buybilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400.00, meanbuyprice_withTax = 400.00, lastbuyprice_withDiscountAndTax = 400.00
                where buybilldetailid = 1658;
UPDATE product SET productName = 'شروال ابيض فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02352',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 = '3.75' , 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='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 = '2352';
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2352;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3746';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2352', '1', '80', '1', '296', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '80', '0', '1', '2026-10-21 17:35:35','0','0'); -- id=16146
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 909, 0, 0
                    , 335, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6970
UPDATE buybilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 335.00, meanbuyprice_withDiscount = 335.00
        , lastbuyprice_withTax = 335.00, meanbuyprice_withTax = 335.00, lastbuyprice_withDiscountAndTax = 335.00
                where buybilldetailid = 1659;
UPDATE product SET productName = 'توشكا وا فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '335.00', productSellAllPrice = '355.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07945',type ='0', expireDate = '0' , dailyentryId = '264',isService = '0',isOptic = '0',lastbuyprice = '335',lastbuyprice_withDiscount = '0',meanbuyprice = '335',meanbuyprice_withDiscount = '335' , productbuypricereal = '335.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='335',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7945',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='335',meanbuyprice_withTax='335',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='0',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 = '909';
UPDATE productunit SET proUnitBuyPrice  = 335 * productnumber WHERE productid = 909;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '909';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('909', '1', '80', '1', '296', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '90', '10', '1', '2026-10-21 17:35:35','0','0'); -- id=16147
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2353, 0, 0
                    , 350, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6971
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 350.00
                where buybilldetailid = 1660;
UPDATE product SET productName = 'مو فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '350.00', productSellAllPrice = '365.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02353',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '0',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.29' , 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='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 = '2353';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2353;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2353', '1', '80', '1', '296', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '80', '0', '1', '2026-10-21 17:35:35','0','0'); -- id=16148
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2354, 0, 0
                    , 415, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6972
UPDATE buybilldetail SET  lastbuyprice = 415.00 , meanbuyprice = 415.00, lastbuyprice_withDiscount = 415.00, meanbuyprice_withDiscount = 415.00
        , lastbuyprice_withTax = 415.00, meanbuyprice_withTax = 415.00, lastbuyprice_withDiscountAndTax = 415.00
                where buybilldetailid = 1661;
UPDATE product SET productName = 'بلن فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '415.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '0',meanbuyprice = '415.00',meanbuyprice_withDiscount = '415' , productbuypricereal = '415.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.61' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',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 = '2354';
UPDATE productunit SET proUnitBuyPrice  = 415 * productnumber WHERE productid = 2354;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2354', '1', '80', '1', '296', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '80', '0', '1', '2026-10-21 17:35:35','0','0'); -- id=16149
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2355, 0, 0
                    , 320, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-80, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6973
UPDATE buybilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320.00, meanbuyprice_withTax = 320.00, lastbuyprice_withDiscountAndTax = 320.00
                where buybilldetailid = 1662;
UPDATE product SET productName = 'واي لك فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '320.00', productSellAllPrice = '335.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02355',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '0',meanbuyprice = '320.00',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.69' , 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='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 = '2355';
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2355;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3749';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2355', '1', '80', '1', '296', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '80', '0', '1', '2026-10-21 17:35:35','0','0'); -- id=16150
UPDATE supplier SET  suppliercurrentDebt = '233945',suppliercurrentDebtInCurrency= '546030' , userid = '1', supplierdate = '2026-10-21 17:51:05'   WHERE supplierid = '21';
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 ('21', '379545.00', '145600.00', '1', 'حذف فاتورة مشتريات - للتعديل', '296', '233945', '2026-10-21 17:35:35', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','145600','1','691630','145600','546030','0',''); -- id=816
UPDATE productserial SET del = 1
		 WHERE billid = 296;
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 ('06ad8cdb761d85', '2026-10-21 17:35:35', '21', '546030.00', '693230', '0', '0', '147200.00', '147200.00', '0.00', '147200', '1', '2026-10-21 17:51:05', '', '1', '0', '', '1', '1','1','296','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=297
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 ('02352', '297', '27', '2352', '80.00', '400', '32000.00', '0.00', '', '2026-10-21 17:51:05', '2352','','','0','0','0','0','0',null,'400','32000','0','0','0','0','0','0','0','0','1'); -- id=1663
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2352, 0, 0
                    , 400, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6969
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2352 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1663 ;
UPDATE product SET productName = 'شروال ابيض فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '400.00', productSellAllPrice = '415.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02352',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 = '3.75' , 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='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='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 = '2352';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 1663;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2352;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3746';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2352', '1', '80', '0', '297', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-10-21 17:35:35','0','0'); -- id=16151
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 ('02356', '297', '27', '2356', '80.00', '355', '28400.00', '0.00', '', '2026-10-21 17:51:05', '2356','','','0','0','0','0','0',null,'355','28400','0','0','0','0','0','0','0','0','1'); -- id=1664
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2356, 0, 0
                    , 355, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyprice = 355,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6980
UPDATE product SET  productBuyPrice = "355" WHERE productId = 2356 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1664 ;
UPDATE product SET productName = 'سوستا فورجت', productDescription = '', productCatId = '27', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02356',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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='355',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2356';
UPDATE buybilldetail SET  lastbuyprice = 355 , meanbuyprice = 355, lastbuyprice_withDiscount = 355, meanbuyprice_withDiscount = 355
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 355
                where buybilldetailid = 1664;
UPDATE productunit SET proUnitBuyPrice  = 355 * productnumber WHERE productid = 2356;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2356', '1', '80', '0', '297', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-10-21 17:35:35','0','0'); -- id=16152
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 ('02353', '297', '27', '2353', '80.00', '350', '28000.00', '0.00', '', '2026-10-21 17:51:05', '2353','','','0','0','0','0','0',null,'350','28000','0','0','0','0','0','0','0','0','1'); -- id=1665
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2353, 0, 0
                    , 350, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6971
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2353 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1665 ;
UPDATE product SET productName = 'مو فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '350.00', productSellAllPrice = '365.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02353',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 = '4.29' , 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='175',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 = '2353';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 1665;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2353;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2353', '1', '80', '0', '297', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-10-21 17:35:35','0','0'); -- id=16153
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 ('02354', '297', '27', '2354', '80.00', '415', '33200.00', '0.00', '', '2026-10-21 17:51:05', '2354','','','0','0','0','0','0',null,'415','33200','0','0','0','0','0','0','0','0','1'); -- id=1666
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2354, 0, 0
                    , 415, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyprice = 415,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6972
UPDATE product SET  productBuyPrice = "415" WHERE productId = 2354 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1666 ;
UPDATE product SET productName = 'بلن فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '415.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.61' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='207.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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2354';
UPDATE buybilldetail SET  lastbuyprice = 415 , meanbuyprice = 415, lastbuyprice_withDiscount = 415, meanbuyprice_withDiscount = 415
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 207.5, lastbuyprice_withDiscountAndTax = 415
                where buybilldetailid = 1666;
UPDATE productunit SET proUnitBuyPrice  = 415 * productnumber WHERE productid = 2354;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2354', '1', '80', '0', '297', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-10-21 17:35:35','0','0'); -- id=16154
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 ('02355', '297', '27', '2355', '80.00', '320', '25600.00', '0.00', '', '2026-10-21 17:51:05', '2355','','','0','0','0','0','0',null,'320','25600','0','0','0','0','0','0','0','0','1'); -- id=1667
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:35:35', 1, 2355, 0, 0
                    , 320, 80, 0, 0, 1, '2026-10-21 17:51:05')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 17:51:05' ; -- id=6973
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2355 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1667 ;
UPDATE product SET productName = 'واي لك فورجيت', productDescription = '', productCatId = '27', productBuyPrice = '320.00', productSellAllPrice = '335.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02355',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 = '4.69' , 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='160',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 = '2355';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 1667;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2355;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3749';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2355', '1', '80', '0', '297', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-10-21 17:35:35','0','0'); -- id=16155
DELETE FROM productserial WHERE billid = 296
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '381145',suppliercurrentDebtInCurrency= '693230' , userid = '1', supplierdate = '2026-10-21 17:51:05'   WHERE supplierid = '21';
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 ('21', '233945.00', '147200', '0', 'اضافة فاتورة مشتريات', '297', '381145', '2026-10-21 17:51:05', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','145600','1','546030','147200','693230','0',''); -- id=817
UPDATE dailyentry SET totalcreditor = '145600.00', totaldebtor = '145600.00', thedate = '2026-10-21', userid = '7', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 17:37:26', entryComment = 'اضافة فاتورة مشتريات رقم 296', fromFlag = '1',related='0',isopeningentry='0',operationId='296',operationDetailLink='buyBillController.php?do=details&id=296' WHERE id = '4200';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '145600.00', '145600.00', '2026-10-21', '1', '0', '4200', '2026-10-21 17:51:05','تم عكس القيد رقم 4200 ','1','0','0','0','0',''); -- id=4207
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4207', '382', '145600.00', '','0'); -- id=4209
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25011294.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4207', '440', '145600.00', '','0'); -- id=4318
UPDATE accountstree SET name = 'فورجيت - مورد', customName = 'فورجيت - مورد', customNameEn = 'فورجيت - مورد', nameEn = 'فورجيت - مورد', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '440';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '147200', '147200', '2026-10-21', '1', '0', '0', '2026-10-21 17:51:05','اضافة فاتورة مشتريات رقم 297','1','0',null,'0','297','buyBillController.php?do=details&id=297'); -- id=4208
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4208', '382', '147200', '','0'); -- id=4319
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25158494.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 ('4208', '440', '147200', '','0'); -- id=4210
UPDATE accountstree SET name = 'فورجيت - مورد', customName = 'فورجيت - مورد', customNameEn = 'فورجيت - مورد', nameEn = 'فورجيت - مورد', parent = '81', accountNature = '1', theValue = '147200', 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 = '440';
update buybill set dailyentryid='4208,0' where buybillid=297;
UPDATE product SET overAllAveragePrice = 400 WHERE productId = 2352;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 2353;UPDATE product SET overAllAveragePrice = 415 WHERE productId = 2354;UPDATE product SET overAllAveragePrice = 320 WHERE productId = 2355;UPDATE product SET overAllAveragePrice = 355 WHERE productId = 2356;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:21:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:51:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:51:05', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=297'); -- id=16773
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:21:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:51:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:51:17', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16774
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:21:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:51:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:51:24', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16775
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:21:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:51:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:51:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16776
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:22:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:52:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:52:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16777
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:22:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:52:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:52:38', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16778
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:22:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:52:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 17:52:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16779
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:22:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:52:56", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:52:56', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16780
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:23:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:53:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:53:02', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16781
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-21 14:23:02";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:53:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:53:02', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16782
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:23:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:53:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:53:07', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16783
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:54:09', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16784
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:54:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16785
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 17:54:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16786
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 17:54:54', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=16787
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2988';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1971', '1', '5', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '0', '5', '1', '2026-10-21','0','0'); -- id=16156
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3000', '3000', '2026-10-21', '1', '0', '0', '2026-10-21 17:54:54','اعادة جرد للمنتج : (فولكانو جينز 1560/فولكانو جينز) فى مخزن : (المخزن الرئيسي) بالكمية : 5','1','0',null,'0','16156','inventoryController.php?do=details&id=16156'); -- id=4209
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4209', '382', '3000', '','0'); -- id=4320
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25161494.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 ('4209', '188', '3000', '','0'); -- id=4211
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3235940', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:54:59', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16788
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 ('06ad8d11a3a8d3', '2026-10-21 17:50:02', '106', '-1043310.00', '-992400', '0', '0', '50910.00',  '50910.00', '0', '50910', '1', '2026-10-21 17:54:59', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=298
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 ('02351', '298', '103', '2351', '30', '725', '21750.00', '0', '', '2026-10-21 17:54:59', '2351','','','0','0','0','0','0',null,'725','21750','0','0','0','0','0','0','0','0','1'); -- id=1668
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:50:02', 1, 2351, 0, 0
                    , 725, 30, 0, 0, 7, '2026-10-21 17:54:59')
                ON DUPLICATE KEY UPDATE buyprice = 725,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:54:59' ; -- id=6984
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2351', '725', '30', '0', 'buyBillController.php', '1668', '', '0', '0'); -- id=1222
UPDATE product SET  productBuyPrice = "725" WHERE productId = 2351 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1668 ;
UPDATE product SET productName = 'ترينج بوكس فيت تمبو', productDescription = '', productCatId = '103', productBuyPrice = '725.00', productSellAllPrice = '750.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '725',lastbuyprice_withDiscount = '725',meanbuyprice = '725',meanbuyprice_withDiscount = '725' , productbuypricereal = '725.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='725',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='725',meanbuyprice_withTax='725',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='725',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2351';
UPDATE buybilldetail SET  lastbuyprice = 725 , meanbuyprice = 725, lastbuyprice_withDiscount = 725, meanbuyprice_withDiscount = 725
        , lastbuyprice_withTax = 725, meanbuyprice_withTax = 725, lastbuyprice_withDiscountAndTax = 725
                where buybilldetailid = 1668;
UPDATE productunit SET proUnitBuyPrice  = 725 * productnumber WHERE productid = 2351;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3745';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2351', '1', '30', '0', '298', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 17:50:02','0','0'); -- id=16157
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', '298', '103', '1462', '36', '410', '14760.00', '0', '', '2026-10-21 17:54:59', '1462','','','0','0','0','0','0',null,'410','14760','0','0','0','0','0','0','0','0','1'); -- id=1669
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:50:02', 1, 1462, 0, 0
                    , 410, 36, 0, 0, 7, '2026-10-21 17:54:59')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:54:59' ; -- id=6985
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1462', '410', '36', '0', 'buyBillController.php', '1669', '', '0', '0'); -- id=1223
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1462 ;
UPDATE buybilldetail SET  quantitybefore = 165 WHERE buybilldetailid = 1669 ;
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 = 1669;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1462;
UPDATE storedetail SET  productquantity = '201', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '36', '0', '298', 'اضافة فاتورة مشتريات', 'buyBillController.php', '165', '201', '7', '2026-10-21 17:50:02','0','0'); -- id=16158
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 ('02350', '298', '108', '2350', '30', '480', '14400.00', '0', '', '2026-10-21 17:54:59', '2350','','','0','0','0','0','0',null,'480','14400','0','0','0','0','0','0','0','0','1'); -- id=1670
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:50:02', 1, 2350, 0, 0
                    , 480, 30, 0, 0, 7, '2026-10-21 17:54:59')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 17:54:59' ; -- id=6986
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2350', '480', '30', '0', 'buyBillController.php', '1670', '', '0', '0'); -- id=1224
UPDATE product SET  productBuyPrice = "480" WHERE productId = 2350 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1670 ;
UPDATE product SET productName = 'جاكيت فرو كابيشو تمبو', productDescription = '', productCatId = '108', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.17' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',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='480',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='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 = '2350';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 1670;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 2350;
UPDATE storedetail SET  productquantity = '30', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3744';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2350', '1', '30', '0', '298', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '7', '2026-10-21 17:50:02','0','0'); -- id=16159
UPDATE supplier SET  suppliercurrentDebt = '-992400',suppliercurrentDebtInCurrency= '-992400' , userid = '7', supplierdate = '2026-10-21 17:54:59'   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', '-1043310.00', '50910', '0', 'اضافة فاتورة مشتريات', '298', '-992400', '2026-10-21 17:50:02', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','50910','1','-1043310','50910','-992400','0',''); -- id=818
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50910', '50910', '2026-10-21', '7', '0', '0', '2026-10-21 17:54:59','اضافة فاتورة مشتريات رقم 298','1','0',null,'0','298','buyBillController.php?do=details&id=298'); -- id=4210
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4210', '382', '50910', '','0'); -- id=4321
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25212404.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 ('4210', '589', '50910', '','0'); -- id=4212
UPDATE accountstree SET name = 'تمبو', customName = 'تمبو', customNameEn = 'تمبو', nameEn = 'تمبو', parent = '81', accountNature = '1', theValue = '-992400', 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='4210,0' where buybillid=298;
COMMIT;
UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1462;UPDATE product SET overAllAveragePrice = 480 WHERE productId = 2350;UPDATE product SET overAllAveragePrice = 725 WHERE productId = 2351;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:54:59', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=298'); -- id=16789
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:24:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:54:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 17:54:59', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16790
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:03", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:55:03', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=298&type=2'); -- id=16791
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:55:09', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16792
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 17:55:22', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16793
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-21 14:25:22";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 17:55:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 17:55:22', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16794
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:55:23', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16795
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:55:27', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16796

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8d13e20fb8
-- ----------------------------------------------------------------------------------------------------

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-21 17:55:28', '06ad8d13e20fb8', '1', '0.00', '0', '0', '1', '18750.00', '18750', '18750', '0', '1', '2026-10-21 17:55:28', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '30' ,'0','','','','','-1','0','0','0','0','0','18750','0','','0','0','18750','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1191
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','اضافة فاتورة مبيعات','1191', '0', '2026-10-21 17:55:28', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '18750', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:55:28','0','0','',''); -- id=1416
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 372;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('532','01554', '1191', '8', '1554', '5', '560', '2800', '0', '', '0', '2026-10-21 17:55:28', '1554', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','372-5,','1','1','0','0','560','2800','0','','0','0.00','0','0','0','0'); -- id=4834
UPDATE sellbilldetail SET  lastbuyprice = 532.00 , meanbuyprice = 532.00, lastbuyprice_withDiscount = 532.00, meanbuyprice_withDiscount = 532.00
        , lastbuyprice_withTax = 532, meanbuyprice_withTax = 532, lastbuyprice_withDiscountAndTax = 532
                where sellbilldetailid = 4834;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1554, '2026-10-21', 2800, 2660, 2660
                    , 2660, 2660, 2660, 2660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2660, 2660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2800, 2660, 2660
                    , 2660, 2660, 2660, 2660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2660, 2660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 17:55:28' WHERE storedetailid = '1579';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1554', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 17:55:28','0','0'); -- id=16160
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','09441', '1191', '28', '938', '5', '580', '2900', '0', '', '0', '2026-10-21 17:55:28', '938', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','580','2900','0','','0','0.00','0','0','0','0'); -- id=4835
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where sellbilldetailid = 4835;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (938, '2026-10-21', 2900, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 2900, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 17:55:28' WHERE storedetailid = '938';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('938', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 17:55:28','0','0'); -- id=16161
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 1124;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('617','01936', '1191', '8', '1936', '5', '645', '3225', '0', '', '0', '2026-10-21 17:55:28', '1936', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1124-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=4836
UPDATE sellbilldetail SET  lastbuyprice = 617.00 , meanbuyprice = 617.00, lastbuyprice_withDiscount = 617.00, meanbuyprice_withDiscount = 617.00
        , lastbuyprice_withTax = 617, meanbuyprice_withTax = 617, lastbuyprice_withDiscountAndTax = 617
                where sellbilldetailid = 4836;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1936, '2026-10-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3225, 3085, 3085
                    , 3085, 3085, 3085, 3085
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3085, 3085, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3085
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3085, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3085
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3085, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3085
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3085
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3085
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3085
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 17:55:28' WHERE storedetailid = '2953';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1936', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 17:55:28','0','0'); -- id=16162
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6896;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','02326', '1191', '28', '2326', '5', '620', '3100', '0', '', '0', '2026-10-21 17:55:28', '2326', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6896-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=4837
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 4837;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2326, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2026-10-21 17:55:28' WHERE storedetailid = '3720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 17:55:28','0','0'); -- id=16163
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 1126;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('697','01938', '1191', '8', '1938', '5', '725', '3625', '0', '', '0', '2026-10-21 17:55:28', '1938', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1126-5,','1','1','0','0','725','3625','0','','0','0.00','0','0','0','0'); -- id=4838
UPDATE sellbilldetail SET  lastbuyprice = 697.00 , meanbuyprice = 697.00, lastbuyprice_withDiscount = 697.00, meanbuyprice_withDiscount = 697.00
        , lastbuyprice_withTax = 697, meanbuyprice_withTax = 697, lastbuyprice_withDiscountAndTax = 697
                where sellbilldetailid = 4838;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1938, '2026-10-21', 3625, 3485, 3485
                    , 3485, 3485, 3485, 3485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3485, 3485, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3625, sellCostBuyPrice =sellCostBuyPrice+3485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3485
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3625, 3485, 3485
                    , 3485, 3485, 3485, 3485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3485, 3485, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3625, sellCostBuyPrice =sellCostBuyPrice+3485
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3485, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3485
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3485
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3485
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 17:55:28' WHERE storedetailid = '2955';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1938', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '25', '2', '2026-10-21 17:55:28','0','0'); -- id=16164
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','01971', '1191', '28', '1971', '5', '620', '3100', '0', '', '0', '2026-10-21 17:55:28', '1971', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=4839
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 4839;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1971, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 17:55:28' WHERE storedetailid = '2988';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1971', '1', '5', '1', '1191', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 17:55:28','0','0'); -- id=16165
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7409068.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 ('7390318.5','18750', '0', '2', 'اضافة فاتورة مبيعات', '1191', '7409068.5', '2026-10-21 17:55:28', '2',  'sellbillController.php','1','','0'); -- id=1472
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '18750', '18750', '2026-10-21', '2', '0', '0', '2026-10-21 17:55:28','اضافة فاتورة مبيعات رقم 1191','1','0',null,'0','1191','sellbillController.php?do=showDetail&sellbillid=1191'); -- id=4211
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4211', '419', '18750', '','0'); -- id=4322
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7409068', 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 ('4211', '143', '18750', '','0'); -- id=4213
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13443290', 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 ( '18030', '18030', '2026-10-21', '2', '0', '0', '2026-10-21 17:55:28','اضافة فاتورة مبيعات رقم 1191 - صرف البضاعة من المخزن','1','0',null,'0','1191','sellbillController.php?do=showDetail&sellbillid=1191'); -- id=4212
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4212', '402', '18030', '','0'); -- id=4323
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12437316.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 ('4212', '382', '18030', '','0'); -- id=4214
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25194374.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='4211,0,4212' where sellbillid=1191;
 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-21', 18750, 18030, 18030
                    , 18030, 18030, 18030, 18030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18030, 18030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18750, sellCostBuyPrice =sellCostBuyPrice+18030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18030
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18030
                        , returnSellVal = returnSellVal+0, 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-21', 18750, 18030, 18030
                    , 18030, 18030, 18030, 18030
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18030, 18030, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18750, sellCostBuyPrice =sellCostBuyPrice+18030
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18030, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18030
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18030, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18030
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18030
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18030
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18030
                        , returnSellVal = returnSellVal+0, 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, 18750, 18030, 18030
                    , 18030, 18030, 18030, 18030, 18030, 18030)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+18750, netSellCostBuyPrice = netSellCostBuyPrice+18030
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18030
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18030
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+18030
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+18030
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+18030
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18030
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18030;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8d13e20fb8 and sellbillId = 1191 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:55:28', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16797
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:43", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:55:43', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16798

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8c9b46a852
-- ----------------------------------------------------------------------------------------------------

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-21 17:55:43', '06ad8c9b46a852', '1', '0.00', '0', '0', '1', '2700.00', '2700', '2700', '0', '2', '2026-10-21 17:55:43', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','2700','0','','0','0','2700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1192
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','اضافة فاتورة مبيعات','1192', '0', '2026-10-21 17:55:43', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2700', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 17:55:43','0','0','',''); -- id=1417
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 888;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('810','01835', '1192', '48', '1835', '3', '900', '2700', '0', '', '0', '2026-10-21 17:55:43', '1835', '0.00', '0', '2','0.00','','','0','0','0','0','0','0','0','0','','888-3,','1','1','0','0','900','2700','0','','0','0.00','0','0','0','0'); -- id=4840
UPDATE sellbilldetail SET  lastbuyprice = 900.00 , meanbuyprice = 900.00, lastbuyprice_withDiscount = 810.00, meanbuyprice_withDiscount = 855.00
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 810
                where sellbilldetailid = 4840;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1835, '2026-10-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2700, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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+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-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 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+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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 = '18', userid = '4', storedetaildate = '2026-10-21 17:55:43' WHERE storedetailid = '2858';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '2', '3', '1', '1192', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '18', '4', '2026-10-21 17:55:43','0','0'); -- id=16166
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1168182.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 ('1165482.875','2700', '0', '3', 'اضافة فاتورة مبيعات', '1192', '1168182.875', '2026-10-21 17:55:43', '4',  'sellbillController.php','1','','0'); -- id=1473
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2700', '2700', '2026-10-21', '4', '0', '0', '2026-10-21 17:55:43','اضافة فاتورة مبيعات رقم 1192','1','0',null,'0','1192','sellbillController.php?do=showDetail&sellbillid=1192'); -- id=4213
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4213', '501', '2700', '','0'); -- id=4324
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1168182.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 ('4213', '143', '2700', '','0'); -- id=4215
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13445990', 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 ( '2430', '2430', '2026-10-21', '4', '0', '0', '2026-10-21 17:55:43','اضافة فاتورة مبيعات رقم 1192 - صرف البضاعة من المخزن','1','0',null,'0','1192','sellbillController.php?do=showDetail&sellbillid=1192'); -- id=4214
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4214', '402', '2430', '','0'); -- id=4325
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12439746.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 ('4214', '492', '2430', '','0'); -- id=4216
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1557227', 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='4213,0,4214' where sellbillid=1192;
 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-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 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+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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;
 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-21', 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430
                    , 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+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2565
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2700, 2700, 2700
                    , 2700, 2430, 2565, 2430, 2700, 1350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2700, netSellCostBuyPrice = netSellCostBuyPrice+2700
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2700
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2700
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2565
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2700
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8c9b46a852 and sellbillId = 1192 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:25:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:55:43", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 17:55:43', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16799
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:26:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:56:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:56:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16800
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:26:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:56:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:56:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16801
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7135', '7135', '2026-10-21', '1', '0', '0', '2026-10-21 17:57:10','تعديل منتج (هندي ساده) السعر من (145.00) الى (150.00) و الكميه (1427)','1','0',null,'0','853','productController.php?do=edit&id=853'); -- id=4215
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4215', '382', '7135', '','0'); -- id=4326
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25201509.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 ('4215', '53', '7135', '','0'); -- id=4217
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-225765', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '79825', '79825', '2026-10-21', '1', '0', '0', '2026-10-21 17:57:10','تعديل منتج (هندي ساده) السعر من (145.00) الى (150.00) و الكميه (15965)','1','0',null,'0','853','productController.php?do=edit&id=853'); -- id=4216
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4216', '562', '79825', '','0'); -- id=4327
UPDATE accountstree SET name = 'مخزن خارجي', customName = 'مخزن خارجي', customNameEn = 'مخزن خارجي', nameEn = 'مخزن خارجي', parent = '49', accountNature = '0', theValue = '3461240', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-05 16:44:25' WHERE id = '562';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4216', '53', '79825', '','0'); -- id=4218
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-145940', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 150.00 * productnumber WHERE productid = 853;
UPDATE product SET productName = 'هندي ساده', productDescription = '', productCatId = '21', productBuyPrice = '150.00', productSellAllPrice = '165.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '208',isService = '0',isOptic = '0',lastbuyprice = '145.00',lastbuyprice_withDiscount = '145',meanbuyprice = '147.5',meanbuyprice_withDiscount = '147.5' , productbuypricereal = '145.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='145',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='2',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='147.5',meanbuyprice_withTax='147.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='145',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 = '853';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (853, 1,'2026-10-21 17:57:10',1)
                ON DUPLICATE KEY UPDATE productid = 853, edited = 1, sysdate = '2026-10-21 17:57:10', userid = 1; -- id=1498
UPDATE product SET productName = 'نيولاند جامبو حنفى 275', productDescription = '', productCatId = '21', productBuyPrice = '255.00', productSellAllPrice = '275.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08413',type ='0', expireDate = '0' , dailyentryId = '207',isService = '0',isOptic = '0',lastbuyprice = '255.00',lastbuyprice_withDiscount = '255',meanbuyprice = '255.00',meanbuyprice_withDiscount = '255' , productbuypricereal = '255.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='255',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8413',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='255',meanbuyprice_withTax='255',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='255',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 = '852';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (852, 1,'2026-10-21 17:57:11',1)
                ON DUPLICATE KEY UPDATE productid = 852, edited = 1, sysdate = '2026-10-21 17:57:11', userid = 1; -- id=1497
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:27:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:57:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:57:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16802
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:28:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:58:14", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:58:14', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16803
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:28:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:58:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:58:35', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16804
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:28:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:58:54", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:58:54', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16805
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:29:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:59:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:59:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16806
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:29:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:59:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 17:59:36', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16807
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:29:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:59:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 17:59:43', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16808
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 ('موديل 418 بيج بوص','','105','485','485','0','0','2026-10-21','0','7','0','','0','0','0','0','0','485','485','485','485','485','0','0','0','0','.','0','0','0','485','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','485','485','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','485','0','0','0','0','0','0','','','0','0','0','0'); -- id=2357
UPDATE product SET productName = 'موديل 418 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '485', productSellAllPrice = '485', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02357',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485',lastbuyprice_withDiscount = '485',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '485' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',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='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2357';
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', '2357', '1.00', '2026-10-21', '7', '0','0235701','485','0','0','485','','0','0','0','0','0','0','0','0','0','0'); -- id=2357
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2357', '1', '0', '7', '2026-10-21'); -- id=3751
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2357', '1', '0', '0', '2357', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16167
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2357, 1,'2026-10-21 17:59:43',7)
                ON DUPLICATE KEY UPDATE productid = 2357, edited = 1, sysdate = '2026-10-21 17:59:43', userid = 7; -- id=3506
UPDATE product SET productName = 'موديل 418 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '485.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02357',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485',lastbuyprice_withDiscount = '485',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '485' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',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='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2357';
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 ('موديل 419 بيج بوص','','105','290','290','0','0','2026-10-21','0','7','0','','0','0','0','0','0','290','290','290','290','290','0','0','0','0','.','0','0','0','290','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','290','290','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','290','0','0','0','0','0','0','','','0','0','0','0'); -- id=2358
UPDATE product SET productName = 'موديل 419 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '290', productSellAllPrice = '290', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02358',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='290',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='290',meanbuyprice_withTax='290',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='290',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2358';
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', '2358', '1.00', '2026-10-21', '7', '0','0235801','290','0','0','290','','0','0','0','0','0','0','0','0','0','0'); -- id=2358
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2358', '1', '0', '7', '2026-10-21'); -- id=3752
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2358', '1', '0', '0', '2358', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-21','0','0'); -- id=16168
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2358, 1,'2026-10-21 17:59:43',7)
                ON DUPLICATE KEY UPDATE productid = 2358, edited = 1, sysdate = '2026-10-21 17:59:43', userid = 7; -- id=3507
UPDATE product SET productName = 'موديل 419 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '290.00', productSellAllPrice = '290.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02358',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='290',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='290',meanbuyprice_withTax='290',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='290',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2358';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:29:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 17:59:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 17:59:45', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16809
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:30:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:00:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 18:00:31', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=16810
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3682';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2289', '1', '5', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '0', '5', '1', '2026-10-21','0','0'); -- id=16169
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2950', '2950', '2026-10-21', '1', '0', '0', '2026-10-21 18:00:31','اعادة جرد للمنتج : (فولكانو جينز 1506/فولكانو جينز) فى مخزن : (المخزن الرئيسي) بالكمية : 5','1','0',null,'0','16169','inventoryController.php?do=details&id=16169'); -- id=4217
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4217', '382', '2950', '','0'); -- id=4328
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25204459.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 ('4217', '188', '2950', '','0'); -- id=4219
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3238890', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:30:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:00:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 18:00:38', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16811
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:31:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:01:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:01:13', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16812
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-21 14:31:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 18:01:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:01:13', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16813
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:31:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:01:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:01:15', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16814
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 18:02:08', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16815
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 18:02:28', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=16816
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '0', '5', '1', '2026-10-21','0','0'); -- id=16170
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2560', '2560', '2026-10-21', '1', '0', '0', '2026-10-21 18:02:28','اعادة جرد للمنتج : (الدولي جينز 629/الدولي) فى مخزن : (المخزن الرئيسي) بالكمية : 5','1','0',null,'0','16170','inventoryController.php?do=details&id=16170'); -- id=4218
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4218', '382', '2560', '','0'); -- id=4329
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25207019.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 ('4218', '188', '2560', '','0'); -- id=4220
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3241450', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 18:02:29', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=16817
UPDATE productunit SET unitid = '1', productid = '2357', productnumber = '1.00', productunitdate = '2026-10-21', userid = '7', conditions = '0',proUnitParcode='0235701',proUnitSellAllPrice='485',proUnitSellHalfPrice='480',proUnitSellUnitPrice ='480',proUnitBuyPrice='485',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '2357';
UPDATE product SET productName = 'موديل 418 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '480', productSellAllPrice = '480', productSellUnitPrice = '480', productSellHalfPrice = '480', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02357',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485.00',lastbuyprice_withDiscount = '485',meanbuyprice = '485.00',meanbuyprice_withDiscount = '485' , productbuypricereal = '485' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',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='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2357';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:02:43', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16818

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8d26053fe7
-- ----------------------------------------------------------------------------------------------------

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-21 18:02:43', '06ad8d26053fe7', '1', '0.00', '0', '0', '1', '31025.00', '31025', '31025', '0', '1', '2026-10-21 18:02:43', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '50' ,'0','','','','','-1','0','0','0','0','0','31025','0','','0','0','31025','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1193
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','اضافة فاتورة مبيعات','1193', '0', '2026-10-21 18:02:43', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '31025', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 18:02:43','0','0','',''); -- id=1418
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('570','09593', '1193', '28', '941', '5', '590', '2950', '0', '', '0', '2026-10-21 18:02:43', '941', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','590','2950','0','','0','0.00','0','0','0','0'); -- id=4841
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 4841;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (941, '2026-10-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2950, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2950, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:02:43' WHERE storedetailid = '941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('941', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-21 18:02:43','0','0'); -- id=16171
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 1126;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('697','01938', '1193', '8', '1938', '10', '725', '7250', '0', '', '0', '2026-10-21 18:02:43', '1938', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1126-10,','1','1','0','0','725','7250','0','','0','0.00','0','0','0','0'); -- id=4842
UPDATE sellbilldetail SET  lastbuyprice = 697.00 , meanbuyprice = 697.00, lastbuyprice_withDiscount = 697.00, meanbuyprice_withDiscount = 697.00
        , lastbuyprice_withTax = 697, meanbuyprice_withTax = 697, lastbuyprice_withDiscountAndTax = 697
                where sellbilldetailid = 4842;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1938, '2026-10-21', 7250, 6970, 6970
                    , 6970, 6970, 6970, 6970
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 6970, 6970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7250, sellCostBuyPrice =sellCostBuyPrice+6970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 7250, 6970, 6970
                    , 6970, 6970, 6970, 6970
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6970, 6970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7250, sellCostBuyPrice =sellCostBuyPrice+6970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:02:43' WHERE storedetailid = '2955';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1938', '1', '10', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '15', '2', '2026-10-21 18:02:43','0','0'); -- id=16172
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('512','02319', '1193', '8', '2319', '5', '540', '2700', '0', '', '0', '2026-10-21 18:02:43', '2319', '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=4843
UPDATE sellbilldetail SET  lastbuyprice = 512.00 , meanbuyprice = 512.00, lastbuyprice_withDiscount = 512.00, meanbuyprice_withDiscount = 512.00
        , lastbuyprice_withTax = 512, meanbuyprice_withTax = 512, lastbuyprice_withDiscountAndTax = 512
                where sellbilldetailid = 4843;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2319, '2026-10-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2560, 2560
                    , 2560, 2560, 2560, 2560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2560, 2560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:02:43' WHERE storedetailid = '3713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2319', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 18:02:43','0','0'); -- id=16173
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('540','09524', '1193', '8', '732', '5', '560', '2800', '0', '', '0', '2026-10-21 18:02:43', '732', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','560','2800','0','','0','0.00','0','0','0','0'); -- id=4844
UPDATE sellbilldetail SET  lastbuyprice = 540.00 , meanbuyprice = 540.00, lastbuyprice_withDiscount = 540.00, meanbuyprice_withDiscount = 540.00
        , lastbuyprice_withTax = 540, meanbuyprice_withTax = 540, lastbuyprice_withDiscountAndTax = 540
                where sellbilldetailid = 4844;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (732, '2026-10-21', 2800, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, 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+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-21', 2800, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, 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 = '14', userid = '2', storedetaildate = '2026-10-21 18:02:43' WHERE storedetailid = '732';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('732', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '14', '2', '2026-10-21 18:02:43','0','0'); -- id=16174
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('615','08844', '1193', '28', '919', '5', '635', '3175', '0', '', '0', '2026-10-21 18:02:43', '919', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','635','3175','0','','0','0.00','0','0','0','0'); -- id=4845
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 4845;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (919, '2026-10-21', 3175, 3075, 3075
                    , 3075, 3075, 3075, 3075
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3075, 3075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3175, sellCostBuyPrice =sellCostBuyPrice+3075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3075
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3175, 3075, 3075
                    , 3075, 3075, 3075, 3075
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3075, 3075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3175, sellCostBuyPrice =sellCostBuyPrice+3075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3075
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:02:43' WHERE storedetailid = '919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('919', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-21 18:02:43','0','0'); -- id=16175
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6896;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','02326', '1193', '28', '2326', '5', '620', '3100', '0', '', '0', '2026-10-21 18:02:43', '2326', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6896-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=4846
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 4846;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2326, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 18:02:43' WHERE storedetailid = '3720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2326', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 18:02:43','0','0'); -- id=16176
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09161', '1193', '28', '932', '5', '600', '3000', '0', '', '0', '2026-10-21 18:02:43', '932', '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=4847
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 = 4847;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (932, '2026-10-21', 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-21', 3000, 2900, 2900
                    , 2900, 2900, 2900, 2900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2900, 2900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 18:02:43' WHERE storedetailid = '932';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('932', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 18:02:43','0','0'); -- id=16177
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 1158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01966', '1193', '28', '1966', '5', '600', '3000', '0', '', '0', '2026-10-21 18:02:43', '1966', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1158-5,','1','1','0','0','600','3000','0','','0','0.00','0','0','0','0'); -- id=4848
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 = 4848;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1966, '2026-10-21', 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-21', 3000, 2900, 2900
                    , 2900, 2900, 2900, 2900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2900, 2900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-21 18:02:43' WHERE storedetailid = '2983';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1966', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 18:02:43','0','0'); -- id=16178
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02289', '1193', '28', '2289', '5', '610', '3050', '0', '', '0', '2026-10-21 18:02:43', '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=4849
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 = 4849;
 INSERT INTO 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-21', 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-21', 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-21 18:02:43' WHERE storedetailid = '3682';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2289', '1', '5', '1', '1193', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-21 18:02:43','0','0'); -- id=16179
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7440093.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 ('7409068.5','31025', '0', '2', 'اضافة فاتورة مبيعات', '1193', '7440093.5', '2026-10-21 18:02:43', '2',  'sellbillController.php','1','','0'); -- id=1474
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '31025', '31025', '2026-10-21', '2', '0', '0', '2026-10-21 18:02:43','اضافة فاتورة مبيعات رقم 1193','1','0',null,'0','1193','sellbillController.php?do=showDetail&sellbillid=1193'); -- id=4219
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4219', '419', '31025', '','0'); -- id=4330
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7440093', 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 ('4219', '143', '31025', '','0'); -- id=4221
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13477015', 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 ( '29905', '29905', '2026-10-21', '2', '0', '0', '2026-10-21 18:02:43','اضافة فاتورة مبيعات رقم 1193 - صرف البضاعة من المخزن','1','0',null,'0','1193','sellbillController.php?do=showDetail&sellbillid=1193'); -- id=4220
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4220', '402', '29905', '','0'); -- id=4331
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12469651.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 ('4220', '382', '29905', '','0'); -- id=4222
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25177114.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='4219,0,4220' where sellbillid=1193;
 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-21', 31025, 29905, 29905
                    , 29905, 29905, 29905, 29905
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,29905, 29905, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+31025, sellCostBuyPrice =sellCostBuyPrice+29905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+29905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29905
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+29905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29905
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+29905
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+29905
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29905
                        , returnSellVal = returnSellVal+0, 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-21', 31025, 29905, 29905
                    , 29905, 29905, 29905, 29905
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,29905, 29905, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+31025, sellCostBuyPrice =sellCostBuyPrice+29905
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+29905, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29905
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+29905, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29905
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+29905
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+29905
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29905
                        , returnSellVal = returnSellVal+0, 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, 31025, 29905, 29905
                    , 29905, 29905, 29905, 29905, 29905, 29905)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+31025, netSellCostBuyPrice = netSellCostBuyPrice+29905
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+29905
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+29905
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+29905
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+29905
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+29905
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+29905
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+29905;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8d26053fe7 and sellbillId = 1193 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:02:44', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16819
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:54", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:02:54', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16820
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 ('06ad8d36167223', '2026-10-21 17:59:45', '90', '159198.00', '171672', '10', '1', '13860.00',  '12474.00', '0', '12474', '1', '2026-10-21 18:02:54', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=299
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 ('02357', '299', '105', '2357', '18', '480', '8640.00', '0', '', '2026-10-21 18:02:54', '2357','','','0','0','0','0','0',null,'480','8640','0','0','0','0','0','0','0','0','1'); -- id=1671
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:59:45', 1, 2357, 0, 0
                    , 432, 18, 0, 0, 7, '2026-10-21 18:02:54')
                ON DUPLICATE KEY UPDATE buyprice = 432,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 18:02:54' ; -- id=6987
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2357', '480', '18', '0', 'buyBillController.php', '1671', '', '0', '0'); -- id=1225
UPDATE product SET  productBuyPrice = "480" WHERE productId = 2357 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1671 ;
UPDATE product SET productName = 'موديل 418 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '480.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02357',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '432',meanbuyprice = '480',meanbuyprice_withDiscount = '432' , productbuypricereal = '485.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='485',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='480',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='432',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2357';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 432, meanbuyprice_withDiscount = 432
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 432
                where buybilldetailid = 1671;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 2357;
UPDATE storedetail SET  productquantity = '18', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3751';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2357', '1', '18', '0', '299', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '18', '7', '2026-10-21 17:59:45','0','0'); -- id=16180
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 ('02358', '299', '105', '2358', '18', '290', '5220.00', '0', '', '2026-10-21 18:02:54', '2358','','','0','0','0','0','0',null,'290','5220','0','0','0','0','0','0','0','0','1'); -- id=1672
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 17:59:45', 1, 2358, 0, 0
                    , 261, 18, 0, 0, 7, '2026-10-21 18:02:54')
                ON DUPLICATE KEY UPDATE buyprice = 261,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-21 18:02:54' ; -- id=6988
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2358', '290', '18', '0', 'buyBillController.php', '1672', '', '0', '0'); -- id=1226
UPDATE product SET  productBuyPrice = "290" WHERE productId = 2358 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1672 ;
UPDATE product SET productName = 'موديل 419 بيج بوص', productDescription = '', productCatId = '105', productBuyPrice = '290.00', productSellAllPrice = '290.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '7', limitamount = '0', parcode = '02358',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '261',meanbuyprice = '290',meanbuyprice_withDiscount = '261' , productbuypricereal = '290.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='290',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='290',meanbuyprice_withTax='290',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='261',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2358';
UPDATE buybilldetail SET  lastbuyprice = 290 , meanbuyprice = 290, lastbuyprice_withDiscount = 261, meanbuyprice_withDiscount = 261
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 261
                where buybilldetailid = 1672;
UPDATE productunit SET proUnitBuyPrice  = 290 * productnumber WHERE productid = 2358;
UPDATE storedetail SET  productquantity = '18', userid = '7', storedetaildate = '2026-10-21' WHERE storedetailid = '3752';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2358', '1', '18', '0', '299', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '18', '7', '2026-10-21 17:59:45','0','0'); -- id=16181
UPDATE supplier SET  suppliercurrentDebt = '171672',suppliercurrentDebtInCurrency= '171672' , userid = '7', supplierdate = '2026-10-21 18:02:54'   WHERE supplierid = '90';
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 ('90', '159198.00', '12474', '0', 'اضافة فاتورة مشتريات', '299', '171672', '2026-10-21 17:59:45', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','12474','1','159198','12474','171672','0',''); -- id=819
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12474', '12474', '2026-10-21', '7', '0', '0', '2026-10-21 18:02:54','اضافة فاتورة مشتريات رقم 299','1','0',null,'0','299','buyBillController.php?do=details&id=299'); -- id=4221
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4221', '382', '12474', '','0'); -- id=4332
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25189588.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 ('4221', '571', '12474', '','0'); -- id=4223
UPDATE accountstree SET name = 'بيج بوص', customName = 'بيج بوص', customNameEn = 'بيج بوص', nameEn = 'بيج بوص', parent = '81', accountNature = '1', theValue = '171672', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 18:42:10' WHERE id = '571';
update buybill set dailyentryid='4221,0' where buybillid=299;
COMMIT;
UPDATE product SET overAllAveragePrice = 432 WHERE productId = 2357;UPDATE product SET overAllAveragePrice = 261 WHERE productId = 2358;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:54", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:02:54', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=299'); -- id=16821
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:32:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:02:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:02:59', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=299&type=2'); -- id=16822
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:33:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:03:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:03:16', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16823
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:35:49";
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-21 14:36:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:06:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16824
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-21 14:36:03";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:06:03', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16825
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:36:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 18:06:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=16826
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:36:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 18:06:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16827
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:36:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 18:06:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=16828
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:36:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 18:06:47', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16829
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:36:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:06:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-10-21 18:06:49', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=16830
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-10-21 18:07:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=16831
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:14", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:07:14', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16832

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ce6c2705f
-- ----------------------------------------------------------------------------------------------------

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-21 18:07:14', '06ad8ce6c2705f', '1', '0.00', '0', '0', '1', '4185.00', '4185', '4185', '0', '1', '2026-10-21 18:07:14', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','4185','0','','0','0','4185','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1194
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','اضافة فاتورة مبيعات','1194', '0', '2026-10-21 18:07:14', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4185', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 18:07:14','0','0','',''); -- id=1419
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '1194', '199', '2260', '9', '465', '4185', '0', '', '0', '2026-10-21 18:07:14', '2260', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6723-9,','1','1','0','0','465','4185','0','','0','0.00','0','0','0','0'); -- id=4850
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 = 4850;
 INSERT INTO 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-21', 4185, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4185, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4185, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4185, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-21 18:07:14' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '9', '1', '1194', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '21', '6', '2026-10-21 18:07:14','0','0'); -- id=16182
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1027550',  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 ('1023365','4185', '0', '4', 'اضافة فاتورة مبيعات', '1194', '1027550', '2026-10-21 18:07:14', '6',  'sellbillController.php','1','','0'); -- id=1475
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4185', '4185', '2026-10-21', '6', '0', '0', '2026-10-21 18:07:14','اضافة فاتورة مبيعات رقم 1194','1','0',null,'0','1194','sellbillController.php?do=showDetail&sellbillid=1194'); -- id=4222
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4222', '568', '4185', '','0'); -- id=4333
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '1027550', 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 ('4222', '143', '4185', '','0'); -- id=4224
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13481200', 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 ( '4050', '4050', '2026-10-21', '6', '0', '0', '2026-10-21 18:07:14','اضافة فاتورة مبيعات رقم 1194 - صرف البضاعة من المخزن','1','0',null,'0','1194','sellbillController.php?do=showDetail&sellbillid=1194'); -- id=4223
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4223', '402', '4050', '','0'); -- id=4334
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12473701.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 ('4223', '382', '4050', '','0'); -- id=4225
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25185538.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='4222,0,4223' where sellbillid=1194;
 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-21', 4185, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4185, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, 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-21', 4185, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4185, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, 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, 4185, 4050, 4050
                    , 4050, 4050, 4050, 4050, 4050, 4050)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4185, netSellCostBuyPrice = netSellCostBuyPrice+4050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4050
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4050
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4050;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ce6c2705f and sellbillId = 1194 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:15", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:07:15', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16833
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:07:34', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16834
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-21 14:37:35";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 18:07:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:07:35', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16835
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:07:36', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16836
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:07:43', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16837

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8d4141fc6f
-- ----------------------------------------------------------------------------------------------------

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-21 18:07:43', '06ad8d4141fc6f', '1', '0.00', '0', '5', '1', '19525.00', '19520', '19520', '0', '1', '2026-10-21 18:07:43', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '50' ,'0','','','','','-1','0','0','0','0','0','19520','0','','0','0','19520','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1195
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','اضافة فاتورة مبيعات','1195', '0', '2026-10-21 18:07:43', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '19520', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 18:07:43','0','0','',''); -- id=1420
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('435','09714', '1195', '11', '770', '5', '455', '2275', '0', '', '0', '2026-10-21 18:07:43', '770', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','455','2275','0','','0','0.00','0','0','0','0'); -- id=4851
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 4851;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (770, '2026-10-21', 2274.4174135723, 2175, 2175
                    , 2175, 2175, 2175, 2175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2175, 2175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2274.4174135723, sellCostBuyPrice =sellCostBuyPrice+2175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2274.4174135723, 2175, 2175
                    , 2175, 2175, 2175, 2175
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2175, 2175, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2274.4174135723, sellCostBuyPrice =sellCostBuyPrice+2175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2175, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2175
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2175, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2175
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2175
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2175
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2175
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-21 18:07:43' WHERE storedetailid = '770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('770', '1', '5', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '279', '274', '2', '2026-10-21 18:07:43','0','0'); -- id=16183
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6763;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('385','02278', '1195', '32', '2278', '10', '400', '4000', '0', '', '0', '2026-10-21 18:07:43', '2278', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6763-10,','1','1','0','0','400','4000','0','','0','0.00','0','0','0','0'); -- id=4852
UPDATE sellbilldetail SET  lastbuyprice = 385.00 , meanbuyprice = 385.00, lastbuyprice_withDiscount = 385.00, meanbuyprice_withDiscount = 385.00
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where sellbilldetailid = 4852;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2278, '2026-10-21', 3998.9756722151, 3850, 3850
                    , 3850, 3850, 3850, 3850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3850, 3850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3998.9756722151, sellCostBuyPrice =sellCostBuyPrice+3850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3998.9756722151, 3850, 3850
                    , 3850, 3850, 3850, 3850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3850, 3850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3998.9756722151, sellCostBuyPrice =sellCostBuyPrice+3850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:07:43' WHERE storedetailid = '3671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2278', '1', '10', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '40', '2', '2026-10-21 18:07:43','0','0'); -- id=16184
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 295;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01517', '1195', '32', '1517', '10', '395', '3950', '0', '', '0', '2026-10-21 18:07:43', '1517', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','295-10,','1','1','0','0','395','3950','0','','0','0.00','0','0','0','0'); -- id=4853
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 = 4853;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1517, '2026-10-21', 3948.9884763124, 3800, 3800
                    , 3800, 3800, 3800, 3800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3800, 3800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3948.9884763124, sellCostBuyPrice =sellCostBuyPrice+3800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3948.9884763124, 3800, 3800
                    , 3800, 3800, 3800, 3800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3800, 3800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3948.9884763124, sellCostBuyPrice =sellCostBuyPrice+3800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:07:43' WHERE storedetailid = '1542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1517', '1', '10', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '65', '2', '2026-10-21 18:07:43','0','0'); -- id=16185
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','09823', '1195', '32', '1035', '5', '450', '2250', '0', '', '0', '2026-10-21 18:07:43', '1035', '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=4854
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 = 4854;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1035, '2026-10-21', 2249.423815621, 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+2249.423815621, 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-21', 2249.423815621, 2150, 2150
                    , 2150, 2150, 2150, 2150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2150, 2150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2249.423815621, 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 = '20', userid = '2', storedetaildate = '2026-10-21 18:07:43' WHERE storedetailid = '1035';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1035', '1', '5', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '20', '2', '2026-10-21 18:07:43','0','0'); -- id=16186
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 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', '1195', '40', '1133', '10', '295', '2950', '0', '', '0', '2026-10-21 18:07:43', '1133', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6711-10,','1','1','0','0','295','2950','0','','0','0.00','0','0','0','0'); -- id=4855
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 = 4855;
 INSERT INTO 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-21', 2949.2445582586, 2650, 2650
                    , 2654.8, 2650, 2654.8, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 2650, 2654.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2949.2445582586, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2654.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2654.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2654.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+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-21', 2949.2445582586, 2650, 2650
                    , 2654.8, 2650, 2654.8, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2650, 2654.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2949.2445582586, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2654.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2654.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2654.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 = '780', userid = '2', storedetaildate = '2026-10-21 18:07:43' WHERE storedetailid = '1133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1133', '1', '10', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '790', '780', '2', '2026-10-21 18:07:43','0','0'); -- id=16187
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6762;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02277', '1195', '32', '2277', '10', '410', '4100', '0', '', '0', '2026-10-21 18:07:43', '2277', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6762-10,','1','1','0','0','410','4100','0','','0','0.00','0','0','0','0'); -- id=4856
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 395
                where sellbilldetailid = 4856;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2277, '2026-10-21', 4098.9500640205, 3950, 3950
                    , 3950, 3950, 3950, 3950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3950, 3950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4098.9500640205, sellCostBuyPrice =sellCostBuyPrice+3950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 4098.9500640205, 3950, 3950
                    , 3950, 3950, 3950, 3950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3950, 3950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4098.9500640205, sellCostBuyPrice =sellCostBuyPrice+3950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 18:07:43' WHERE storedetailid = '3670';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2277', '1', '10', '1', '1195', 'اضافة فاتورة مبيعات', 'sellbillController.php', '100', '90', '2', '2026-10-21 18:07:43','0','0'); -- id=16188
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7459613.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 ('7440093.5','19520', '0', '2', 'اضافة فاتورة مبيعات', '1195', '7459613.5', '2026-10-21 18:07:43', '2',  'sellbillController.php','1','','0'); -- id=1476
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '19525', '19525', '2026-10-21', '2', '0', '0', '2026-10-21 18:07:43','اضافة فاتورة مبيعات رقم 1195','1','0',null,'0','1195','sellbillController.php?do=showDetail&sellbillid=1195'); -- id=4224
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4224', '419', '19520', '','0'); -- id=4335
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7459613', 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 ('4224', '398', '5', '','0'); -- id=4336
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510229.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 ('4224', '143', '19525', '','0'); -- id=4226
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13500725', 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 ( '18575', '18575', '2026-10-21', '2', '0', '0', '2026-10-21 18:07:43','اضافة فاتورة مبيعات رقم 1195 - صرف البضاعة من المخزن','1','0',null,'0','1195','sellbillController.php?do=showDetail&sellbillid=1195'); -- id=4225
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4225', '402', '18575', '','0'); -- id=4337
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12492276.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 ('4225', '382', '18575', '','0'); -- id=4227
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25166963.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='4224,0,4225' where sellbillid=1195;
 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-21', 19520, 18575, 18575
                    , 18579.8, 18575, 18579.8, 18575
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18575, 18579.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19520, sellCostBuyPrice =sellCostBuyPrice+18575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18579.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18579.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18579.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;
 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-21', 19520, 18575, 18575
                    , 18579.8, 18575, 18579.8, 18575
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18575, 18579.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19520, sellCostBuyPrice =sellCostBuyPrice+18575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18579.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18579.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18579.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 19520, 18575, 18575
                    , 18579.8, 18575, 18579.8, 18575, 18575, 18579.8)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+19520, netSellCostBuyPrice = netSellCostBuyPrice+18575
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18575
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18579.8
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+18575
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+18579.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+18575
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18575
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18579.8;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8d4141fc6f and sellbillId = 1195 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:37:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:07:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:07:43', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16838
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:38:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:08:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:08:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16839
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:38:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:08:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:08:30', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16840
UPDATE productunit SET proUnitSellAllPrice  = 320.00 * productnumber  WHERE productid = 1886;
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-21 18:09:24',1)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-21 18:09:24', userid = 1; -- id=2815
UPDATE productunit SET proUnitSellAllPrice  = 395.00 * productnumber  WHERE productid = 1891;
UPDATE product SET productName = 'خاص دوبل زونط الالماني', productDescription = '', productCatId = '147', productBuyPrice = '364.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364.00',lastbuyprice_withDiscount = '364',meanbuyprice = '364.00',meanbuyprice_withDiscount = '364' , productbuypricereal = '364.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1891';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1891, 1,'2026-10-21 18:09:26',1)
                ON DUPLICATE KEY UPDATE productid = 1891, edited = 1, sysdate = '2026-10-21 18:09:26', userid = 1; -- id=2820
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:40:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:10:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:10:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16841
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:41:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:11:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-10-21 18:11:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=16842
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:42:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:12:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:12:40', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16843
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 ('بوكس فيت دبل سوسته الالماني','','147','394','425','0','0','2026-10-21','0','1','0','','0','0','0','0','0','394','394','394','394','394','0','7.87','0','0','.','0','0','0','394','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','394','394','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','394','0','0','0','0','0','0','','','0','0','0','0'); -- id=2359
UPDATE product SET productName = 'بوكس فيت دبل سوسته الالماني', productDescription = '', productCatId = '147', productBuyPrice = '394', productSellAllPrice = '425', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02359',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '394',lastbuyprice_withDiscount = '394',meanbuyprice = '394',meanbuyprice_withDiscount = '394' , productbuypricereal = '394' , buypricereal_precentage = '0' , buytotal_precentage = '7.87' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='394',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='394',meanbuyprice_withTax='394',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='394',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2359';
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', '2359', '1.00', '2026-10-21', '1', '0','0235901','425','0','0','394','','0','0','0','0','0','0','0','0','0','0'); -- id=2359
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2359', '1', '0', '1', '2026-10-21'); -- id=3753
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2359', '1', '0', '0', '2359', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16189
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2359, 1,'2026-10-21 18:12:40',1)
                ON DUPLICATE KEY UPDATE productid = 2359, edited = 1, sysdate = '2026-10-21 18:12:40', userid = 1; -- id=3510
UPDATE product SET productName = 'بوكس فيت دبل سوسته الالماني', productDescription = '', productCatId = '147', productBuyPrice = '394.00', productSellAllPrice = '425.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02359',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '394',lastbuyprice_withDiscount = '394',meanbuyprice = '394',meanbuyprice_withDiscount = '394' , productbuypricereal = '394' , buypricereal_precentage = '0' , buytotal_precentage = '7.87' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='394',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='394',meanbuyprice_withTax='394',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='394',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2359';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:42:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:12:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:12:41', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16844
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:42:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:12:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:12:52', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16845
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:13:15', '2', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1195'); -- id=16846
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:13:23', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16847
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:13:23', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16848
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 18:13:25', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16849
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:13:31', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16850
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:43:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:13:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:13:47', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16851
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:44:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:14:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:14:20', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16852
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 ('06ad8d6748e0ce', '2026-10-21 18:12:52', '161', '294663.00', '395535', '0', '0', '100872.00',  '100872.00', '0', '100872', '1', '2026-10-21 18:14:20', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=300
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', '300', '147', '1886', '72', '289', '20808.00', '0', '', '2026-10-21 18:14:20', '1886','','','0','0','0','0','0',null,'289','20808','0','0','0','0','0','0','0','0','1'); -- id=1673
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:12:52', 1, 1886, 0, 0
                    , 289, 72, 0, 0, 1, '2026-10-21 18:14:20')
                ON DUPLICATE KEY UPDATE buyprice = 289,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:14:20' ; -- id=6989
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1886', '289', '72', '0', 'buyBillController.php', '1673', '', '0', '0'); -- id=1227
UPDATE product SET  productBuyPrice = "289" WHERE productId = 1886 ;
UPDATE buybilldetail SET  quantitybefore = 64 WHERE buybilldetailid = 1673 ;
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 = 1673;
UPDATE productunit SET proUnitBuyPrice  = 289 * productnumber WHERE productid = 1886;
UPDATE storedetail SET  productquantity = '136', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '72', '0', '300', 'اضافة فاتورة مشتريات', 'buyBillController.php', '64', '136', '1', '2026-10-21 18:12:52','0','0'); -- id=16190
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 ('02359', '300', '147', '2359', '72', '394', '28368.00', '0', '', '2026-10-21 18:14:20', '2359','','','0','0','0','0','0',null,'394','28368','0','0','0','0','0','0','0','0','1'); -- id=1674
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:12:52', 1, 2359, 0, 0
                    , 394, 72, 0, 0, 1, '2026-10-21 18:14:20')
                ON DUPLICATE KEY UPDATE buyprice = 394,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:14:20' ; -- id=6990
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2359', '394', '72', '0', 'buyBillController.php', '1674', '', '0', '0'); -- id=1228
UPDATE product SET  productBuyPrice = "394" WHERE productId = 2359 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1674 ;
UPDATE product SET productName = 'بوكس فيت دبل سوسته الالماني', productDescription = '', productCatId = '147', productBuyPrice = '394.00', productSellAllPrice = '425.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02359',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '394',lastbuyprice_withDiscount = '394',meanbuyprice = '394',meanbuyprice_withDiscount = '394' , productbuypricereal = '394.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.87' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='394',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='394',meanbuyprice_withTax='394',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='394',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2359';
UPDATE buybilldetail SET  lastbuyprice = 394 , meanbuyprice = 394, lastbuyprice_withDiscount = 394, meanbuyprice_withDiscount = 394
        , lastbuyprice_withTax = 394, meanbuyprice_withTax = 394, lastbuyprice_withDiscountAndTax = 394
                where buybilldetailid = 1674;
UPDATE productunit SET proUnitBuyPrice  = 394 * productnumber WHERE productid = 2359;
UPDATE storedetail SET  productquantity = '72', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3753';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2359', '1', '72', '0', '300', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '72', '1', '2026-10-21 18:12:52','0','0'); -- id=16191
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 ('01885', '300', '147', '1885', '144', '359', '51696.00', '0', '', '2026-10-21 18:14:20', '1885','','','0','0','0','0','0',null,'359','51696','0','0','0','0','0','0','0','0','1'); -- id=1675
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:12:52', 1, 1885, 0, 0
                    , 359, 144, 0, 0, 1, '2026-10-21 18:14:20')
                ON DUPLICATE KEY UPDATE buyprice = 359,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:14:20' ; -- id=6991
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1885', '359', '144', '0', 'buyBillController.php', '1675', '', '0', '0'); -- id=1229
UPDATE product SET  productBuyPrice = "359" WHERE productId = 1885 ;
UPDATE buybilldetail SET  quantitybefore = 1 WHERE buybilldetailid = 1675 ;
UPDATE product SET productName = 'اوفر سايز دوبل تطريز الالماني', productDescription = '', productCatId = '147', productBuyPrice = '359.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01885',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '359',lastbuyprice_withDiscount = '359',meanbuyprice = '359',meanbuyprice_withDiscount = '359' , productbuypricereal = '359.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.64' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='359',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='359',meanbuyprice_withTax='359',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='359',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1885';
UPDATE buybilldetail SET  lastbuyprice = 359 , meanbuyprice = 359, lastbuyprice_withDiscount = 359, meanbuyprice_withDiscount = 359
        , lastbuyprice_withTax = 359, meanbuyprice_withTax = 359, lastbuyprice_withDiscountAndTax = 359
                where buybilldetailid = 1675;
UPDATE productunit SET proUnitBuyPrice  = 359 * productnumber WHERE productid = 1885;
UPDATE storedetail SET  productquantity = '145', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2902';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1885', '1', '144', '0', '300', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1', '145', '1', '2026-10-21 18:12:52','0','0'); -- id=16192
UPDATE supplier SET  suppliercurrentDebt = '395535',suppliercurrentDebtInCurrency= '395535' , userid = '1', supplierdate = '2026-10-21 18:14:20'   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', '294663.00', '100872', '0', 'اضافة فاتورة مشتريات', '300', '395535', '2026-10-21 18:12:52', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','100872','1','294663','100872','395535','0',''); -- id=820
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '100872', '100872', '2026-10-21', '1', '0', '0', '2026-10-21 18:14:20','اضافة فاتورة مشتريات رقم 300','1','0',null,'0','300','buyBillController.php?do=details&id=300'); -- id=4226
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4226', '382', '100872', '','0'); -- id=4338
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25267835.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 ('4226', '644', '100872', '','0'); -- id=4228
UPDATE accountstree SET name = 'الالماني', customName = 'الالماني', customNameEn = 'الالماني', nameEn = 'الالماني', parent = '81', accountNature = '1', theValue = '395535', 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='4226,0' where buybillid=300;
COMMIT;
UPDATE product SET overAllAveragePrice = 359 WHERE productId = 1885;UPDATE product SET overAllAveragePrice = 289 WHERE productId = 1886;UPDATE product SET overAllAveragePrice = 394 WHERE productId = 2359;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:44:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:14:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:14:20', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=300'); -- id=16853
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:44:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:14:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:14:26', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=300&type=2'); -- id=16854
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:49:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:19:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:19:13', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16855
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 ('موديل 6180 فيلو','','31','480','500','0','0','2026-10-21','0','1','0','','0','0','0','0','0','480','480','480','480','480','0','4.17','0','0','.','0','0','0','480','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','480','480','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','480','0','0','0','0','0','0','','','0','0','0','0'); -- id=2360
UPDATE product SET productName = 'موديل 6180 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '480', productSellAllPrice = '500', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02360',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '4.17' , 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 = '',webApiId='0',weightedDiscount='0',sortby='0',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='480',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='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 = '2360';
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', '2360', '1', '2026-10-21', '1', '0','0236001','500','0','0','480','','0','0','0','0','0','0','0','0','0','0'); -- id=2360
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2360', '1', '0', '1', '2026-10-21'); -- id=3754
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2360', '1', '0', '0', '2360', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16193
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2360, 1,'2026-10-21 18:19:13',1)
                ON DUPLICATE KEY UPDATE productid = 2360, edited = 1, sysdate = '2026-10-21 18:19:13', userid = 1; -- id=3511
UPDATE product SET productName = 'موديل 6180 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02360',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '4.17' , 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 = '',webApiId='0',weightedDiscount='0',sortby='0',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='480',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='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 = '2360';
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 ('موديل 6184 فيلو','','31','435','455','0','0','2026-10-21','0','1','0','','0','0','0','0','0','435','435','435','435','435','0','4.6','0','0','.','0','0','0','435','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','435','435','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','435','0','0','0','0','0','0','','','0','0','0','0'); -- id=2361
UPDATE product SET productName = 'موديل 6184 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '435', productSellAllPrice = '455', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435' , buypricereal_precentage = '0' , buytotal_precentage = '4.6' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2361';
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', '2361', '1', '2026-10-21', '1', '0','0236101','455','0','0','435','','0','0','0','0','0','0','0','0','0','0'); -- id=2361
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2361', '1', '0', '1', '2026-10-21'); -- id=3755
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2361', '1', '0', '0', '2361', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16194
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2361, 1,'2026-10-21 18:19:13',1)
                ON DUPLICATE KEY UPDATE productid = 2361, edited = 1, sysdate = '2026-10-21 18:19:13', userid = 1; -- id=3512
UPDATE product SET productName = 'موديل 6184 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '435.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435' , buypricereal_precentage = '0' , buytotal_precentage = '4.6' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2361';
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 ('موديل 6190 فيلو','','31','615','635','0','0','2026-10-21','0','1','0','','0','0','0','0','0','615','615','615','615','615','0','3.25','0','0','.','0','0','0','615','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','615','615','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','615','0','0','0','0','0','0','','','0','0','0','0'); -- id=2362
UPDATE product SET productName = 'موديل 6190 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615', productSellAllPrice = '635', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615' , buypricereal_precentage = '0' , buytotal_precentage = '3.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',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='615',meanbuyprice_withTax='615',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='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2362';
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', '2362', '1', '2026-10-21', '1', '0','0236201','635','0','0','615','','0','0','0','0','0','0','0','0','0','0'); -- id=2362
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2362', '1', '0', '1', '2026-10-21'); -- id=3756
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2362', '1', '0', '0', '2362', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16195
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2362, 1,'2026-10-21 18:19:13',1)
                ON DUPLICATE KEY UPDATE productid = 2362, edited = 1, sysdate = '2026-10-21 18:19:13', userid = 1; -- id=3513
UPDATE product SET productName = 'موديل 6190 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615.00', productSellAllPrice = '635.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615' , buypricereal_precentage = '0' , buytotal_precentage = '3.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',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='615',meanbuyprice_withTax='615',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='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2362';
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 ('موديل 6166 فيلو','','31','570','590','0','0','2026-10-21','0','1','0','','0','0','0','0','0','570','570','570','570','570','0','3.51','0','0','.','0','0','0','570','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','570','570','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','570','0','0','0','0','0','0','','','0','0','0','0'); -- id=2363
UPDATE product SET productName = 'موديل 6166 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2363';
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', '2363', '1', '2026-10-21', '1', '0','0236301','590','0','0','570','','0','0','0','0','0','0','0','0','0','0'); -- id=2363
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2363', '1', '0', '1', '2026-10-21'); -- id=3757
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2363', '1', '0', '0', '2363', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16196
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2363, 1,'2026-10-21 18:19:13',1)
                ON DUPLICATE KEY UPDATE productid = 2363, edited = 1, sysdate = '2026-10-21 18:19:13', userid = 1; -- id=3514
UPDATE product SET productName = 'موديل 6166 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2363';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:49:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:19:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:19:14', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16856
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:49:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:19:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:19:21', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16857
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:50:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:20:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:20:31', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16858
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 ('06ad8d7f95576b', '2026-10-21 18:19:21', '6', '669642.00', '748992', '0', '0', '79350.00',  '79350.00', '0', '79350', '1', '2026-10-21 18:20:31', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=301
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 ('02360', '301', '31', '2360', '35', '480', '16800.00', '0', '', '2026-10-21 18:20:31', '2360','','','0','0','0','0','0',null,'480','16800','0','0','0','0','0','0','0','0','1'); -- id=1676
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:19:21', 1, 2360, 0, 0
                    , 480, 35, 0, 0, 1, '2026-10-21 18:20:31')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+35, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:20:31' ; -- id=6992
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2360', '480', '35', '0', 'buyBillController.php', '1676', '', '0', '0'); -- id=1230
UPDATE product SET  productBuyPrice = "480" WHERE productId = 2360 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1676 ;
UPDATE product SET productName = 'موديل 6180 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02360',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.17' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',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='480',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='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 = '2360';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 1676;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 2360;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3754';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2360', '1', '35', '0', '301', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '35', '1', '2026-10-21 18:19:21','0','0'); -- id=16197
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 ('02361', '301', '31', '2361', '30', '435', '13050.00', '0', '', '2026-10-21 18:20:31', '2361','','','0','0','0','0','0',null,'435','13050','0','0','0','0','0','0','0','0','1'); -- id=1677
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:19:21', 1, 2361, 0, 0
                    , 435, 30, 0, 0, 1, '2026-10-21 18:20:31')
                ON DUPLICATE KEY UPDATE buyprice = 435,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:20:31' ; -- id=6993
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2361', '435', '30', '0', 'buyBillController.php', '1677', '', '0', '0'); -- id=1231
UPDATE product SET  productBuyPrice = "435" WHERE productId = 2361 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1677 ;
UPDATE product SET productName = 'موديل 6184 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '435.00', productSellAllPrice = '455.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '435.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.60' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='435',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2361';
UPDATE buybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where buybilldetailid = 1677;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 2361;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3755';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2361', '1', '30', '0', '301', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 18:19:21','0','0'); -- id=16198
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 ('02362', '301', '31', '2362', '36', '615', '22140.00', '0', '', '2026-10-21 18:20:31', '2362','','','0','0','0','0','0',null,'615','22140','0','0','0','0','0','0','0','0','1'); -- id=1678
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:19:21', 1, 2362, 0, 0
                    , 615, 36, 0, 0, 1, '2026-10-21 18:20:31')
                ON DUPLICATE KEY UPDATE buyprice = 615,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:20:31' ; -- id=6994
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2362', '615', '36', '0', 'buyBillController.php', '1678', '', '0', '0'); -- id=1232
UPDATE product SET  productBuyPrice = "615" WHERE productId = 2362 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1678 ;
UPDATE product SET productName = 'موديل 6190 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615.00', productSellAllPrice = '635.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',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='615',meanbuyprice_withTax='615',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='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2362';
UPDATE buybilldetail SET  lastbuyprice = 615 , meanbuyprice = 615, lastbuyprice_withDiscount = 615, meanbuyprice_withDiscount = 615
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where buybilldetailid = 1678;
UPDATE productunit SET proUnitBuyPrice  = 615 * productnumber WHERE productid = 2362;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3756';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2362', '1', '36', '0', '301', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-21 18:19:21','0','0'); -- id=16199
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 ('02363', '301', '31', '2363', '48', '570', '27360.00', '0', '', '2026-10-21 18:20:31', '2363','','','0','0','0','0','0',null,'570','27360','0','0','0','0','0','0','0','0','1'); -- id=1679
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:19:21', 1, 2363, 0, 0
                    , 570, 48, 0, 0, 1, '2026-10-21 18:20:31')
                ON DUPLICATE KEY UPDATE buyprice = 570,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:20:31' ; -- id=6995
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2363', '570', '48', '0', 'buyBillController.php', '1679', '', '0', '0'); -- id=1233
UPDATE product SET  productBuyPrice = "570" WHERE productId = 2363 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1679 ;
UPDATE product SET productName = 'موديل 6166 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.51' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',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='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2363';
UPDATE buybilldetail SET  lastbuyprice = 570 , meanbuyprice = 570, lastbuyprice_withDiscount = 570, meanbuyprice_withDiscount = 570
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where buybilldetailid = 1679;
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 2363;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3757';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2363', '1', '48', '0', '301', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-21 18:19:21','0','0'); -- id=16200
UPDATE supplier SET  suppliercurrentDebt = '748992',suppliercurrentDebtInCurrency= '748992' , userid = '1', supplierdate = '2026-10-21 18:20:31'   WHERE supplierid = '6';
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 ('6', '669642.00', '79350', '0', 'اضافة فاتورة مشتريات', '301', '748992', '2026-10-21 18:19:21', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','79350','1','669642','79350','748992','0',''); -- id=821
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '79350', '79350', '2026-10-21', '1', '0', '0', '2026-10-21 18:20:31','اضافة فاتورة مشتريات رقم 301','1','0',null,'0','301','buyBillController.php?do=details&id=301'); -- id=4227
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4227', '382', '79350', '','0'); -- id=4339
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25347185.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 ('4227', '425', '79350', '','0'); -- id=4229
UPDATE accountstree SET name = 'فيلو - مورد', customName = 'فيلو - مورد', customNameEn = 'فيلو - مورد', nameEn = 'فيلو - مورد', parent = '81', accountNature = '1', theValue = '-86545', 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 = '425';
update buybill set dailyentryid='4227,0' where buybillid=301;
COMMIT;
UPDATE product SET overAllAveragePrice = 480 WHERE productId = 2360;UPDATE product SET overAllAveragePrice = 435 WHERE productId = 2361;UPDATE product SET overAllAveragePrice = 615 WHERE productId = 2362;UPDATE product SET overAllAveragePrice = 570 WHERE productId = 2363;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:50:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:20:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:20:32', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=301'); -- id=16859
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:50:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:20:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:20:36', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=301&type=2'); -- id=16860
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:51:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:21:03", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 18:21:03', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16861
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:54:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:24:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:24:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16862
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:55:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:25:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:25:48', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16863

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8d26fce617
-- ----------------------------------------------------------------------------------------------------

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-21 18:25:48', '06ad8d26fce617', '1', '0.00', '0', '0', '1', '2700.00', '2700', '2700', '0', '2', '2026-10-21 18:25:48', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','2700','0','','0','0','2700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1196
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','اضافة فاتورة مبيعات','1196', '0', '2026-10-21 18:25:48', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2700', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 18:25:48','0','0','',''); -- id=1421
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1369;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('850','01928', '1196', '155', '1928', '3', '900', '2700', '0', '', '0', '2026-10-21 18:25:48', '1928', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','1369-3,','1','1','0','0','900','2700','0','','0','0.00','0','0','0','0'); -- id=4857
UPDATE sellbilldetail SET  lastbuyprice = 850.00 , meanbuyprice = 850.00, lastbuyprice_withDiscount = 850.00, meanbuyprice_withDiscount = 850.00
        , lastbuyprice_withTax = 850, meanbuyprice_withTax = 1396.43, lastbuyprice_withDiscountAndTax = 850
                where sellbilldetailid = 4857;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1928, '2026-10-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '4', storedetaildate = '2026-10-21 18:25:48' WHERE storedetailid = '3088';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '2', '3', '1', '1196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '3', '4', '2026-10-21 18:25:48','0','0'); -- id=16201
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1170882.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 ('1168182.875','2700', '0', '3', 'اضافة فاتورة مبيعات', '1196', '1170882.875', '2026-10-21 18:25:48', '4',  'sellbillController.php','1','','0'); -- id=1477
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2700', '2700', '2026-10-21', '4', '0', '0', '2026-10-21 18:25:48','اضافة فاتورة مبيعات رقم 1196','1','0',null,'0','1196','sellbillController.php?do=showDetail&sellbillid=1196'); -- id=4228
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4228', '501', '2700', '','0'); -- id=4340
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1170882.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 ('4228', '143', '2700', '','0'); -- id=4230
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13503425', 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 ( '2550', '2550', '2026-10-21', '4', '0', '0', '2026-10-21 18:25:48','اضافة فاتورة مبيعات رقم 1196 - صرف البضاعة من المخزن','1','0',null,'0','1196','sellbillController.php?do=showDetail&sellbillid=1196'); -- id=4229
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4229', '402', '2550', '','0'); -- id=4341
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12494826.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 ('4229', '492', '2550', '','0'); -- id=4231
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1554677', 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='4228,0,4229' where sellbillid=1196;
 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-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, 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-21', 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2550, 4189.29, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4189.29
                        , returnSellVal = returnSellVal+0, 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, 2700, 2550, 2550
                    , 2550, 2550, 2550, 2550, 2550, 4189.29)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2700, netSellCostBuyPrice = netSellCostBuyPrice+2550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2550
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2550
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2550
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2550
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2550
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2550
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4189.29;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8d26fce617 and sellbillId = 1196 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:55:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:25:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:25:48', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16864
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:56:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:26:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:26:54', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=300&type=2'); -- id=16865
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:56:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:26:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:26:56', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=300'); -- id=16866
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:27:00', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16867
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:27:11', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16868
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:19', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=123'); -- id=16869
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:33', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16870
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:27:34', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16871
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 ('ترنج 535 اكس كاب','','128','1200','1200','0','0','2026-10-21','0','1','0','','0','0','0','0','0','1200','1200','1200','1200','1200','0','0','0','0','.','0','0','0','1200','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1200','1200','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1200','0','0','0','0','0','0','','','0','0','0','0'); -- id=2364
UPDATE product SET productName = 'ترنج 535 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1200', productSellAllPrice = '1200', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1200',lastbuyprice_withDiscount = '1200',meanbuyprice = '1200',meanbuyprice_withDiscount = '1200' , productbuypricereal = '1200' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1200',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='1200',meanbuyprice_withTax='1200',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='1200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2364';
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', '2364', '1.00', '2026-10-21', '1', '0','0236401','1200','0','0','1200','','0','0','0','0','0','0','0','0','0','0'); -- id=2364
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2364', '1', '0', '1', '2026-10-21'); -- id=3758
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2364', '1', '0', '0', '2364', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16202
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2364, 1,'2026-10-21 18:27:34',1)
                ON DUPLICATE KEY UPDATE productid = 2364, edited = 1, sysdate = '2026-10-21 18:27:34', userid = 1; -- id=3515
UPDATE product SET productName = 'ترنج 535 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1200.00', productSellAllPrice = '1200.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1200',lastbuyprice_withDiscount = '1200',meanbuyprice = '1200',meanbuyprice_withDiscount = '1200' , productbuypricereal = '1200' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1200',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='1200',meanbuyprice_withTax='1200',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='1200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2364';
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 ('سويت شيرت اكس كاب 536','','128','500','500','0','0','2026-10-21','0','1','0','','0','0','0','0','0','500','500','500','500','500','0','0','0','0','.','0','0','0','500','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','500','500','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','500','0','0','0','0','0','0','','','0','0','0','0'); -- id=2365
UPDATE product SET productName = 'سويت شيرت اكس كاب 536', productDescription = '', productCatId = '128', productBuyPrice = '500', productSellAllPrice = '500', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2365';
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', '2365', '1.00', '2026-10-21', '1', '0','0236501','500','0','0','500','','0','0','0','0','0','0','0','0','0','0'); -- id=2365
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2365', '1', '0', '1', '2026-10-21'); -- id=3759
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2365', '1', '0', '0', '2365', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16203
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2365, 1,'2026-10-21 18:27:34',1)
                ON DUPLICATE KEY UPDATE productid = 2365, edited = 1, sysdate = '2026-10-21 18:27:34', userid = 1; -- id=3516
UPDATE product SET productName = 'سويت شيرت اكس كاب 536', productDescription = '', productCatId = '128', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2365';
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 ('سويت شيرت 537 اكس كاب','','128','380','380','0','0','2026-10-21','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','0','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=2366
UPDATE product SET productName = 'سويت شيرت 537 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '380', productSellAllPrice = '380', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02366',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 = '0' , 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 = '2366';
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', '2366', '1.00', '2026-10-21', '1', '0','0236601','380','0','0','380','','0','0','0','0','0','0','0','0','0','0'); -- id=2366
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2366', '1', '0', '1', '2026-10-21'); -- id=3760
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2366', '1', '0', '0', '2366', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16204
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2366, 1,'2026-10-21 18:27:34',1)
                ON DUPLICATE KEY UPDATE productid = 2366, edited = 1, sysdate = '2026-10-21 18:27:34', userid = 1; -- id=3517
UPDATE product SET productName = 'سويت شيرت 537 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '380.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02366',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 = '0' , 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 = '2366';
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 ('ترنج 538 اكس كاب','','128','1100','1100','0','0','2026-10-21','0','1','0','','0','0','0','0','0','1100','1100','1100','1100','1100','0','0','0','0','.','0','0','0','1100','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1100','1100','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1100','0','0','0','0','0','0','','','0','0','0','0'); -- id=2367
UPDATE product SET productName = 'ترنج 538 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1100', productSellAllPrice = '1100', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02367',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',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='1100',meanbuyprice_withTax='1100',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='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2367';
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', '2367', '1.00', '2026-10-21', '1', '0','0236701','1100','0','0','1100','','0','0','0','0','0','0','0','0','0','0'); -- id=2367
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2367', '1', '0', '1', '2026-10-21'); -- id=3761
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2367', '1', '0', '0', '2367', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16205
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2367, 1,'2026-10-21 18:27:34',1)
                ON DUPLICATE KEY UPDATE productid = 2367, edited = 1, sysdate = '2026-10-21 18:27:34', userid = 1; -- id=3518
UPDATE product SET productName = 'ترنج 538 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1100.00', productSellAllPrice = '1100.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02367',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',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='1100',meanbuyprice_withTax='1100',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='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2367';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:27:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16872
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:37', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16873
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16874
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:46', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=123'); -- id=16875
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:56', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=16876
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 123;
UPDATE buybill SET  buybillsysdate = '2026-10-21 18:27:56', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '123';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 12:46:15', 1, 1906, 0, 0
                    , 250, 452, 0, 0, 1, '2026-10-21 18:27:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-452, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:27:56' ; -- id=1000
UPDATE buybilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250.00, meanbuyprice_withTax = 250.00, lastbuyprice_withDiscountAndTax = 250.00
                where buybilldetailid = 773;
UPDATE product SET productName = 'جبردين جينز ذا بيست ', productDescription = '', productCatId = '150', productBuyPrice = '250.00', productSellAllPrice = '270.00', productSellUnitPrice = '270.00', productSellHalfPrice = '270.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01906',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '0',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',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='250',meanbuyprice_withTax='250',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 = '1906';
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 1906;
UPDATE storedetail SET  productquantity = '-28', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1906', '1', '452', '1', '123', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '424', '-28', '1', '2026-10-13 12:46:15','0','0'); -- id=16206
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-21 18:27:56'   WHERE supplierid = '167';
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 ('167', '113000.00', '113000.00', '1', 'حذف فاتورة مشتريات - للتعديل', '123', '0', '2026-10-13 12:46:15', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','113000','1','113000','113000','0','0',''); -- id=822
UPDATE productserial SET del = 1
		 WHERE billid = 123;
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 ('06acdfde7b3177', '2026-10-13 12:46:15', '149', '-50000.00', '63000', '0', '0', '113000.00', '113000.00', '0.00', '113000', '1', '2026-10-21 18:27:56', '', '1', '0', '', '1', '1','1','123','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=302
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 ('01906', '302', '150', '1906', '452.00', '250', '113000.00', '0.00', '', '2026-10-21 18:27:56', '1906','','','0','0','0','0','0',null,'250','113000','0','0','0','0','0','0','0','0','1'); -- id=1680
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 12:46:15', 1, 1906, 0, 0
                    , 250, 452, 0, 0, 1, '2026-10-21 18:27:56')
                ON DUPLICATE KEY UPDATE buyprice = 250,
                        buyQuantity =buyQuantity+452, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:27:56' ; -- id=1000
UPDATE product SET  productBuyPrice = "250" WHERE productId = 1906 ;
UPDATE buybilldetail SET  quantitybefore = -28 WHERE buybilldetailid = 1680 ;
UPDATE product SET productName = 'جبردين جينز ذا بيست ', productDescription = '', productCatId = '150', productBuyPrice = '250.00', productSellAllPrice = '270.00', productSellUnitPrice = '270.00', productSellHalfPrice = '270.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01906',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',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='250',meanbuyprice_withTax='250',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='250',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1906';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 250, meanbuyprice_withDiscount = 250
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where buybilldetailid = 1680;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 1906;
UPDATE storedetail SET  productquantity = '424', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1906', '1', '452', '0', '302', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-28', '424', '1', '2026-10-13 12:46:15','0','0'); -- id=16207
DELETE FROM productserial WHERE billid = 123
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '63000',suppliercurrentDebtInCurrency= '63000' , userid = '1', supplierdate = '2026-10-21 18:27:56'   WHERE supplierid = '149';
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 ('149', '-50000.00', '113000', '0', 'اضافة فاتورة مشتريات', '302', '63000', '2026-10-21 18:27:56', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','113000','1','-50000','113000','63000','0',''); -- id=823
UPDATE dailyentry SET totalcreditor = '113000.00', totaldebtor = '113000.00', thedate = '2026-10-13', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-13 12:47:09', entryComment = 'اضافة فاتورة مشتريات رقم 123', fromFlag = '1',related='0',isopeningentry='0',operationId='123',operationDetailLink='buyBillController.php?do=details&id=123' WHERE id = '2235';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '113000.00', '113000.00', '2026-10-21', '1', '0', '2235', '2026-10-21 18:27:56','تم عكس القيد رقم 2235 ','1','0','0','0','0',''); -- id=4230
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4230', '382', '113000.00', '','0'); -- id=4232
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25234185.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4230', '650', '113000.00', '','0'); -- id=4342
UPDATE accountstree SET name = 'ذا بيست', customName = 'ذا بيست', customNameEn = 'ذا بيست', nameEn = 'ذا بيست', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-13 12:46:28' WHERE id = '650';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '113000', '113000', '2026-10-21', '1', '0', '0', '2026-10-21 18:27:56','اضافة فاتورة مشتريات رقم 302','1','0',null,'0','302','buyBillController.php?do=details&id=302'); -- id=4231
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4231', '382', '113000', '','0'); -- id=4343
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25347185.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 ('4231', '632', '113000', '','0'); -- id=4233
UPDATE accountstree SET name = 'ذا بست - مورد', customName = 'ذا بست - مورد', customNameEn = 'ذا بست - مورد', nameEn = 'ذا بست - مورد', parent = '81', accountNature = '1', theValue = '63000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:36:45' WHERE id = '632';
update buybill set dailyentryid='4231,0' where buybillid=302;
UPDATE product SET overAllAveragePrice = 250 WHERE productId = 1906;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:57:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:27:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:27:57', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=302'); -- id=16877
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:59:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:29:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:29:07', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16878
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 ('06ad8d9e94913e', '2026-10-21 18:27:37', '125', '232668.80', '303251.2', '8', '1', '76720.00',  '70582.40', '0', '70582.4', '1', '2026-10-21 18:29:07', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=303
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 ('02364', '303', '128', '2364', '24', '1200', '28800.00', '0', '', '2026-10-21 18:29:07', '2364','','','0','0','0','0','0',null,'1200','28800','0','0','0','0','0','0','0','0','1'); -- id=1681
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:27:37', 1, 2364, 0, 0
                    , 1104, 24, 0, 0, 1, '2026-10-21 18:29:07')
                ON DUPLICATE KEY UPDATE buyprice = 1104,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:29:07' ; -- id=6998
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2364', '1200', '24', '0', 'buyBillController.php', '1681', '', '0', '0'); -- id=1234
UPDATE product SET  productBuyPrice = "1200" WHERE productId = 2364 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1681 ;
UPDATE product SET productName = 'ترنج 535 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1200.00', productSellAllPrice = '1200.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1200',lastbuyprice_withDiscount = '1104',meanbuyprice = '1200',meanbuyprice_withDiscount = '1104' , productbuypricereal = '1200.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='1200',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='1200',meanbuyprice_withTax='1200',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='1104',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2364';
UPDATE buybilldetail SET  lastbuyprice = 1200 , meanbuyprice = 1200, lastbuyprice_withDiscount = 1104, meanbuyprice_withDiscount = 1104
        , lastbuyprice_withTax = 1200, meanbuyprice_withTax = 1200, lastbuyprice_withDiscountAndTax = 1104
                where buybilldetailid = 1681;
UPDATE productunit SET proUnitBuyPrice  = 1200 * productnumber WHERE productid = 2364;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3758';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2364', '1', '24', '0', '303', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 18:27:37','0','0'); -- id=16208
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 ('02365', '303', '128', '2365', '27', '500', '13500.00', '0', '', '2026-10-21 18:29:07', '2365','','','0','0','0','0','0',null,'500','13500','0','0','0','0','0','0','0','0','1'); -- id=1682
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:27:37', 1, 2365, 0, 0
                    , 460, 27, 0, 0, 1, '2026-10-21 18:29:07')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+27, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:29:07' ; -- id=6999
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2365', '500', '27', '0', 'buyBillController.php', '1682', '', '0', '0'); -- id=1235
UPDATE product SET  productBuyPrice = "500" WHERE productId = 2365 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1682 ;
UPDATE product SET productName = 'سويت شيرت اكس كاب 536', productDescription = '', productCatId = '128', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '460',meanbuyprice = '500',meanbuyprice_withDiscount = '460' , productbuypricereal = '500.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='500',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='500',meanbuyprice_withTax='500',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='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 = '2365';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1682;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 2365;
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3759';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2365', '1', '27', '0', '303', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '27', '1', '2026-10-21 18:27:37','0','0'); -- id=16209
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 ('02366', '303', '128', '2366', '24', '380', '9120.00', '0', '', '2026-10-21 18:29:07', '2366','','','0','0','0','0','0',null,'380','9120','0','0','0','0','0','0','0','0','1'); -- id=1683
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:27:37', 1, 2366, 0, 0
                    , 349.6, 24, 0, 0, 1, '2026-10-21 18:29:07')
                ON DUPLICATE KEY UPDATE buyprice = 349.6,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:29:07' ; -- id=7000
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2366', '380', '24', '0', 'buyBillController.php', '1683', '', '0', '0'); -- id=1236
UPDATE product SET  productBuyPrice = "380" WHERE productId = 2366 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1683 ;
UPDATE product SET productName = 'سويت شيرت 537 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '380.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02366',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '349.6',meanbuyprice = '380',meanbuyprice_withDiscount = '349.6' , productbuypricereal = '380.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='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='349.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 = '2366';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 349.6, meanbuyprice_withDiscount = 349.6
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 349.6
                where buybilldetailid = 1683;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 2366;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3760';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2366', '1', '24', '0', '303', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 18:27:37','0','0'); -- id=16210
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 ('02367', '303', '128', '2367', '23', '1100', '25300.00', '0', '', '2026-10-21 18:29:07', '2367','','','0','0','0','0','0',null,'1100','25300','0','0','0','0','0','0','0','0','1'); -- id=1684
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:27:37', 1, 2367, 0, 0
                    , 1012, 23, 0, 0, 1, '2026-10-21 18:29:07')
                ON DUPLICATE KEY UPDATE buyprice = 1012,
                        buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:29:07' ; -- id=7001
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2367', '1100', '23', '0', 'buyBillController.php', '1684', '', '0', '0'); -- id=1237
UPDATE product SET  productBuyPrice = "1100" WHERE productId = 2367 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1684 ;
UPDATE product SET productName = 'ترنج 538 اكس كاب', productDescription = '', productCatId = '128', productBuyPrice = '1100.00', productSellAllPrice = '1100.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02367',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1012',meanbuyprice = '1100',meanbuyprice_withDiscount = '1012' , productbuypricereal = '1100.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='1100',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='1100',meanbuyprice_withTax='1100',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='1012',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2367';
UPDATE buybilldetail SET  lastbuyprice = 1100 , meanbuyprice = 1100, lastbuyprice_withDiscount = 1012, meanbuyprice_withDiscount = 1012
        , lastbuyprice_withTax = 1100, meanbuyprice_withTax = 1100, lastbuyprice_withDiscountAndTax = 1012
                where buybilldetailid = 1684;
UPDATE productunit SET proUnitBuyPrice  = 1100 * productnumber WHERE productid = 2367;
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3761';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2367', '1', '23', '0', '303', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '23', '1', '2026-10-21 18:27:37','0','0'); -- id=16211
UPDATE supplier SET  suppliercurrentDebt = '303251.2',suppliercurrentDebtInCurrency= '303251.2' , userid = '1', supplierdate = '2026-10-21 18:29:07'   WHERE supplierid = '125';
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 ('125', '232668.80', '70582.4', '0', 'اضافة فاتورة مشتريات', '303', '303251.2', '2026-10-21 18:27:37', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','70582.4','1','232668.8','70582.4','303251.2','0',''); -- id=824
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '70582.4', '70582.4', '2026-10-21', '1', '0', '0', '2026-10-21 18:29:07','اضافة فاتورة مشتريات رقم 303','1','0',null,'0','303','buyBillController.php?do=details&id=303'); -- id=4232
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4232', '382', '70582.4', '','0'); -- id=4344
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25417767.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4232', '608', '70582.4', '','0'); -- id=4234
UPDATE accountstree SET name = 'اكس كاب', customName = 'اكس كاب', customNameEn = 'اكس كاب', nameEn = 'اكس كاب', parent = '81', accountNature = '1', theValue = '303251.2', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 12:29:02' WHERE id = '608';
update buybill set dailyentryid='4232,0' where buybillid=303;
COMMIT;
UPDATE product SET overAllAveragePrice = 1104 WHERE productId = 2364;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 2365;UPDATE product SET overAllAveragePrice = 349.6 WHERE productId = 2366;UPDATE product SET overAllAveragePrice = 1012 WHERE productId = 2367;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:59:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:29:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:29:07', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=303'); -- id=16879
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:59:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:29:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:29:15', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=303&type=2'); -- id=16880
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 14:59:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:29:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:29:18', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16881
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:00:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:30:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 18:30:30', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16882
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:32:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=16883
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:32:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16884
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:32:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16885
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:32:42', '1', 'deleteFinaly', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=167&action=0'); -- id=16886
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:32:44', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16887
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:32:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16888
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:32:54', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16889
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:02:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:32:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:32:58', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16890
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:03:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:33:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:33:16', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16891
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-21 15:03:16";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:33:16', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16892
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:03:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:33:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:33:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16893
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:03:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:33:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:33:32', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16894
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:03:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:33:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:33:37', '1', 'deleteFinaly', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=167&action=0'); -- id=16895
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:03:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:33:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:33:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16896
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:04:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:34:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:34:42', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16897
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:04:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:34:47", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 18:34:47', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16898
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:04:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:34:51", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 18:34:51', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16899
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:06:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:36:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:36:02', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16900
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:06:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:36:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:36:07', '1', 'edit', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=edit&id=167'); -- id=16901
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:06:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:36:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:36:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16902
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:06:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:36:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:36:20', '1', 'deleteFinaly', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=167&action=0'); -- id=16903
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:06:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:36:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 18:36:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=16904
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:07:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:37:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:37:50', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16905
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:08:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:38:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 18:38:08', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=16906
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:08:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:38:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 18:38:39', '1', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=16907
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-21','','93', '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=206
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (206, 1,'2026-10-21 18:38:39',1)
                ON DUPLICATE KEY UPDATE catid = 206, edited = 1, sysdate = '2026-10-21 18:38:39', userid = 1; -- id=221
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '206', '1', '2026-10-21', '1', '0'); -- id=98
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:08:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:38:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 18:38:39', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=16908
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:08:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:38:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-21 18:38:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=16909
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:09:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:39:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:39:21', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16910
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:10:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:40:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:40:46', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16911
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 ('موديل 485 ذا بيست','','206','470','485','0','0','2026-10-21','0','1','0','','0','0','0','0','0','470','470','470','470','470','0','3.19','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=2368
UPDATE product SET productName = 'موديل 485 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '470', productSellAllPrice = '485', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '3.19' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2368';
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', '2368', '1.00', '2026-10-21', '1', '0','0236801','485','0','0','470','','0','0','0','0','0','0','0','0','0','0'); -- id=2368
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2368', '1', '0', '1', '2026-10-21'); -- id=3762
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2368', '1', '0', '0', '2368', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16212
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2368, 1,'2026-10-21 18:40:46',1)
                ON DUPLICATE KEY UPDATE productid = 2368, edited = 1, sysdate = '2026-10-21 18:40:46', userid = 1; -- id=3519
UPDATE product SET productName = 'موديل 485 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '3.19' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2368';
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 ('موديل 470 ذا بيست','','206','455','470','0','0','2026-10-21','0','1','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','1','0','0','0','0','0','0','','455','0','0','0','0','0','0','','','0','0','0','0'); -- id=2369
UPDATE product SET productName = 'موديل 470 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '455', productSellAllPrice = '470', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02369',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2369';
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', '2369', '1.00', '2026-10-21', '1', '0','0236901','470','0','0','455','','0','0','0','0','0','0','0','0','0','0'); -- id=2369
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2369', '1', '0', '1', '2026-10-21'); -- id=3763
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2369', '1', '0', '0', '2369', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16213
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2369, 1,'2026-10-21 18:40:46',1)
                ON DUPLICATE KEY UPDATE productid = 2369, edited = 1, sysdate = '2026-10-21 18:40:46', userid = 1; -- id=3520
UPDATE product SET productName = 'موديل 470 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02369',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2369';
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 ('موديل 370 ذا بيست','','206','355','370','0','0','2026-10-21','0','1','0','','0','0','0','0','0','355','355','355','355','355','0','4.23','0','0','.','0','0','0','355','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','355','355','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','355','0','0','0','0','0','0','','','0','0','0','0'); -- id=2370
UPDATE product SET productName = 'موديل 370 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '355', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355' , buypricereal_precentage = '0' , buytotal_precentage = '4.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2370';
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', '2370', '1.00', '2026-10-21', '1', '0','0237001','370','0','0','355','','0','0','0','0','0','0','0','0','0','0'); -- id=2370
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2370', '1', '0', '1', '2026-10-21'); -- id=3764
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2370', '1', '0', '0', '2370', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16214
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2370, 1,'2026-10-21 18:40:46',1)
                ON DUPLICATE KEY UPDATE productid = 2370, edited = 1, sysdate = '2026-10-21 18:40:46', userid = 1; -- id=3521
UPDATE product SET productName = 'موديل 370 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355' , buypricereal_precentage = '0' , buytotal_precentage = '4.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2370';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:10:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:40:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:40:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16912
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:11:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:41:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:41:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16913
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:11:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:41:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:41:32', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16914
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-21 15:11:33";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:41:33', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16915
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:11:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:41:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:41:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16916
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:11:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:41:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:41:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16917
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:12:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:42:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:42:08', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=16918
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 ('شروال تطريز ذا بيست','','69','360','375','0','0','2026-10-21','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','4.17','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','0','0','0','0','0','-1','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=2371
UPDATE product SET productName = 'شروال تطريز ذا بيست', productDescription = '', productCatId = '69', productBuyPrice = '360', productSellAllPrice = '375', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02371',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 = '4.17' , 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='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 = '2371';
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', '2371', '1', '2026-10-21', '1', '0','0237101','375','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2371
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2371', '1', '0', '1', '2026-10-21'); -- id=3765
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2371', '1', '0', '0', '2371', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16215
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2371, 1,'2026-10-21 18:42:08',1)
                ON DUPLICATE KEY UPDATE productid = 2371, edited = 1, sysdate = '2026-10-21 18:42:08', userid = 1; -- id=3522
UPDATE product SET productName = 'شروال تطريز ذا بيست', productDescription = '', productCatId = '69', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02371',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 = '4.17' , 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='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 = '2371';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:12:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:42:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:42:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=16919
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:12:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:42:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:42:12', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16920
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:13:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:43:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:43:09', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16921
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 ('06ad8dd54c03f7', '2026-10-21 18:42:12', '149', '63000.00', '111280', '0', '0', '48280.00',  '48280.00', '0', '48280', '1', '2026-10-21 18:43:09', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=304
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 ('02368', '304', '206', '2368', '40', '470', '18800.00', '0', '', '2026-10-21 18:43:09', '2368','','','0','0','0','0','0',null,'470','18800','0','0','0','0','0','0','0','0','1'); -- id=1685
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2368, 0, 0
                    , 470, 40, 0, 0, 1, '2026-10-21 18:43:09')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:43:09' ; -- id=7002
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2368', '470', '40', '0', 'buyBillController.php', '1685', '', '0', '0'); -- id=1238
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2368 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1685 ;
UPDATE product SET productName = 'موديل 485 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.19' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2368';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 1685;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2368;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2368', '1', '40', '0', '304', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-21 18:42:12','0','0'); -- id=16216
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 ('02369', '304', '206', '2369', '24', '455', '10920.00', '0', '', '2026-10-21 18:43:09', '2369','','','0','0','0','0','0',null,'455','10920','0','0','0','0','0','0','0','0','1'); -- id=1686
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2369, 0, 0
                    , 455, 24, 0, 0, 1, '2026-10-21 18:43:09')
                ON DUPLICATE KEY UPDATE buyprice = 455,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:43:09' ; -- id=7003
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2369', '455', '24', '0', 'buyBillController.php', '1686', '', '0', '0'); -- id=1239
UPDATE product SET  productBuyPrice = "455" WHERE productId = 2369 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1686 ;
UPDATE product SET productName = 'موديل 470 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02369',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '2369';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 455, lastbuyprice_withDiscount = 455, meanbuyprice_withDiscount = 455
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 455, lastbuyprice_withDiscountAndTax = 455
                where buybilldetailid = 1686;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 2369;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2369', '1', '24', '0', '304', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 18:42:12','0','0'); -- id=16217
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 ('02370', '304', '206', '2370', '32', '355', '11360.00', '0', '', '2026-10-21 18:43:09', '2370','','','0','0','0','0','0',null,'355','11360','0','0','0','0','0','0','0','0','1'); -- id=1687
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2370, 0, 0
                    , 355, 32, 0, 0, 1, '2026-10-21 18:43:09')
                ON DUPLICATE KEY UPDATE buyprice = 355,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:43:09' ; -- id=7004
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2370', '355', '32', '0', 'buyBillController.php', '1687', '', '0', '0'); -- id=1240
UPDATE product SET  productBuyPrice = "355" WHERE productId = 2370 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1687 ;
UPDATE product SET productName = 'موديل 370 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='355',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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2370';
UPDATE buybilldetail SET  lastbuyprice = 355 , meanbuyprice = 355, lastbuyprice_withDiscount = 355, meanbuyprice_withDiscount = 355
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 355
                where buybilldetailid = 1687;
UPDATE productunit SET proUnitBuyPrice  = 355 * productnumber WHERE productid = 2370;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2370', '1', '32', '0', '304', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-21 18:42:12','0','0'); -- id=16218
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 ('02371', '304', '69', '2371', '20', '360', '7200.00', '0', '', '2026-10-21 18:43:09', '2371','','','0','0','0','0','0',null,'360','7200','0','0','0','0','0','0','0','0','1'); -- id=1688
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2371, 0, 0
                    , 360, 20, 0, 0, 1, '2026-10-21 18:43:09')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 18:43:09' ; -- id=7005
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2371', '360', '20', '0', 'buyBillController.php', '1688', '', '0', '0'); -- id=1241
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2371 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1688 ;
UPDATE product SET productName = 'شروال تطريز ذا بيست', productDescription = '', productCatId = '69', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02371',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 = '4.17' , 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='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 = '2371';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1688;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2371;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2371', '1', '20', '0', '304', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 18:42:12','0','0'); -- id=16219
UPDATE supplier SET  suppliercurrentDebt = '111280',suppliercurrentDebtInCurrency= '111280' , userid = '1', supplierdate = '2026-10-21 18:43:09'   WHERE supplierid = '149';
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 ('149', '63000.00', '48280', '0', 'اضافة فاتورة مشتريات', '304', '111280', '2026-10-21 18:42:12', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','48280','1','63000','48280','111280','0',''); -- id=825
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '48280', '48280', '2026-10-21', '1', '0', '0', '2026-10-21 18:43:09','اضافة فاتورة مشتريات رقم 304','1','0',null,'0','304','buyBillController.php?do=details&id=304'); -- id=4233
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4233', '382', '48280', '','0'); -- id=4345
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25466047.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4233', '632', '48280', '','0'); -- id=4235
UPDATE accountstree SET name = 'ذا بست - مورد', customName = 'ذا بست - مورد', customNameEn = 'ذا بست - مورد', nameEn = 'ذا بست - مورد', parent = '81', accountNature = '1', theValue = '111280', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:36:45' WHERE id = '632';
update buybill set dailyentryid='4233,0' where buybillid=304;
COMMIT;
UPDATE product SET overAllAveragePrice = 470 WHERE productId = 2368;UPDATE product SET overAllAveragePrice = 455 WHERE productId = 2369;UPDATE product SET overAllAveragePrice = 355 WHERE productId = 2370;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2371;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:13:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:43:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 18:43:10', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=304'); -- id=16922
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:13:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:43:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:43:14', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=304&type=2'); -- id=16923
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:17:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:47:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:47:35', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=304&type=2'); -- id=16924
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:17:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:47:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('transfermoneyController.php', '2026-10-21 18:47:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/transfermoneyController.php'); -- id=16925
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:17:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:47:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:47:55', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16926
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:19:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:49:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 18:49:07', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16927
UPDATE product SET productName = 'كود 901', productDescription = '', productCatId = '111', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01518',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '495',meanbuyprice = '550.00',meanbuyprice_withDiscount = '495' , productbuypricereal = '550.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='495',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='550',meanbuyprice_withTax='550',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='495',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1518';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1518, 1,'2026-10-21 18:52:10',1)
                ON DUPLICATE KEY UPDATE productid = 1518, edited = 1, sysdate = '2026-10-21 18:52:10', userid = 1; -- id=2312
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:52:15', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16928
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-21 15:22:15";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:52:15', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16929
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 18:52:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=16930
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 18:52:24', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=16931
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 18:52:46', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16932
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-21 15:22:46";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 18:52:46', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16933
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:52:49', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16934
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:52:55', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16935
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:22:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:52:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 18:52:59', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=11'); -- id=16936
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:23:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 18:53:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 18:53:26', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16937
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:32:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:02:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:02:10', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16938
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:38: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-21 15:38:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:08:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:08:41', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16939
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-21 15:38:41";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:08:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:08:41', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16940
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:38:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:08:44", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:08:44', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16941
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:39:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:09:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:09:11', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16942
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:39:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:09:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:09:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16943
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:11:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:11:57', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16944

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e202886e2
-- ----------------------------------------------------------------------------------------------------

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-21 19:11:57', '06ad8e202886e2', '1', '0.00', '0', '0', '1', '5950.00', '5950', '5950', '0', '1', '2026-10-21 19:11:57', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '10' ,'0','','','','','-1','0','0','0','0','0','5950','0','','0','0','5950','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1197
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','اضافة فاتورة مبيعات','1197', '0', '2026-10-21 19:11:57', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5950', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:11:57','0','0','',''); -- id=1422
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02088', '1197', '175', '2088', '10', '595', '5950', '0', '', '0', '2026-10-21 19:11:57', '2088', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6205-10,','1','1','0','0','595','5950','0','','0','0.00','0','0','0','0'); -- id=4858
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 = 4858;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2088, '2026-10-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1091', userid = '2', storedetaildate = '2026-10-21 19:11:57' WHERE storedetailid = '3447';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2088', '1', '10', '1', '1197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1101', '1091', '2', '2026-10-21 19:11:57','0','0'); -- id=16220
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7465563.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 ('7459613.5','5950', '0', '2', 'اضافة فاتورة مبيعات', '1197', '7465563.5', '2026-10-21 19:11:57', '2',  'sellbillController.php','1','','0'); -- id=1478
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5950', '5950', '2026-10-21', '2', '0', '0', '2026-10-21 19:11:57','اضافة فاتورة مبيعات رقم 1197','1','0',null,'0','1197','sellbillController.php?do=showDetail&sellbillid=1197'); -- id=4234
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4234', '419', '5950', '','0'); -- id=4346
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7465563', 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 ('4234', '143', '5950', '','0'); -- id=4236
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13509375', 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 ( '4600', '4600', '2026-10-21', '2', '0', '0', '2026-10-21 19:11:57','اضافة فاتورة مبيعات رقم 1197 - صرف البضاعة من المخزن','1','0',null,'0','1197','sellbillController.php?do=showDetail&sellbillid=1197'); -- id=4235
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4235', '402', '4600', '','0'); -- id=4347
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12499426.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 ('4235', '382', '4600', '','0'); -- id=4237
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25461447.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='4234,0,4235' where sellbillid=1197;
 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-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, 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-21', 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4600, 4600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5950, sellCostBuyPrice =sellCostBuyPrice+4600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4600
                        , returnSellVal = returnSellVal+0, 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, 5950, 4600, 4600
                    , 4600, 4600, 4600, 4600, 4600, 4600)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5950, netSellCostBuyPrice = netSellCostBuyPrice+4600
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4600
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4600
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4600
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4600
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4600;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8e202886e2 and sellbillId = 1197 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:11:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:11:57', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16945
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:42:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:12:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:12:36', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16946

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e38c14082
-- ----------------------------------------------------------------------------------------------------

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-21 19:12:36', '06ad8e38c14082', '1', '0.00', '0', '0', '1', '2400.00', '2400', '2400', '0', '2', '2026-10-21 19:12:36', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'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-21','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=1198
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','اضافة فاتورة مبيعات','1198', '0', '2026-10-21 19:12:36', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:12:36','0','0','',''); -- id=1423
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6374;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('730','02191', '1198', '94', '2191', '3', '800', '2400', '0', '', '0', '2026-10-21 19:12:36', '2191', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6374-3,','1','1','0','0','800','2400','0','','0','0.00','0','0','0','0'); -- id=4859
UPDATE sellbilldetail SET  lastbuyprice = 730.00 , meanbuyprice = 730.00, lastbuyprice_withDiscount = 730.00, meanbuyprice_withDiscount = 730.00
        , lastbuyprice_withTax = 730, meanbuyprice_withTax = 730, lastbuyprice_withDiscountAndTax = 730
                where sellbilldetailid = 4859;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2191, '2026-10-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-21 19:12:36' WHERE storedetailid = '3564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2191', '2', '3', '1', '1198', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '30', '4', '2026-10-21 19:12:36','0','0'); -- id=16221
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1173282.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 ('1170882.875','2400', '0', '3', 'اضافة فاتورة مبيعات', '1198', '1173282.875', '2026-10-21 19:12:36', '4',  'sellbillController.php','1','','0'); -- id=1479
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2400', '2400', '2026-10-21', '4', '0', '0', '2026-10-21 19:12:36','اضافة فاتورة مبيعات رقم 1198','1','0',null,'0','1198','sellbillController.php?do=showDetail&sellbillid=1198'); -- id=4236
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4236', '501', '2400', '','0'); -- id=4348
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1173282.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 ('4236', '143', '2400', '','0'); -- id=4238
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13511775', 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 ( '2190', '2190', '2026-10-21', '4', '0', '0', '2026-10-21 19:12:36','اضافة فاتورة مبيعات رقم 1198 - صرف البضاعة من المخزن','1','0',null,'0','1198','sellbillController.php?do=showDetail&sellbillid=1198'); -- id=4237
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4237', '402', '2190', '','0'); -- id=4349
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12501616.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 ('4237', '492', '2190', '','0'); -- id=4239
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1552487', 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='4236,0,4237' where sellbillid=1198;
 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-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, 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-21', 2400, 2190, 2190
                    , 2190, 2190, 2190, 2190
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2190, 2190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2190
                        , returnSellVal = returnSellVal+0, 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, 2190, 2190
                    , 2190, 2190, 2190, 2190, 2190, 2190)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2400, netSellCostBuyPrice = netSellCostBuyPrice+2190
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2190
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2190
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2190
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2190
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2190
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2190
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2190;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8e38c14082 and sellbillId = 1198 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:42:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:12:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:12:36', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16947
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:43:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:13:06", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 19:13:06', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=16948
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:43:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:13:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:13:29', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16949
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:48:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:18:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:18:51', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16950

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e44dc8fd8
-- ----------------------------------------------------------------------------------------------------

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-21 19:18:51', '06ad8e44dc8fd8', '1', '0.00', '0', '0', '1', '1800.00', '1800', '1800', '0', '1', '2026-10-21 19:18:51', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'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-21','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=1199
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','اضافة فاتورة مبيعات','1199', '0', '2026-10-21 19:18:51', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:18:51','0','0','',''); -- id=1424
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', '1199', '94', '1379', '6', '300', '1800', '0', '', '0', '2026-10-21 19:18:51', '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=4860
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 = 4860;
 INSERT INTO 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-21', 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-21', 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 = '275', userid = '2', storedetaildate = '2026-10-21 19:18:51' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '6', '1', '1199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '281', '275', '2', '2026-10-21 19:18:51','0','0'); -- id=16222
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7467363.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 ('7465563.5','1800', '0', '2', 'اضافة فاتورة مبيعات', '1199', '7467363.5', '2026-10-21 19:18:51', '2',  'sellbillController.php','1','','0'); -- id=1480
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-21', '2', '0', '0', '2026-10-21 19:18:51','اضافة فاتورة مبيعات رقم 1199','1','0',null,'0','1199','sellbillController.php?do=showDetail&sellbillid=1199'); -- id=4238
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4238', '419', '1800', '','0'); -- id=4350
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7467363', 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 ('4238', '143', '1800', '','0'); -- id=4240
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13513575', 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 ( '1620', '1620', '2026-10-21', '2', '0', '0', '2026-10-21 19:18:51','اضافة فاتورة مبيعات رقم 1199 - صرف البضاعة من المخزن','1','0',null,'0','1199','sellbillController.php?do=showDetail&sellbillid=1199'); -- id=4239
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4239', '402', '1620', '','0'); -- id=4351
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12503236.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 ('4239', '382', '1620', '','0'); -- id=4241
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25459827.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='4238,0,4239' where sellbillid=1199;
 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-21', 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;
 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-21', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620, 1620, 1620)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1800, netSellCostBuyPrice = netSellCostBuyPrice+1620
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1620
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1620
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1620
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1620
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1620
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1620
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1620;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8e44dc8fd8 and sellbillId = 1199 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:48:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:18:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:18:52', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16951
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:53:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:23:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 19:23:41', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=6'); -- id=16952
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:53:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:23:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 19:23:58', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16953
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06ad8e70d31aa6', '2026-10-21 19:23:41', '1', '0.00', '-3150', '0', '0', '-3150.00', '-3150.00', '', '-3150', '1', '2026-10-21 19:23:58', '', '1', '0', '', '1', '6','1','0.00','-1','0','1','0','0','0','0','0'); -- id=34
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('07166', '34', '12', '772', '15', '210', '3150', '0', '', '772','','','0','0','0','0','0','210','3150','0','0','0','0','0','0','0','1'); -- id=180
UPDATE product SET productName = 'جبردين شبابى القبطان', productDescription = '', productCatId = '12', productBuyPrice = '210.00', productSellAllPrice = '230.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07166',type ='0', expireDate = '0' , dailyentryId = '127',isService = '0',isOptic = '0',lastbuyprice = '210',lastbuyprice_withDiscount = '210',meanbuyprice = '210',meanbuyprice_withDiscount = '210' , productbuypricereal = '210.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='210',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7166',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='210',meanbuyprice_withTax='210',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='210',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 = '772';
UPDATE returnbuybilldetail SET  lastbuyprice = 210 , meanbuyprice = 210, lastbuyprice_withDiscount = 210, meanbuyprice_withDiscount = 210
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where returnbuybilldetailid = 180;
UPDATE productunit SET proUnitBuyPrice  = 210 * productnumber WHERE productid = 772;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '772';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('772', '1', '15', '1', '34', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '34', '19', '1', '2026-10-21 19:23:41','0','0'); -- id=16223
UPDATE supplier SET  suppliercurrentDebt = '-3150',suppliercurrentDebtInCurrency= '-3150' , userid = '1', supplierdate = '2026-10-21 19:23: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', '0.00', '3150', '1', 'اضافة فاتورة مردوات مشتريات', '34', '-3150', '2026-10-21 19:23:41', '1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','3150','1','0','3150','-3150','0',''); -- id=826
update returnbuybill set dailyentryid='0,0' where returnbuybillid=34;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:53:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:23:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:23:59', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=editprint&id=34'); -- id=16954
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:54:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:24:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:24:40', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16955

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e5ec15030
-- ----------------------------------------------------------------------------------------------------

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-21 19:24:40', '06ad8e5ec15030', '1', '0.00', '0', '0', '1', '11460.00', '11460', '11460', '0', '1', '2026-10-21 19:24:40', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '26' ,'0','','','','','-1','0','0','0','0','0','11460','0','','0','0','11460','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1200
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','اضافة فاتورة مبيعات','1200', '0', '2026-10-21 19:24:40', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11460', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:24:40','0','0','',''); -- id=1425
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6816;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('435','02301', '1200', '203', '2301', '6', '460', '2760', '0', '', '0', '2026-10-21 19:24:40', '2301', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6816-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=4861
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 4861;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2301, '2026-10-21', 2760, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2610, 2610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2760, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2610, 2610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 19:24:40' WHERE storedetailid = '3694';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2301', '1', '6', '1', '1200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '42', '2', '2026-10-21 19:24:40','0','0'); -- id=16224
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6811;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02297', '1200', '203', '2297', '6', '440', '2640', '0', '', '0', '2026-10-21 19:24:40', '2297', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6811-6,','1','1','0','0','440','2640','0','','0','0.00','0','0','0','0'); -- id=4862
UPDATE sellbilldetail SET  lastbuyprice = 405.00 , meanbuyprice = 405.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 405, meanbuyprice_withTax = 405, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 4862;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2297, '2026-10-21', 2640, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 2640, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 19:24:41' WHERE storedetailid = '3690';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2297', '1', '6', '1', '1200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-21 19:24:41','0','0'); -- id=16225
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6721;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02258', '1200', '199', '2258', '8', '420', '3360', '0', '', '0', '2026-10-21 19:24:41', '2258', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6721-8,','1','1','0','0','420','3360','0','','0','0.00','0','0','0','0'); -- id=4863
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 = 4863;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2258, '2026-10-21', 3360, 3200, 3200
                    , 3200, 3200, 3200, 3200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3200, 3200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 3360, 3200, 3200
                    , 3200, 3200, 3200, 3200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3200, 3200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-21 19:24:41' WHERE storedetailid = '3649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2258', '1', '8', '1', '1200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '32', '2', '2026-10-21 19:24:41','0','0'); -- id=16226
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6799;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02291', '1200', '203', '2291', '6', '450', '2700', '0', '', '0', '2026-10-21 19:24:41', '2291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6799-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4864
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 = 4864;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2291, '2026-10-21', 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-21', 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 = '147', userid = '2', storedetaildate = '2026-10-21 19:24:41' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '6', '1', '1200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '153', '147', '2', '2026-10-21 19:24:41','0','0'); -- id=16227
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7478823.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 ('7467363.5','11460', '0', '2', 'اضافة فاتورة مبيعات', '1200', '7478823.5', '2026-10-21 19:24:41', '2',  'sellbillController.php','1','','0'); -- id=1481
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11460', '11460', '2026-10-21', '2', '0', '0', '2026-10-21 19:24:41','اضافة فاتورة مبيعات رقم 1200','1','0',null,'0','1200','sellbillController.php?do=showDetail&sellbillid=1200'); -- id=4240
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4240', '419', '11460', '','0'); -- id=4352
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7478823', 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 ('4240', '143', '11460', '','0'); -- id=4242
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13525035', 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 ( '10760', '10760', '2026-10-21', '2', '0', '0', '2026-10-21 19:24:41','اضافة فاتورة مبيعات رقم 1200 - صرف البضاعة من المخزن','1','0',null,'0','1200','sellbillController.php?do=showDetail&sellbillid=1200'); -- id=4241
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4241', '402', '10760', '','0'); -- id=4353
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12513996.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 ('4241', '382', '10760', '','0'); -- id=4243
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25449067.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='4240,0,4241' where sellbillid=1200;
 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-21', 11460, 10760, 10760
                    , 10760, 10760, 10760, 10760
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10760, 10760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11460, sellCostBuyPrice =sellCostBuyPrice+10760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10760
                        , returnSellVal = returnSellVal+0, 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-21', 11460, 10760, 10760
                    , 10760, 10760, 10760, 10760
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10760, 10760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11460, sellCostBuyPrice =sellCostBuyPrice+10760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10760
                        , returnSellVal = returnSellVal+0, 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, 11460, 10760, 10760
                    , 10760, 10760, 10760, 10760, 10760, 10760)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11460, netSellCostBuyPrice = netSellCostBuyPrice+10760
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10760
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10760
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+10760
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+10760
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+10760
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10760
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+10760;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8e5ec15030 and sellbillId = 1200 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:54:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:24:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:24:41', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16956
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:57:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:27:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:27:03', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16957
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:57:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:27:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:27:09', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16958
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:59:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:29:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:29:04', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16959

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e74941068
-- ----------------------------------------------------------------------------------------------------

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-21 19:29:04', '06ad8e74941068', '1', '0.00', '0', '0', '1', '5475.00', '5475', '5475', '0', '1', '2026-10-21 19:29:04', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','5475','0','','0','0','5475','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1201
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','اضافة فاتورة مبيعات','1201', '0', '2026-10-21 19:29:04', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5475', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:29:04','0','0','',''); -- id=1426
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', '1201', '191', '2252', '12', '370', '4440', '0', '', '0', '2026-10-21 19:29:04', '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=4865
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 = 4865;
 INSERT INTO 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-21', 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-21', 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 = '98', userid = '2', storedetaildate = '2026-10-21 19:29:04' WHERE storedetailid = '3643';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2252', '1', '12', '1', '1201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '110', '98', '2', '2026-10-21 19:29:04','0','0'); -- id=16228
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1201', '191', '2203', '3', '345', '1035', '0', '', '0', '2026-10-21 19:29:04', '2203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6479-3,','1','1','0','0','345','1035','0','','0','0.00','0','0','0','0'); -- id=4866
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 = 4866;
 INSERT INTO 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-21', 1035, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1035, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '2', storedetaildate = '2026-10-21 19:29:04' WHERE storedetailid = '3592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2203', '1', '3', '1', '1201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '9', '2', '2026-10-21 19:29:04','0','0'); -- id=16229
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7484298.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 ('7478823.5','5475', '0', '2', 'اضافة فاتورة مبيعات', '1201', '7484298.5', '2026-10-21 19:29:04', '2',  'sellbillController.php','1','','0'); -- id=1482
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5475', '5475', '2026-10-21', '2', '0', '0', '2026-10-21 19:29:04','اضافة فاتورة مبيعات رقم 1201','1','0',null,'0','1201','sellbillController.php?do=showDetail&sellbillid=1201'); -- id=4242
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4242', '419', '5475', '','0'); -- id=4354
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7484298', 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 ('4242', '143', '5475', '','0'); -- id=4244
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13530510', 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 ( '4440', '4440', '2026-10-21', '2', '0', '0', '2026-10-21 19:29:04','اضافة فاتورة مبيعات رقم 1201 - صرف البضاعة من المخزن','1','0',null,'0','1201','sellbillController.php?do=showDetail&sellbillid=1201'); -- id=4243
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4243', '402', '4440', '','0'); -- id=4355
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12518436.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 ('4243', '382', '4440', '','0'); -- id=4245
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25444627.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='4242,0,4243' where sellbillid=1201;
 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-21', 5475, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5475, 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;
 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-21', 5475, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5475, 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5475, 4440, 4440
                    , 4440, 4440, 4440, 4440, 4440, 4440)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5475, netSellCostBuyPrice = netSellCostBuyPrice+4440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4440
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4440
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4440;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8e74941068 and sellbillId = 1201 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 15:59:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:29:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:29:04', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16960
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-21 16:01:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:31:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:31:40', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16961
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-21 16:01:41";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:31:41', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16962
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:01:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:31:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:31:46', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16963
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:01:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:31:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:31:58', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16964
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:03:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:33:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:33:11', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16965
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-21 16:03:11";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:33:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:33:11', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16966
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:03:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:33:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:33:12', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16967
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:09:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:39:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:39:12', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16968
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-21 16:09:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:39:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:39:13', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16969
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:09:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:39:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:39:43', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16970
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-21 16:09:43";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:39:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:39:43', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16971
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:09:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:39:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:39:45', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16972
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:11:11";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:12:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:42:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:42:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16973
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:12:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:42:50', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16974
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:12:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:42:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 19:42:56', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=16975
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:44:02', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16976
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-21 16:14:02";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:44:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:44:02', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16977
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:44:04', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16978
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:44:24', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=16979
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:44:32', '1', 'delete', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=delete&id=34&action=0,0'); -- id=16980
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 4) and  modelid = 34;
UPDATE returnbuybill SET  returnbuybillsysdate = '2026-10-21 19:44:32', userid = '1',delbyuserid = '1', conditions = '1' WHERE returnbuybillid = '34';
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '772';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('772', '1', '15', '0', '34', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '19', '34', '1', '2026-10-21','0','0'); -- id=16230
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '-3150' , userid = '1', supplierdate = '2026-10-21 19:44:32'   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', '-3150.00', '3150', '0', 'حذف فاتورة مردودات مشتريات', '34', '0', '2026-10-21 19:44:32', '1', 'returnBuyBillController.php', 'حذف فاتورة مردودات مشتريات', '0','', '0','1','1','3150','1','-3150','0','-3150','0',''); -- id=827
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 ('-41945306.00','0', '1', '1', 'حذف فاتورة مردودات مشتريات', '34', '-41945306', '2026-10-21 19:44:32', '1',  'returnBuyBillController.php','0','','0'); -- id=1483
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:44:32', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=sucess'); -- id=16981
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:44:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=16982
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:14:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:44:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-21 19:44:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=16983
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:15:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:45:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:45:11', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16984
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:15:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:45:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:45:20', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16985
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:15:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:45:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 19:45:36', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=16986
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:06", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:46:06', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16987

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8e4a9c01a0
-- ----------------------------------------------------------------------------------------------------

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-21 19:46:06', '06ad8e4a9c01a0', '1', '0.00', '0', '0', '1', '1770.00', '1770', '1770', '0', '2', '2026-10-21 19:46:06', '', '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-21','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=1202
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','اضافة فاتورة مبيعات','1202', '0', '2026-10-21 19:46:06', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1770', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:46:06','0','0','',''); -- id=1427
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', '1202', '182', '2118', '6', '295', '1770', '0', '', '0', '2026-10-21 19:46:06', '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=4867
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 = 4867;
 INSERT INTO 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-21', 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-21', 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 = '15', userid = '4', storedetaildate = '2026-10-21 19:46:06' WHERE storedetailid = '3576';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2118', '2', '6', '1', '1202', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '4', '2026-10-21 19:46:06','0','0'); -- id=16231
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1175052.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 ('1173282.875','1770', '0', '3', 'اضافة فاتورة مبيعات', '1202', '1175052.875', '2026-10-21 19:46:06', '4',  'sellbillController.php','1','','0'); -- id=1484
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1770', '1770', '2026-10-21', '4', '0', '0', '2026-10-21 19:46:06','اضافة فاتورة مبيعات رقم 1202','1','0',null,'0','1202','sellbillController.php?do=showDetail&sellbillid=1202'); -- id=4244
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4244', '501', '1770', '','0'); -- id=4356
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1175052.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 ('4244', '143', '1770', '','0'); -- id=4246
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13532280', 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-21', '4', '0', '0', '2026-10-21 19:46:06','اضافة فاتورة مبيعات رقم 1202 - صرف البضاعة من المخزن','1','0',null,'0','1202','sellbillController.php?do=showDetail&sellbillid=1202'); -- id=4245
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4245', '402', '1593', '','0'); -- id=4357
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12520029.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 ('4245', '492', '1593', '','0'); -- id=4247
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1550894', 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='4244,0,4245' where sellbillid=1202;
 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-21', 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-21', 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 06ad8e4a9c01a0 and sellbillId = 1202 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:46:07', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16988
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:46:13', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=16989

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ebd41de11
-- ----------------------------------------------------------------------------------------------------

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-21 19:46:13', '06ad8ebd41de11', '1', '0.00', '0', '30', '1', '10080.00', '10050', '10050', '0', '1', '2026-10-21 19:46:13', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '27' ,'0','','','','','-1','0','0','0','0','0','10050','0','','0','0','10050','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1203
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','اضافة فاتورة مبيعات','1203', '0', '2026-10-21 19:46:13', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 19:46:13','0','0','',''); -- id=1428
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 902;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('372','01855', '1203', '144', '1855', '6', '400', '2400', '0', '', '0', '2026-10-21 19:46:13', '1855', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','902-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=4868
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 372.00, meanbuyprice_withDiscount = 372.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where sellbilldetailid = 4868;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1855, '2026-10-21', 2392.8571428571, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2392.8571428571, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , 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-21', 2392.8571428571, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2392.8571428571, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , 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 = '156', userid = '2', storedetaildate = '2026-10-21 19:46:13' WHERE storedetailid = '2872';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1855', '1', '6', '1', '1203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '162', '156', '2', '2026-10-21 19:46:13','0','0'); -- id=16232
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6847;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02308', '1203', '169', '2308', '9', '280', '2520', '0', '', '0', '2026-10-21 19:46:13', '2308', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6847-9,','1','1','0','0','280','2520','0','','0','0.00','0','0','0','0'); -- id=4869
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 130, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4869;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2308, '2026-10-21', 2512.5, 2340, 2340
                    , 2340, 2340, 2340, 2340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2340, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2512.5, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , 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+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-21', 2512.5, 2340, 2340
                    , 2340, 2340, 2340, 2340
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2340, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2512.5, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2340, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2340
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2340
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , 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 = '84', userid = '2', storedetaildate = '2026-10-21 19:46:13' WHERE storedetailid = '3701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2308', '1', '9', '1', '1203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '93', '84', '2', '2026-10-21 19:46:13','0','0'); -- id=16233
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', '1203', '147', '1884', '6', '460', '2760', '0', '', '0', '2026-10-21 19:46:13', '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=4870
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 = 4870;
 INSERT INTO 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-21', 2751.7857142857, 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+2751.7857142857, 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-21', 2751.7857142857, 2574, 2574
                    , 2574, 2574, 2574, 2574
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2574, 2574, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2751.7857142857, 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 = '186', userid = '2', storedetaildate = '2026-10-21 19:46:13' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '6', '1', '1203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '192', '186', '2', '2026-10-21 19:46:13','0','0'); -- id=16234
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6913;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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 ('368','01584', '1203', '115', '1584', '6', '400', '2400', '0', '', '0', '2026-10-21 19:46:13', '1584', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6913-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=4871
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 368.00, meanbuyprice_withDiscount = 368.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 368
                where sellbilldetailid = 4871;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1584, '2026-10-21', 2392.8571428571, 2400, 2400
                    , 2400, 2208, 2208, 2228.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2392.8571428571, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2228.34
                            , 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-21', 2392.8571428571, 2400, 2400
                    , 2400, 2208, 2208, 2228.34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2392.8571428571, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2228.34
                            , 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 = '33', userid = '2', storedetaildate = '2026-10-21 19:46:13' WHERE storedetailid = '1609';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1584', '1', '6', '1', '1203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '33', '2', '2026-10-21 19:46:13','0','0'); -- id=16235
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7494348.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 ('7484298.5','10050', '0', '2', 'اضافة فاتورة مبيعات', '1203', '7494348.5', '2026-10-21 19:46:13', '2',  'sellbillController.php','1','','0'); -- id=1485
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10080', '10080', '2026-10-21', '2', '0', '0', '2026-10-21 19:46:13','اضافة فاتورة مبيعات رقم 1203','1','0',null,'0','1203','sellbillController.php?do=showDetail&sellbillid=1203'); -- id=4246
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4246', '419', '10050', '','0'); -- id=4358
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7494348', 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 ('4246', '398', '30', '','0'); -- id=4359
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510259.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 ('4246', '143', '10080', '','0'); -- id=4248
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13542360', 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 ( '9354', '9354', '2026-10-21', '2', '0', '0', '2026-10-21 19:46:13','اضافة فاتورة مبيعات رقم 1203 - صرف البضاعة من المخزن','1','0',null,'0','1203','sellbillController.php?do=showDetail&sellbillid=1203'); -- id=4247
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4247', '402', '9354', '','0'); -- id=4360
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12529383.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 ('4247', '382', '9354', '','0'); -- id=4249
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25435273.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='4246,0,4247' where sellbillid=1203;
 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-21', 10050, 9714, 9714
                    , 9714, 9354, 9354, 9374.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9714, 8544, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10050, sellCostBuyPrice =sellCostBuyPrice+9714
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9714, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9714
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9354, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9354
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9374.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9714
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8544
                        , returnSellVal = returnSellVal+0, 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-21', 10050, 9714, 9714
                    , 9714, 9354, 9354, 9374.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9714, 8544, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10050, sellCostBuyPrice =sellCostBuyPrice+9714
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9714, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9714
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9354, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9354
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9374.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9714
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8544
                        , returnSellVal = returnSellVal+0, 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, 10050, 9714, 9714
                    , 9714, 9354, 9354, 9374.34, 9714, 8544)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10050, netSellCostBuyPrice = netSellCostBuyPrice+9714
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9714
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9714
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9354
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9354
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9374.34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9714
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8544;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ebd41de11 and sellbillId = 1203 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:46:13', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16990
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 19:46:24', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=16991
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 ('06ad8ec30f07d2', '2026-10-21 19:45:36', '169', '900.00', '81900', '0', '0', '81000.00',  '81000.00', '0', '81000', '1', '2026-10-21 19:46:24', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=305
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 ('01923', '305', '154', '1923', '180', '230', '41400.00', '0', '', '2026-10-21 19:46:24', '1923','','','0','0','0','0','0',null,'230','41400','0','0','0','0','0','0','0','0','1'); -- id=1689
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 19:45:36', 1, 1923, 0, 0
                    , 230, 180, 0, 0, 1, '2026-10-21 19:46:24')
                ON DUPLICATE KEY UPDATE buyprice = 230,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 19:46:24' ; -- id=7006
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1923', '230', '180', '0', 'buyBillController.php', '1689', '', '0', '0'); -- id=1242
UPDATE product SET  productBuyPrice = "230" WHERE productId = 1923 ;
UPDATE buybilldetail SET  quantitybefore = 28 WHERE buybilldetailid = 1689 ;
UPDATE product SET productName = 'زنط عادي 245', productDescription = '', productCatId = '154', productBuyPrice = '230.00', productSellAllPrice = '245.00', productSellUnitPrice = '245.00', productSellHalfPrice = '245.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01923',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '230',lastbuyprice_withDiscount = '230',meanbuyprice = '230',meanbuyprice_withDiscount = '230' , productbuypricereal = '230.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='230',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='230',meanbuyprice_withTax='230',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='230',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1923';
UPDATE buybilldetail SET  lastbuyprice = 230 , meanbuyprice = 230, lastbuyprice_withDiscount = 230, meanbuyprice_withDiscount = 230
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where buybilldetailid = 1689;
UPDATE productunit SET proUnitBuyPrice  = 230 * productnumber WHERE productid = 1923;
UPDATE storedetail SET  productquantity = '208', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '180', '0', '305', 'اضافة فاتورة مشتريات', 'buyBillController.php', '28', '208', '1', '2026-10-21 19:45:36','0','0'); -- id=16236
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 ('01924', '305', '154', '1924', '108', '275', '29700.00', '0', '', '2026-10-21 19:46:24', '1924','','','0','0','0','0','0',null,'275','29700','0','0','0','0','0','0','0','0','1'); -- id=1690
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 19:45:36', 1, 1924, 0, 0
                    , 275, 108, 0, 0, 1, '2026-10-21 19:46:24')
                ON DUPLICATE KEY UPDATE buyprice = 275,
                        buyQuantity =buyQuantity+108, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 19:46:24' ; -- id=7007
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1924', '275', '108', '0', 'buyBillController.php', '1690', '', '0', '0'); -- id=1243
UPDATE product SET  productBuyPrice = "275" WHERE productId = 1924 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1690 ;
UPDATE product SET productName = 'دبل زنط 295', productDescription = '', productCatId = '154', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '295.00', productSellHalfPrice = '295.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01924',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 = '1924';
UPDATE buybilldetail SET  lastbuyprice = 275 , meanbuyprice = 275, lastbuyprice_withDiscount = 275, meanbuyprice_withDiscount = 275
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where buybilldetailid = 1690;
UPDATE productunit SET proUnitBuyPrice  = 275 * productnumber WHERE productid = 1924;
UPDATE storedetail SET  productquantity = '168', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '108', '0', '305', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '168', '1', '2026-10-21 19:45:36','0','0'); -- id=16237
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 ('01924', '305', '154', '1924', '36', '275', '9900.00', '0', '', '2026-10-21 19:46:24', '1924','','','0','0','0','0','0',null,'275','9900','0','0','0','0','0','0','0','0','1'); -- id=1691
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 19:45:36', 1, 1924, 0, 0
                    , 275, 36, 0, 0, 1, '2026-10-21 19:46:24')
                ON DUPLICATE KEY UPDATE buyprice = 275,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 19:46:24' ; -- id=7007
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1924', '275', '36', '0', 'buyBillController.php', '1691', '', '0', '0'); -- id=1244
UPDATE product SET  productBuyPrice = "275" WHERE productId = 1924 ;
UPDATE buybilldetail SET  quantitybefore = 168 WHERE buybilldetailid = 1691 ;
UPDATE product SET productName = 'دبل زنط 295', productDescription = '', productCatId = '154', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '295.00', productSellHalfPrice = '295.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01924',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 = '1924';
UPDATE buybilldetail SET  lastbuyprice = 275 , meanbuyprice = 275, lastbuyprice_withDiscount = 275, meanbuyprice_withDiscount = 275
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where buybilldetailid = 1691;
UPDATE productunit SET proUnitBuyPrice  = 275 * productnumber WHERE productid = 1924;
UPDATE storedetail SET  productquantity = '204', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '36', '0', '305', 'اضافة فاتورة مشتريات', 'buyBillController.php', '168', '204', '1', '2026-10-21 19:45:36','0','0'); -- id=16238
UPDATE supplier SET  suppliercurrentDebt = '81900',suppliercurrentDebtInCurrency= '81900' , userid = '1', supplierdate = '2026-10-21 19:46:24'   WHERE supplierid = '169';
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 ('169', '900.00', '81000', '0', 'اضافة فاتورة مشتريات', '305', '81900', '2026-10-21 19:45:36', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','81000','1','900','81000','81900','0',''); -- id=828
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '81000', '81000', '2026-10-21', '1', '0', '0', '2026-10-21 19:46:24','اضافة فاتورة مشتريات رقم 305','1','0',null,'0','305','buyBillController.php?do=details&id=305'); -- id=4248
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4248', '382', '81000', '','0'); -- id=4361
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25516273.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4248', '652', '81000', '','0'); -- id=4250
UPDATE accountstree SET name = 'فيلو تيشيرت', customName = 'فيلو تيشيرت', customNameEn = 'فيلو تيشيرت', nameEn = 'فيلو تيشيرت', parent = '81', accountNature = '1', theValue = '81900', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-13 20:24:49' WHERE id = '652';
update buybill set dailyentryid='4248,0' where buybillid=305;
COMMIT;
UPDATE product SET overAllAveragePrice = 230 WHERE productId = 1923;UPDATE product SET overAllAveragePrice = 275 WHERE productId = 1924;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 19:46:24', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=305'); -- id=16992
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:16:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:46:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:46:28', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=305&type=2'); -- id=16993
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:18:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:48:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 19:48:25', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=16994
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:29:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:59:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 19:59:25', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=16995
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-21 16:29:25";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 19:59:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 19:59:25', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=16996
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:29:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 19:59:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 19:59:27', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=16997
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:30:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:00:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:00:42', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16998
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:30:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:00:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:00:53', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=16999
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:31:13";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:31:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:01:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 20:01:21', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=17000
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:32:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:02:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 20:02:17', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=17001
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:32:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:02:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:02:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17002
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:32:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:02:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:02:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17003
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:32:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:02:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 20:02:51', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=17004
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:33:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:03:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-21 20:03:05', '1', 'autosave', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=17005
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '2', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '16', '18', '1', '2026-10-21','0','0'); -- id=16239
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '460', '460', '2026-10-21', '1', '0', '0', '2026-10-21 20:03:05','اعادة جرد للمنتج : (تلبيس عادي استوب/استوب) فى مخزن : (المخزن الرئيسي) بالكمية : 18','1','0',null,'0','16239','inventoryController.php?do=details&id=16239'); -- id=4249
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4249', '382', '460', '','0'); -- id=4362
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25516733.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4249', '188', '460', '','0'); -- id=4251
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-3241910', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:33:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:03:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:03:26', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=17006

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ead160770
-- ----------------------------------------------------------------------------------------------------

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-21 20:03:26', '06ad8ead160770', '1', '0.00', '0', '0', '1', '128940.00', '128940', '128940', '0', '1', '2026-10-21 20:03:26', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '485' ,'0','','','','','-1','0','0','0','0','0','128940','0','','0','0','128940','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1204
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','اضافة فاتورة مبيعات','1204', '0', '2026-10-21 20:03:26', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '128940', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 20:03:26','0','0','',''); -- id=1429
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+63 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', '1204', '142', '1841', '63', '250', '15750', '0', '', '0', '2026-10-21 20:03:26', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-63,','1','1','0','0','250','15750','0','','0','0.00','0','0','0','0'); -- id=4872
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 = 4872;
 INSERT INTO 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15750, sellCostBuyPrice =sellCostBuyPrice+14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+63
                        , netQuantityRet = netQuantityRet+0;
 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15750, sellCostBuyPrice =sellCostBuyPrice+14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '181', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '63', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '244', '181', '2', '2026-10-21 20:03:26','0','0'); -- id=16240
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+28 where id = 1084;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+86 where id = 7006;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1204', '154', '1923', '114', '245', '27930', '0', '', '0', '2026-10-21 20:03:26', '1923', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1084-28,7006-86,','1','1','0','0','245','27930','0','','0','0.00','0','0','0','0'); -- id=4873
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 = 4873;
 INSERT INTO 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 114, 0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+27930, sellCostBuyPrice =sellCostBuyPrice+26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+114
                        , netQuantityRet = netQuantityRet+0;
 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+27930, sellCostBuyPrice =sellCostBuyPrice+26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '94', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '114', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '208', '94', '2', '2026-10-21 20:03:26','0','0'); -- id=16241
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+200 where id = 1000;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01906', '1204', '150', '1906', '200', '270', '54000', '0', '', '0', '2026-10-21 20:03:26', '1906', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1000-200,','1','1','0','0','270','54000','0','','0','0.00','0','0','0','0'); -- id=4874
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4874;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1906, '2026-10-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54000, sellCostBuyPrice =sellCostBuyPrice+50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+200
                        , netQuantityRet = netQuantityRet+0;
 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-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54000, sellCostBuyPrice =sellCostBuyPrice+50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '224', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '2923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1906', '1', '200', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '424', '224', '2', '2026-10-21 20:03:26','0','0'); -- id=16242
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 73;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01381', '1204', '94', '1381', '30', '295', '8850', '0', '', '0', '2026-10-21 20:03:26', '1381', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','73-30,','1','1','0','0','295','8850','0','','0','0.00','0','0','0','0'); -- id=4875
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 = 4875;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1381, '2026-10-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8850, sellCostBuyPrice =sellCostBuyPrice+7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8850, sellCostBuyPrice =sellCostBuyPrice+7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '114', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '1381';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1381', '1', '30', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '114', '2', '2026-10-21 20:03:26','0','0'); -- id=16243
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+60 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', '1204', '94', '1379', '60', '300', '18000', '0', '', '0', '2026-10-21 20:03:26', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-60,','1','1','0','0','300','18000','0','','0','0.00','0','0','0','0'); -- id=4876
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 = 4876;
 INSERT INTO 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18000, sellCostBuyPrice =sellCostBuyPrice+16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18000, sellCostBuyPrice =sellCostBuyPrice+16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '215', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '60', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '275', '215', '2', '2026-10-21 20:03:26','0','0'); -- id=16244
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 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', '1204', '190', '2175', '18', '245', '4410', '0', '', '0', '2026-10-21 20:03:26', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-16,','1','1','0','0','245','4410','0','','0','0.00','0','0','0','0'); -- id=4877
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 = 4877;
 INSERT INTO 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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, 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+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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, 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 = '0', userid = '2', storedetaildate = '2026-10-21 20:03:26' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '18', '1', '1204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '0', '2', '2026-10-21 20:03:26','0','0'); -- id=16245
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7623288.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 ('7494348.5','128940', '0', '2', 'اضافة فاتورة مبيعات', '1204', '7623288.5', '2026-10-21 20:03:26', '2',  'sellbillController.php','1','','0'); -- id=1486
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '128940', '128940', '2026-10-21', '2', '0', '0', '2026-10-21 20:03:26','اضافة فاتورة مبيعات رقم 1204','1','0',null,'0','1204','sellbillController.php?do=showDetail&sellbillid=1204'); -- id=4250
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4250', '419', '128940', '','0'); -- id=4363
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7623288', 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 ('4250', '143', '128940', '','0'); -- id=4252
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13671300', 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 ( '119165', '119165', '2026-10-21', '2', '0', '0', '2026-10-21 20:03:26','اضافة فاتورة مبيعات رقم 1204 - صرف البضاعة من المخزن','1','0',null,'0','1204','sellbillController.php?do=showDetail&sellbillid=1204'); -- id=4251
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4251', '402', '119165', '','0'); -- id=4364
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12648548.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 ('4251', '382', '119165', '','0'); -- id=4253
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25397568.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='4250,0,4251' where sellbillid=1204;
 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-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+128940, sellCostBuyPrice =sellCostBuyPrice+119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118850
                        , returnSellVal = returnSellVal+0, 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-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+128940, sellCostBuyPrice =sellCostBuyPrice+119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118850
                        , returnSellVal = returnSellVal+0, 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, 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165, 119165, 118850)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+128940, netSellCostBuyPrice = netSellCostBuyPrice+119165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+119165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+119165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+119165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+119165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+119165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+119165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+118850;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ead160770 and sellbillId = 1204 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:33:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:03:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:03:26', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17007
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:34:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:04:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 20:04:32', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17008
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-21 16:34:32";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 20:04:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 20:04:32', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:34:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:04:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:04:33', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17010
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:35:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:05:34", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-21 20:05:34', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=17011
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:39:36";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:41:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:11:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:11:32', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=17012

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8f0a189c32
-- ----------------------------------------------------------------------------------------------------

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-21 20:11:32', '06ad8f0a189c32', '1', '0.00', '0', '0', '1', '8100.00', '8100', '8100', '0', '1', '2026-10-21 20:11:32', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','8100','0','','0','0','8100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1205
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','اضافة فاتورة مبيعات','1205', '0', '2026-10-21 20:11:32', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8100', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 20:11:32','0','0','',''); -- id=1430
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 6799;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','02291', '1205', '203', '2291', '18', '450', '8100', '0', '', '0', '2026-10-21 20:11:32', '2291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6799-18,','1','1','0','0','450','8100','0','','0','0.00','0','0','0','0'); -- id=4878
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 = 4878;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2291, '2026-10-21', 8100, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8100, 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+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-21', 8100, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8100, 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 = '129', userid = '2', storedetaildate = '2026-10-21 20:11:32' WHERE storedetailid = '3684';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2291', '1', '18', '1', '1205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '147', '129', '2', '2026-10-21 20:11:32','0','0'); -- id=16246
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7631388.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 ('7623288.5','8100', '0', '2', 'اضافة فاتورة مبيعات', '1205', '7631388.5', '2026-10-21 20:11:32', '2',  'sellbillController.php','1','','0'); -- id=1487
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8100', '8100', '2026-10-21', '2', '0', '0', '2026-10-21 20:11:32','اضافة فاتورة مبيعات رقم 1205','1','0',null,'0','1205','sellbillController.php?do=showDetail&sellbillid=1205'); -- id=4252
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4252', '419', '8100', '','0'); -- id=4365
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7631388', 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 ('4252', '143', '8100', '','0'); -- id=4254
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13679400', 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 ( '7560', '7560', '2026-10-21', '2', '0', '0', '2026-10-21 20:11:32','اضافة فاتورة مبيعات رقم 1205 - صرف البضاعة من المخزن','1','0',null,'0','1205','sellbillController.php?do=showDetail&sellbillid=1205'); -- id=4253
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4253', '402', '7560', '','0'); -- id=4366
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12656108.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 ('4253', '382', '7560', '','0'); -- id=4255
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25390008.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='4252,0,4253' where sellbillid=1205;
 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-21', 8100, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8100, 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;
 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-21', 8100, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8100, 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 8100, 7560, 7560
                    , 7560, 7560, 7560, 7560, 7560, 7560)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8100, netSellCostBuyPrice = netSellCostBuyPrice+7560
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7560
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7560
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7560
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7560
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7560
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7560
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7560;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8f0a189c32 and sellbillId = 1205 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:41:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:11:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:11:32', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17013
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:43:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:13:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 20:13:35', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17014
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-21 16:43:35";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 20:13:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 20:13:35', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17015
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:43:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:13:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:13:36', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17016
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:43:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:13:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:13:46', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=17017

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad8ec55bdfcb
-- ----------------------------------------------------------------------------------------------------

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-21 20:13:46', '06ad8ec55bdfcb', '1', '0.00', '0', '35', '1', '11685.00', '11650', '11650', '0', '1', '2026-10-21 20:13:46', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '34' ,'0','','','','','-1','0','0','0','0','0','11650','0','','0','0','11650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-21','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=1206
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','اضافة فاتورة مبيعات','1206', '0', '2026-10-21 20:13:46', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 20:13:46','0','0','',''); -- id=1431
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', '1206', '173', '2199', '3', '470', '1410', '0', '', '0', '2026-10-21 20:13:46', '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=4879
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 = 4879;
 INSERT INTO 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-21', 1405.7766367137, 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+1405.7766367137, 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-21', 1405.7766367137, 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+1405.7766367137, 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 = '18', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '3568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2199', '1', '3', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '18', '2', '2026-10-21 20:13:46','0','0'); -- id=16247
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6708;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','07110', '1206', '40', '1129', '5', '295', '1475', '0', '', '0', '2026-10-21 20:13:46', '1129', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6708-5,','1','1','0','0','295','1475','0','','0','0.00','0','0','0','0'); -- id=4880
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 261.87, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 261.87
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 261.87, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4880;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1129, '2026-10-21', 1470.5819426615, 1250, 1250
                    , 1309.35, 1250, 1309.35, 1250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1250, 1309.35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470.5819426615, sellCostBuyPrice =sellCostBuyPrice+1250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1309.35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1309.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1309.35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1470.5819426615, 1250, 1250
                    , 1309.35, 1250, 1309.35, 1250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1250, 1309.35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470.5819426615, sellCostBuyPrice =sellCostBuyPrice+1250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1309.35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1309.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1309.35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1042', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '5', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1047', '1042', '2', '2026-10-21 20:13:46','0','0'); -- id=16248
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 6710;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','05291', '1206', '40', '1125', '15', '320', '4800', '0', '', '0', '2026-10-21 20:13:46', '1125', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6710-15,','1','1','0','0','320','4800','0','','0','0.00','0','0','0','0'); -- id=4881
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.32, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.32
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280.32, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 4881;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1125, '2026-10-21', 4785.622593068, 4200, 4200
                    , 4204.8, 4200, 4204.8, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4200, 4204.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4785.622593068, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4204.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4204.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4204.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+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-21', 4785.622593068, 4200, 4200
                    , 4204.8, 4200, 4204.8, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4200, 4204.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4785.622593068, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4204.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4204.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4204.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 = '712', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '1125';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '1', '15', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '727', '712', '2', '2026-10-21 20:13:46','0','0'); -- id=16249
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 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', '1206', '40', '1121', '5', '290', '1450', '0', '', '0', '2026-10-21 20:13:46', '1121', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6709-5,','1','1','0','0','290','1450','0','','0','0.00','0','0','0','0'); -- id=4882
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 = 4882;
 INSERT INTO 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-21', 1445.6568249893, 1300, 1300
                    , 1301.15, 1300, 1301.15, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1300, 1301.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1445.6568249893, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1301.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1301.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1301.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 1445.6568249893, 1300, 1300
                    , 1301.15, 1300, 1301.15, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1300, 1301.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1445.6568249893, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1301.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1301.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1301.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '644', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '1121';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1121', '1', '5', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '649', '644', '2', '2026-10-21 20:13:46','0','0'); -- id=16250
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', '1206', '173', '2197', '3', '460', '1380', '0', '', '0', '2026-10-21 20:13:46', '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=4883
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 = 4883;
 INSERT INTO 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-21', 1375.8664955071, 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+1375.8664955071, 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-21', 1375.8664955071, 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+1375.8664955071, 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 = '157', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '3566';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2197', '1', '3', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '160', '157', '2', '2026-10-21 20:13:46','0','0'); -- id=16251
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 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', '1206', '94', '1380', '3', '390', '1170', '0', '', '0', '2026-10-21 20:13:46', '1380', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','72-3,','1','1','0','0','390','1170','0','','0','0.00','0','0','0','0'); -- id=4884
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 = 4884;
 INSERT INTO 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-21', 1166.4955070603, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1166.4955070603, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-21', 1166.4955070603, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1166.4955070603, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '379', userid = '2', storedetaildate = '2026-10-21 20:13:46' WHERE storedetailid = '1380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1380', '1', '3', '1', '1206', 'اضافة فاتورة مبيعات', 'sellbillController.php', '382', '379', '2', '2026-10-21 20:13:46','0','0'); -- id=16252
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7643038.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 ('7631388.5','11650', '0', '2', 'اضافة فاتورة مبيعات', '1206', '7643038.5', '2026-10-21 20:13:46', '2',  'sellbillController.php','1','','0'); -- id=1488
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11685', '11685', '2026-10-21', '2', '0', '0', '2026-10-21 20:13:46','اضافة فاتورة مبيعات رقم 1206','1','0',null,'0','1206','sellbillController.php?do=showDetail&sellbillid=1206'); -- id=4254
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4254', '419', '11650', '','0'); -- id=4367
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7643038', 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 ('4254', '398', '35', '','0'); -- id=4368
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510294.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 ('4254', '143', '11685', '','0'); -- id=4256
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13691085', 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 ( '10366.8', '10366.8', '2026-10-21', '2', '0', '0', '2026-10-21 20:13:46','اضافة فاتورة مبيعات رقم 1206 - صرف البضاعة من المخزن','1','0',null,'0','1206','sellbillController.php?do=showDetail&sellbillid=1206'); -- id=4255
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4255', '402', '10366.8', '','0'); -- id=4369
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12666475.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 ('4255', '382', '10366.8', '','0'); -- id=4257
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25379641.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='4254,0,4255' where sellbillid=1206;
 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-21', 11650, 10590, 10590
                    , 10655.3, 10366.8, 10432.1, 10366.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10590, 10655.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11650, sellCostBuyPrice =sellCostBuyPrice+10590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10655.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10366.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10432.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10366.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10655.3
                        , returnSellVal = returnSellVal+0, 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-21', 11650, 10590, 10590
                    , 10655.3, 10366.8, 10432.1, 10366.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10590, 10655.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11650, sellCostBuyPrice =sellCostBuyPrice+10590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10655.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10366.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10432.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10366.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10590
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10655.3
                        , returnSellVal = returnSellVal+0, 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, 11650, 10590, 10590
                    , 10655.3, 10366.8, 10432.1, 10366.8, 10590, 10655.3)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11650, netSellCostBuyPrice = netSellCostBuyPrice+10590
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10590
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10655.3
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+10366.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+10432.1
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+10366.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10590
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+10655.3;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad8ec55bdfcb and sellbillId = 1206 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:43:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:13:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:13:46', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17018
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:51:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:21:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:21:58', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=17019
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:52:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:22:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 20:22:05', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17020
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-21 16:52:05";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 20:22:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 20:22:05', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17021
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:52:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:22:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:22:06', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17022
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:52:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:22:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:22:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=17023
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:52:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:22:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:22:45', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=302'); -- id=17024
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:23:05', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=17025
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:23:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17026
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 20:23:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=17027
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:23:29', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 20:23:31', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=17029
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:53:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:23:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:23:33', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17030
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:55:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:25:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:25:57', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:26:03', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17032
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:26:10', '1', 'edit', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=edit&id=167'); -- id=17033
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:26:19', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=update'); -- id=17034
UPDATE accountstree SET name = 'ذا بيست مصطفي تي شيرت', customName = 'ذا بيست مصطفي تي شيرت', customNameEn = '', nameEn = '', parent = '81', accountNature = '1', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-21 20:26:19' WHERE id = '650';
UPDATE client SET linkedSupplierId = 0 WHERE linkedSupplierId = 167;
UPDATE supplier SET suppliername = 'ذا بيست مصطفي تي شيرت', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-21 20:26:19', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='650',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '167';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:26:20', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=17035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-21 20:26:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=17036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:56:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:26:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:26:54', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=17037
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:57:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:27:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:27:01', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=304'); -- id=17038
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:57:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:27:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:27:09', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=17039
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 304;
UPDATE buybill SET  buybillsysdate = '2026-10-21 20:27:09', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '304';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2368, 0, 0
                    , 470, 40, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7002
UPDATE buybilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 470.00
        , lastbuyprice_withTax = 470.00, meanbuyprice_withTax = 470.00, lastbuyprice_withDiscountAndTax = 470.00
                where buybilldetailid = 1685;
UPDATE product SET productName = 'موديل 485 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '0',meanbuyprice = '470.00',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.19' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',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 = '2368';
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2368;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2368', '1', '40', '1', '304', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '40', '0', '1', '2026-10-21 18:42:12','0','0'); -- id=16253
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2369, 0, 0
                    , 455, 24, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7003
UPDATE buybilldetail SET  lastbuyprice = 455.00 , meanbuyprice = 455.00, lastbuyprice_withDiscount = 455.00, meanbuyprice_withDiscount = 455.00
        , lastbuyprice_withTax = 455.00, meanbuyprice_withTax = 455.00, lastbuyprice_withDiscountAndTax = 455.00
                where buybilldetailid = 1686;
UPDATE product SET productName = 'موديل 470 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '0',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='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 = '2369';
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 2369;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2369', '1', '24', '1', '304', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-21 18:42:12','0','0'); -- id=16254
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2370, 0, 0
                    , 355, 32, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7004
UPDATE buybilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355.00, meanbuyprice_withTax = 355.00, lastbuyprice_withDiscountAndTax = 355.00
                where buybilldetailid = 1687;
UPDATE product SET productName = 'موديل 370 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '0',meanbuyprice = '355.00',meanbuyprice_withDiscount = '355' , productbuypricereal = '355.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',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 = '2370';
UPDATE productunit SET proUnitBuyPrice  = 355 * productnumber WHERE productid = 2370;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2370', '1', '32', '1', '304', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '32', '0', '1', '2026-10-21 18:42:12','0','0'); -- id=16255
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2371, 0, 0
                    , 360, 20, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7005
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 360.00
                where buybilldetailid = 1688;
UPDATE product SET productName = 'شروال تطريز ذا بيست', productDescription = '', productCatId = '69', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '0',meanbuyprice = '360.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.17' , 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='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 = '2371';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2371;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2371', '1', '20', '1', '304', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '20', '0', '1', '2026-10-21 18:42:12','0','0'); -- id=16256
UPDATE supplier SET  suppliercurrentDebt = '63000',suppliercurrentDebtInCurrency= '63000' , userid = '1', supplierdate = '2026-10-21 20:27:09'   WHERE supplierid = '149';
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 ('149', '111280.00', '48280.00', '1', 'حذف فاتورة مشتريات - للتعديل', '304', '63000', '2026-10-21 18:42:12', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','48280','1','111280','48280','63000','0',''); -- id=829
UPDATE productserial SET del = 1
		 WHERE billid = 304;
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 ('06ad8dd54c03f7', '2026-10-21 18:42:12', '167', '0.00', '48280', '0', '0', '48280.00', '48280.00', '0.00', '48280', '1', '2026-10-21 20:27:09', '', '1', '0', '', '1', '1','1','304','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=306
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 ('02368', '306', '206', '2368', '40.00', '470', '18800.00', '0.00', '', '2026-10-21 20:27:09', '2368','','','0','0','0','0','0',null,'470','18800','0','0','0','0','0','0','0','0','1'); -- id=1692
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2368, 0, 0
                    , 470, 40, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7002
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2368 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1692 ;
UPDATE product SET productName = 'موديل 485 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '470.00', productSellAllPrice = '485.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.19' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='235',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2368';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 1692;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2368;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3762';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2368', '1', '40', '0', '306', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-21 18:42:12','0','0'); -- id=16257
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 ('02369', '306', '206', '2369', '24.00', '455', '10920.00', '0.00', '', '2026-10-21 20:27:09', '2369','','','0','0','0','0','0',null,'455','10920','0','0','0','0','0','0','0','0','1'); -- id=1693
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2369, 0, 0
                    , 455, 24, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 455,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7003
UPDATE product SET  productBuyPrice = "455" WHERE productId = 2369 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1693 ;
UPDATE product SET productName = 'موديل 470 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02369',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='227.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='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 = '2369';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 455, lastbuyprice_withDiscount = 455, meanbuyprice_withDiscount = 455
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 227.5, lastbuyprice_withDiscountAndTax = 455
                where buybilldetailid = 1693;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 2369;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3763';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2369', '1', '24', '0', '306', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 18:42:12','0','0'); -- id=16258
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 ('02370', '306', '206', '2370', '32.00', '355', '11360.00', '0.00', '', '2026-10-21 20:27:09', '2370','','','0','0','0','0','0',null,'355','11360','0','0','0','0','0','0','0','0','1'); -- id=1694
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2370, 0, 0
                    , 355, 32, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 355,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7004
UPDATE product SET  productBuyPrice = "355" WHERE productId = 2370 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1694 ;
UPDATE product SET productName = 'موديل 370 ذا بيست', productDescription = '', productCatId = '206', productBuyPrice = '355.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '355',lastbuyprice_withDiscount = '355',meanbuyprice = '355',meanbuyprice_withDiscount = '355' , productbuypricereal = '355.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='355',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='355',meanbuyprice_withTax='177.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='355',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2370';
UPDATE buybilldetail SET  lastbuyprice = 355 , meanbuyprice = 355, lastbuyprice_withDiscount = 355, meanbuyprice_withDiscount = 355
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 177.5, lastbuyprice_withDiscountAndTax = 355
                where buybilldetailid = 1694;
UPDATE productunit SET proUnitBuyPrice  = 355 * productnumber WHERE productid = 2370;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3764';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2370', '1', '32', '0', '306', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-21 18:42:12','0','0'); -- id=16259
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 ('02371', '306', '69', '2371', '20.00', '360', '7200.00', '0.00', '', '2026-10-21 20:27:09', '2371','','','0','0','0','0','0',null,'360','7200','0','0','0','0','0','0','0','0','1'); -- id=1695
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 18:42:12', 1, 2371, 0, 0
                    , 360, 20, 0, 0, 1, '2026-10-21 20:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:27:09' ; -- id=7005
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2371 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1695 ;
UPDATE product SET productName = 'شروال تطريز ذا بيست', productDescription = '', productCatId = '69', productBuyPrice = '360.00', productSellAllPrice = '375.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02371',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 = '4.17' , 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='180',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 = '2371';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1695;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2371;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3765';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2371', '1', '20', '0', '306', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-21 18:42:12','0','0'); -- id=16260
DELETE FROM productserial WHERE billid = 304
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '48280',suppliercurrentDebtInCurrency= '48280' , userid = '1', supplierdate = '2026-10-21 20:27:09'   WHERE supplierid = '167';
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 ('167', '0.00', '48280', '0', 'اضافة فاتورة مشتريات', '306', '48280', '2026-10-21 20:27:09', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','48280','1','0','48280','48280','0',''); -- id=830
UPDATE dailyentry SET totalcreditor = '48280.00', totaldebtor = '48280.00', thedate = '2026-10-21', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 18:43:09', entryComment = 'اضافة فاتورة مشتريات رقم 304', fromFlag = '1',related='0',isopeningentry='0',operationId='304',operationDetailLink='buyBillController.php?do=details&id=304' WHERE id = '4233';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '48280.00', '48280.00', '2026-10-21', '1', '0', '4233', '2026-10-21 20:27:09','تم عكس القيد رقم 4233 ','1','0','0','0','0',''); -- id=4256
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4256', '382', '48280.00', '','0'); -- id=4258
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25331361.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';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4256', '632', '48280.00', '','0'); -- id=4370
UPDATE accountstree SET name = 'ذا بست - مورد', customName = 'ذا بست - مورد', customNameEn = 'ذا بست - مورد', nameEn = 'ذا بست - مورد', parent = '81', accountNature = '1', theValue = '63000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:36:45' WHERE id = '632';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '48280', '48280', '2026-10-21', '1', '0', '0', '2026-10-21 20:27:09','اضافة فاتورة مشتريات رقم 306','1','0',null,'0','306','buyBillController.php?do=details&id=306'); -- id=4257
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4257', '382', '48280', '','0'); -- id=4371
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25379641.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';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4257', '650', '48280', '','0'); -- id=4259
UPDATE accountstree SET name = 'ذا بيست مصطفي تي شيرت', customName = 'ذا بيست مصطفي تي شيرت', customNameEn = '', nameEn = '', parent = '81', accountNature = '1', theValue = '48280', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-21 20:26:19' WHERE id = '650';
update buybill set dailyentryid='4257,0' where buybillid=306;
UPDATE product SET overAllAveragePrice = 470 WHERE productId = 2368;UPDATE product SET overAllAveragePrice = 455 WHERE productId = 2369;UPDATE product SET overAllAveragePrice = 355 WHERE productId = 2370;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2371;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 16:57:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:27:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:27:09', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=306'); -- id=17040
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:06:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:36:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:36:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17041
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:06:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:36:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:36:50', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17042
UPDATE product SET productName = 'كود 901 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01518',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '495',meanbuyprice = '550.00',meanbuyprice_withDiscount = '495' , productbuypricereal = '550.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='495',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='550',meanbuyprice_withTax='550',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='495',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1518';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1518, 1,'2026-10-21 20:37:47',1)
                ON DUPLICATE KEY UPDATE productid = 1518, edited = 1, sysdate = '2026-10-21 20:37:47', userid = 1; -- id=2312
UPDATE product SET productName = 'كود 902 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01519',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '333',meanbuyprice = '370.00',meanbuyprice_withDiscount = '333' , productbuypricereal = '370.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='333',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='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1519';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1519, 1,'2026-10-21 20:37:54',1)
                ON DUPLICATE KEY UPDATE productid = 1519, edited = 1, sysdate = '2026-10-21 20:37:54', userid = 1; -- id=2313
UPDATE product SET productName = 'كود 903 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01520',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '427.5',meanbuyprice = '475.00',meanbuyprice_withDiscount = '427.5' , productbuypricereal = '475.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='427.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='475',meanbuyprice_withTax='475',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='427.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 = '1520';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1520, 1,'2026-10-21 20:37:57',1)
                ON DUPLICATE KEY UPDATE productid = 1520, edited = 1, sysdate = '2026-10-21 20:37:57', userid = 1; -- id=2314
UPDATE product SET productName = 'كود 904 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '420.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01521',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '378',meanbuyprice = '420.00',meanbuyprice_withDiscount = '378' , productbuypricereal = '420.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='378',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='378',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1521';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1521, 1,'2026-10-21 20:38:11',1)
                ON DUPLICATE KEY UPDATE productid = 1521, edited = 1, sysdate = '2026-10-21 20:38:11', userid = 1; -- id=2315
UPDATE product SET productName = 'كود 907 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01522',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '427.5',meanbuyprice = '475.00',meanbuyprice_withDiscount = '427.5' , productbuypricereal = '475.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='427.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='475',meanbuyprice_withTax='475',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='427.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 = '1522';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1522, 1,'2026-10-21 20:38:15',1)
                ON DUPLICATE KEY UPDATE productid = 1522, edited = 1, sysdate = '2026-10-21 20:38:15', userid = 1; -- id=2316
UPDATE product SET productName = 'كود 908 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01523',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400.00',lastbuyprice_withDiscount = '360',meanbuyprice = '400.00',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='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='400',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 = '1523';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1523, 1,'2026-10-21 20:38:21',1)
                ON DUPLICATE KEY UPDATE productid = 1523, edited = 1, sysdate = '2026-10-21 20:38:21', userid = 1; -- id=2317
UPDATE product SET productName = 'كود 909 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '465.00', productSellAllPrice = '465.00', productSellUnitPrice = '465.00', productSellHalfPrice = '465.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01524',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '465.00',lastbuyprice_withDiscount = '418.5',meanbuyprice = '465.00',meanbuyprice_withDiscount = '418.5' , productbuypricereal = '465.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='418.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='465',meanbuyprice_withTax='465',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='418.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 = '1524';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1524, 1,'2026-10-21 20:38:24',1)
                ON DUPLICATE KEY UPDATE productid = 1524, edited = 1, sysdate = '2026-10-21 20:38:24', userid = 1; -- id=2318
UPDATE product SET productName = 'كود 911 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01525',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '405',meanbuyprice = '450.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1525';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1525, 1,'2026-10-21 20:38:26',1)
                ON DUPLICATE KEY UPDATE productid = 1525, edited = 1, sysdate = '2026-10-21 20:38:26', userid = 1; -- id=2319
UPDATE product SET productName = 'كود 911', productDescription = '', productCatId = '111', productBuyPrice = '385.00', productSellAllPrice = '385.00', productSellUnitPrice = '385.00', productSellHalfPrice = '385.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01526',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385.00',lastbuyprice_withDiscount = '346.5',meanbuyprice = '385.00',meanbuyprice_withDiscount = '346.5' , productbuypricereal = '385.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='346.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='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='346.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 = '1526';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1526, 1,'2026-10-21 20:38:27',1)
                ON DUPLICATE KEY UPDATE productid = 1526, edited = 1, sysdate = '2026-10-21 20:38:27', userid = 1; -- id=2320
UPDATE product SET productName = 'كود 910 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01525',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '405',meanbuyprice = '450.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1525';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1525, 1,'2026-10-21 20:38:30',1)
                ON DUPLICATE KEY UPDATE productid = 1525, edited = 1, sysdate = '2026-10-21 20:38:30', userid = 1; -- id=2319
UPDATE product SET productName = 'كود 911 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '385.00', productSellAllPrice = '385.00', productSellUnitPrice = '385.00', productSellHalfPrice = '385.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01526',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385.00',lastbuyprice_withDiscount = '346.5',meanbuyprice = '385.00',meanbuyprice_withDiscount = '346.5' , productbuypricereal = '385.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='346.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='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='346.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 = '1526';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1526, 1,'2026-10-21 20:38:33',1)
                ON DUPLICATE KEY UPDATE productid = 1526, edited = 1, sysdate = '2026-10-21 20:38:33', userid = 1; -- id=2320
UPDATE product SET productName = 'كود 912 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01527',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495.00',lastbuyprice_withDiscount = '445.5',meanbuyprice = '495.00',meanbuyprice_withDiscount = '445.5' , productbuypricereal = '495.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='445.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='495',meanbuyprice_withTax='495',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='445.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 = '1527';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1527, 1,'2026-10-21 20:38:35',1)
                ON DUPLICATE KEY UPDATE productid = 1527, edited = 1, sysdate = '2026-10-21 20:38:35', userid = 1; -- id=2321
UPDATE product SET productName = 'كود 913 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '455.00', productSellAllPrice = '455.00', productSellUnitPrice = '455.00', productSellHalfPrice = '455.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01528',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '409.5',meanbuyprice = '455.00',meanbuyprice_withDiscount = '409.5' , productbuypricereal = '455.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='409.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='455',meanbuyprice_withTax='455',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='409.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 = '1528';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1528, 1,'2026-10-21 20:38:39',1)
                ON DUPLICATE KEY UPDATE productid = 1528, edited = 1, sysdate = '2026-10-21 20:38:39', userid = 1; -- id=2322
UPDATE product SET productName = 'كود 914 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01529',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450.00',lastbuyprice_withDiscount = '405',meanbuyprice = '450.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='0',weightedDiscount='0',sortby='0',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1529';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1529, 1,'2026-10-21 20:38:41',1)
                ON DUPLICATE KEY UPDATE productid = 1529, edited = 1, sysdate = '2026-10-21 20:38:41', userid = 1; -- id=2323
UPDATE product SET productName = 'كود 915 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '445.00', productSellAllPrice = '445.00', productSellUnitPrice = '445.00', productSellHalfPrice = '445.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01530',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '445.00',lastbuyprice_withDiscount = '400.5',meanbuyprice = '445.00',meanbuyprice_withDiscount = '400.5' , productbuypricereal = '445.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.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='445',meanbuyprice_withTax='445',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='400.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 = '1530';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1530, 1,'2026-10-21 20:38:48',1)
                ON DUPLICATE KEY UPDATE productid = 1530, edited = 1, sysdate = '2026-10-21 20:38:48', userid = 1; -- id=2324
UPDATE product SET productName = 'كود 916 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '455.00', productSellAllPrice = '455.00', productSellUnitPrice = '455.00', productSellHalfPrice = '455.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01531',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '409.5',meanbuyprice = '455.00',meanbuyprice_withDiscount = '409.5' , productbuypricereal = '455.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='409.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='455',meanbuyprice_withTax='455',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='409.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 = '1531';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1531, 1,'2026-10-21 20:38:51',1)
                ON DUPLICATE KEY UPDATE productid = 1531, edited = 1, sysdate = '2026-10-21 20:38:51', userid = 1; -- id=2325
UPDATE product SET productName = 'كود 917 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01532',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '427.5',meanbuyprice = '475.00',meanbuyprice_withDiscount = '427.5' , productbuypricereal = '475.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='427.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='475',meanbuyprice_withTax='475',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='427.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 = '1532';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1532, 1,'2026-10-21 20:38:53',1)
                ON DUPLICATE KEY UPDATE productid = 1532, edited = 1, sysdate = '2026-10-21 20:38:53', userid = 1; -- id=2326
UPDATE product SET productName = 'كود 918 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '415.00', productSellAllPrice = '415.00', productSellUnitPrice = '415.00', productSellHalfPrice = '415.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01533',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415.00',lastbuyprice_withDiscount = '373.5',meanbuyprice = '415.00',meanbuyprice_withDiscount = '373.5' , productbuypricereal = '415.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='373.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='415',meanbuyprice_withTax='415',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='373.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 = '1533';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1533, 1,'2026-10-21 20:38:57',1)
                ON DUPLICATE KEY UPDATE productid = 1533, edited = 1, sysdate = '2026-10-21 20:38:57', userid = 1; -- id=2327
UPDATE product SET productName = 'كود 919 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01534',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360.00',lastbuyprice_withDiscount = '324',meanbuyprice = '360.00',meanbuyprice_withDiscount = '324' , 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='324',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='324',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1534';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1534, 1,'2026-10-21 20:39:19',1)
                ON DUPLICATE KEY UPDATE productid = 1534, edited = 1, sysdate = '2026-10-21 20:39:19', userid = 1; -- id=2328
UPDATE product SET productName = 'كود 920 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '415.00', productSellAllPrice = '415.00', productSellUnitPrice = '415.00', productSellHalfPrice = '415.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01535',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415.00',lastbuyprice_withDiscount = '373.5',meanbuyprice = '415.00',meanbuyprice_withDiscount = '373.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='373.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',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='415',meanbuyprice_withTax='415',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='373.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 = '1535';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1535, 1,'2026-10-21 20:39:21',1)
                ON DUPLICATE KEY UPDATE productid = 1535, edited = 1, sysdate = '2026-10-21 20:39:21', userid = 1; -- id=2329
UPDATE product SET productName = 'كود 921 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '415.00', productSellAllPrice = '415.00', productSellUnitPrice = '415.00', productSellHalfPrice = '415.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01536',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415.00',lastbuyprice_withDiscount = '373.5',meanbuyprice = '415.00',meanbuyprice_withDiscount = '373.5' , productbuypricereal = '415.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='373.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='415',meanbuyprice_withTax='415',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='373.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 = '1536';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1536, 1,'2026-10-21 20:39:24',1)
                ON DUPLICATE KEY UPDATE productid = 1536, edited = 1, sysdate = '2026-10-21 20:39:24', userid = 1; -- id=2330
UPDATE product SET productName = 'كود 922 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01537',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495.00',lastbuyprice_withDiscount = '445.5',meanbuyprice = '495.00',meanbuyprice_withDiscount = '445.5' , productbuypricereal = '495.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='445.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='495',meanbuyprice_withTax='495',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='445.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 = '1537';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1537, 1,'2026-10-21 20:39:28',1)
                ON DUPLICATE KEY UPDATE productid = 1537, edited = 1, sysdate = '2026-10-21 20:39:28', userid = 1; -- id=2331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:10:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:40:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:40:33', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:12:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:42:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:42:25', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=17044
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 ('موديل 932 الحريف','','111','430','430','0','0','2026-10-21','0','1','0','','0','0','0','0','0','430','430','430','430','430','0','0','0','0','.','0','0','0','430','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','430','430','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','430','0','0','0','0','0','0','','','0','0','0','0'); -- id=2372
UPDATE product SET productName = 'موديل 932 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '430', productSellAllPrice = '430', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',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='430',meanbuyprice_withTax='430',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='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2372';
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', '2372', '1.00', '2026-10-21', '1', '0','0237201','430','0','0','430','','0','0','0','0','0','0','0','0','0','0'); -- id=2372
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2372', '1', '0', '1', '2026-10-21'); -- id=3766
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2372', '1', '0', '0', '2372', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16261
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2372, 1,'2026-10-21 20:42:25',1)
                ON DUPLICATE KEY UPDATE productid = 2372, edited = 1, sysdate = '2026-10-21 20:42:25', userid = 1; -- id=3546
UPDATE product SET productName = 'موديل 932 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '430.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',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='430',meanbuyprice_withTax='430',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='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2372';
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 ('موديل 931 الحريف','','111','450','450','0','0','2026-10-21','0','1','0','','0','0','0','0','0','450','450','450','450','450','0','0','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=2373
UPDATE product SET productName = 'موديل 931 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450', productSellAllPrice = '450', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02373',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 = '0' , 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 = '2373';
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', '2373', '1.00', '2026-10-21', '1', '0','0237301','450','0','0','450','','0','0','0','0','0','0','0','0','0','0'); -- id=2373
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2373', '1', '0', '1', '2026-10-21'); -- id=3767
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2373', '1', '0', '0', '2373', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16262
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2373, 1,'2026-10-21 20:42:25',1)
                ON DUPLICATE KEY UPDATE productid = 2373, edited = 1, sysdate = '2026-10-21 20:42:25', userid = 1; -- id=3547
UPDATE product SET productName = 'موديل 931 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02373',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 = '0' , 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 = '2373';
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 ('موديل 930 الحريف','','111','370','370','0','0','2026-10-21','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','0','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=2374
UPDATE product SET productName = 'موديل 930 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '370', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02374',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 = '0' , 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 = '2374';
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', '2374', '1.00', '2026-10-21', '1', '0','0237401','370','0','0','370','','0','0','0','0','0','0','0','0','0','0'); -- id=2374
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2374', '1', '0', '1', '2026-10-21'); -- id=3768
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2374', '1', '0', '0', '2374', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16263
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2374, 1,'2026-10-21 20:42:25',1)
                ON DUPLICATE KEY UPDATE productid = 2374, edited = 1, sysdate = '2026-10-21 20:42:25', userid = 1; -- id=3548
UPDATE product SET productName = 'موديل 930 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02374',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 = '0' , 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 = '2374';
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 ('موديل 929 الحريف','','111','460','460','0','0','2026-10-21','0','1','0','','0','0','0','0','0','460','460','460','460','460','0','0','0','0','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=2375
UPDATE product SET productName = 'موديل 929 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '460', productSellAllPrice = '460', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2375';
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', '2375', '1.00', '2026-10-21', '1', '0','0237501','460','0','0','460','','0','0','0','0','0','0','0','0','0','0'); -- id=2375
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2375', '1', '0', '1', '2026-10-21'); -- id=3769
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2375', '1', '0', '0', '2375', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16264
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2375, 1,'2026-10-21 20:42:25',1)
                ON DUPLICATE KEY UPDATE productid = 2375, edited = 1, sysdate = '2026-10-21 20:42:25', userid = 1; -- id=3549
UPDATE product SET productName = 'موديل 929 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='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 = '2375';
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 ('موديل 933 الحريف','','111','495','495','0','0','2026-10-21','0','1','0','','0','0','0','0','0','495','495','495','495','495','0','0','0','0','.','0','0','0','495','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','495','495','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','495','0','0','0','0','0','0','','','0','0','0','0'); -- id=2376
UPDATE product SET productName = 'موديل 933 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '495', productSellAllPrice = '495', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',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='495',meanbuyprice_withTax='495',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='495',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2376';
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', '2376', '1.00', '2026-10-21', '1', '0','0237601','495','0','0','495','','0','0','0','0','0','0','0','0','0','0'); -- id=2376
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2376', '1', '0', '1', '2026-10-21'); -- id=3770
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2376', '1', '0', '0', '2376', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16265
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2376, 1,'2026-10-21 20:42:25',1)
                ON DUPLICATE KEY UPDATE productid = 2376, edited = 1, sysdate = '2026-10-21 20:42:25', userid = 1; -- id=3550
UPDATE product SET productName = 'موديل 933 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '495',meanbuyprice = '495',meanbuyprice_withDiscount = '495' , productbuypricereal = '495' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='495',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='495',meanbuyprice_withTax='495',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='495',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2376';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:12:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:42:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:42:29', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:12:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:42:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:42:33', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=17046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:14:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:44:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:44:14', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=17047
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 ('06ad8f9898e7d9', '2026-10-21 20:42:33', '105', '410651.00', '466651.4', '8', '1', '60870.00',  '56000.40', '0', '56000.4', '1', '2026-10-21 20:44:14', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=307
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 ('02372', '307', '111', '2372', '24', '430', '10320.00', '0', '', '2026-10-21 20:44:14', '2372','','','0','0','0','0','0',null,'430','10320','0','0','0','0','0','0','0','0','1'); -- id=1696
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 20:42:33', 1, 2372, 0, 0
                    , 395.6, 24, 0, 0, 1, '2026-10-21 20:44:14')
                ON DUPLICATE KEY UPDATE buyprice = 395.6,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:44:14' ; -- id=7017
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2372', '430', '24', '0', 'buyBillController.php', '1696', '', '0', '0'); -- id=1245
UPDATE product SET  productBuyPrice = "430" WHERE productId = 2372 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1696 ;
UPDATE product SET productName = 'موديل 932 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '430.00', productSellAllPrice = '430.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '395.6',meanbuyprice = '430',meanbuyprice_withDiscount = '395.6' , productbuypricereal = '430.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='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='395.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 = '2372';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 395.6, meanbuyprice_withDiscount = 395.6
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 395.6
                where buybilldetailid = 1696;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 2372;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3766';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2372', '1', '24', '0', '307', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 20:42:33','0','0'); -- id=16266
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 ('02373', '307', '111', '2373', '24', '450', '10800.00', '0', '', '2026-10-21 20:44:14', '2373','','','0','0','0','0','0',null,'450','10800','0','0','0','0','0','0','0','0','1'); -- id=1697
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 20:42:33', 1, 2373, 0, 0
                    , 414, 24, 0, 0, 1, '2026-10-21 20:44:14')
                ON DUPLICATE KEY UPDATE buyprice = 414,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:44:14' ; -- id=7018
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2373', '450', '24', '0', 'buyBillController.php', '1697', '', '0', '0'); -- id=1246
UPDATE product SET  productBuyPrice = "450" WHERE productId = 2373 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1697 ;
UPDATE product SET productName = 'موديل 931 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02373',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '414',meanbuyprice = '450',meanbuyprice_withDiscount = '414' , productbuypricereal = '450.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='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='414',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2373';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 414, meanbuyprice_withDiscount = 414
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 414
                where buybilldetailid = 1697;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 2373;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3767';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2373', '1', '24', '0', '307', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 20:42:33','0','0'); -- id=16267
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 ('02374', '307', '111', '2374', '30', '370', '11100.00', '0', '', '2026-10-21 20:44:14', '2374','','','0','0','0','0','0',null,'370','11100','0','0','0','0','0','0','0','0','1'); -- id=1698
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 20:42:33', 1, 2374, 0, 0
                    , 340.4, 30, 0, 0, 1, '2026-10-21 20:44:14')
                ON DUPLICATE KEY UPDATE buyprice = 340.4,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:44:14' ; -- id=7019
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2374', '370', '30', '0', 'buyBillController.php', '1698', '', '0', '0'); -- id=1247
UPDATE product SET  productBuyPrice = "370" WHERE productId = 2374 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1698 ;
UPDATE product SET productName = 'موديل 930 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02374',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '340.4',meanbuyprice = '370',meanbuyprice_withDiscount = '340.4' , productbuypricereal = '370.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='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='340.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 = '2374';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 340.4, meanbuyprice_withDiscount = 340.4
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 340.4
                where buybilldetailid = 1698;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 2374;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3768';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2374', '1', '30', '0', '307', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 20:42:33','0','0'); -- id=16268
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 ('02375', '307', '111', '2375', '30', '460', '13800.00', '0', '', '2026-10-21 20:44:14', '2375','','','0','0','0','0','0',null,'460','13800','0','0','0','0','0','0','0','0','1'); -- id=1699
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 20:42:33', 1, 2375, 0, 0
                    , 423.2, 30, 0, 0, 1, '2026-10-21 20:44:14')
                ON DUPLICATE KEY UPDATE buyprice = 423.2,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:44:14' ; -- id=7020
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2375', '460', '30', '0', 'buyBillController.php', '1699', '', '0', '0'); -- id=1248
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2375 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1699 ;
UPDATE product SET productName = 'موديل 929 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '460.00', productSellAllPrice = '460.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '423.2',meanbuyprice = '460',meanbuyprice_withDiscount = '423.2' , productbuypricereal = '460.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='423.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 = '2375';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 423.2, meanbuyprice_withDiscount = 423.2
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where buybilldetailid = 1699;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2375;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3769';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2375', '1', '30', '0', '307', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 20:42:33','0','0'); -- id=16269
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 ('02376', '307', '111', '2376', '30', '495', '14850.00', '0', '', '2026-10-21 20:44:14', '2376','','','0','0','0','0','0',null,'495','14850','0','0','0','0','0','0','0','0','1'); -- id=1700
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 20:42:33', 1, 2376, 0, 0
                    , 455.4, 30, 0, 0, 1, '2026-10-21 20:44:14')
                ON DUPLICATE KEY UPDATE buyprice = 455.4,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 20:44:14' ; -- id=7021
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2376', '495', '30', '0', 'buyBillController.php', '1700', '', '0', '0'); -- id=1249
UPDATE product SET  productBuyPrice = "495" WHERE productId = 2376 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1700 ;
UPDATE product SET productName = 'موديل 933 الحريف', productDescription = '', productCatId = '111', productBuyPrice = '495.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '495',lastbuyprice_withDiscount = '455.4',meanbuyprice = '495',meanbuyprice_withDiscount = '455.4' , productbuypricereal = '495.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='495',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='495',meanbuyprice_withTax='495',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='455.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 = '2376';
UPDATE buybilldetail SET  lastbuyprice = 495 , meanbuyprice = 495, lastbuyprice_withDiscount = 455.4, meanbuyprice_withDiscount = 455.4
        , lastbuyprice_withTax = 495, meanbuyprice_withTax = 495, lastbuyprice_withDiscountAndTax = 455.4
                where buybilldetailid = 1700;
UPDATE productunit SET proUnitBuyPrice  = 495 * productnumber WHERE productid = 2376;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2376', '1', '30', '0', '307', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-21 20:42:33','0','0'); -- id=16270
UPDATE supplier SET  suppliercurrentDebt = '466651.4',suppliercurrentDebtInCurrency= '466651.4' , userid = '1', supplierdate = '2026-10-21 20:44:14'   WHERE supplierid = '105';
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 ('105', '410651.00', '56000.4', '0', 'اضافة فاتورة مشتريات', '307', '466651.4', '2026-10-21 20:42:33', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','56000.4','1','410651','56000.4','466651.4','0',''); -- id=831
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '56000.4', '56000.4', '2026-10-21', '1', '0', '0', '2026-10-21 20:44:14','اضافة فاتورة مشتريات رقم 307','1','0',null,'0','307','buyBillController.php?do=details&id=307'); -- id=4258
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4258', '382', '56000.4', '','0'); -- id=4372
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25435642.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 ('4258', '588', '56000.4', '','0'); -- id=4260
UPDATE accountstree SET name = 'الحريف', customName = 'الحريف', customNameEn = 'الحريف', nameEn = 'الحريف', parent = '81', accountNature = '1', theValue = '466651.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 20:25:30' WHERE id = '588';
update buybill set dailyentryid='4258,0' where buybillid=307;
COMMIT;
UPDATE product SET overAllAveragePrice = 395.6 WHERE productId = 2372;UPDATE product SET overAllAveragePrice = 414 WHERE productId = 2373;UPDATE product SET overAllAveragePrice = 340.4 WHERE productId = 2374;UPDATE product SET overAllAveragePrice = 423.2 WHERE productId = 2375;UPDATE product SET overAllAveragePrice = 455.4 WHERE productId = 2376;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:14:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:44:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 20:44:15', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=307'); -- id=17048
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:14:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:44:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:44:23', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=307&type=2'); -- id=17049
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:15:30";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:15:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:45:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 20:45:47', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17050
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-21 17:15:47";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 20:45:47', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17051
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:16:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:46:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-21 20:46:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=17052
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:16:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:46:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-21 20:46:46', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=add'); -- id=17053

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =1432
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(17,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '108920' , clientdate = '2026-10-21 20:46:46', userid = '1' WHERE clientid = '17';
UPDATE client SET  inUse = 0 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','217920.00','109000','1','ايصال تحصيل (( قبض من عميل ))','1432', '108920', '2026-10-19  20:45:10', '1', 'clientPayedDeptController.php', '   ', '109000', '0', null, '0', null, null,'', '-1','1','1','109000','1','','503','0','','.'); -- id=1432
UPDATE save SET  savecurrentvalue = '-41836306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41945306.00','109000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '1432', '-41836306', '2026-10-21 20:46:46', '1',  'clientPayedDeptController.php','17','','0'); -- id=1489
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '109000', '109000', '2026-10-21', '1', '0', '0', '2026-10-21 20:46:47','اضافة ايصال سداد للعميل عنتر - العملاء','1','0','0','0','1432','clientPayedDeptController.php?do=show&id=1432'); -- id=4259
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4259', '383', '109000', '','0'); -- id=4373
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41836309.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 ('4259', '515', '109000', '','0'); -- id=4261
UPDATE accountstree SET name = 'عنتر - العملاء', customName = 'عنتر - العملاء', customNameEn = 'عنتر - العملاء', nameEn = 'عنتر - العملاء', parent = '58', accountNature = '0', theValue = '100830', 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';
UPDATE clientdebtchange SET clientid = '17', clientdebtchangebefore = '217920.000', clientdebtchangeamount = '109000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '1432', clientdebtchangeafter = '108920.000', clientdebtchangedate = '2026-10-19 20:45:10', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '109000.000',discount='', reciptid='0', dailyentryid = '4259',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='109000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '1432';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:16:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:46:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-21 20:46:47', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=17054
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:16:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:46:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-21 20:46:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=show'); -- id=17055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:16:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:46:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 20:46:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=17056
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:17:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:47:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-21 20:47:06', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=17057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:17:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:47:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:47:21', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=17058
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:22:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:52:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:52:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php'); -- id=17059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:22:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:52:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:52:10', '1', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=17060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:22:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:52:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:52:15', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=17061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:22:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:52:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:52:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=17062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:23:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:53:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:53:19', '1', 'editsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=1204'); -- id=17063
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:23:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:53:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:53:32', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=17064
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 1204;
UPDATE sellbill SET  sellbillsysdate = '2026-10-21 20:53:32', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '1204';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-63 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 = 4872;
 INSERT INTO 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0,63,0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15750, sellCostBuyPrice =sellCostBuyPrice-14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice-14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-14490
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-63
                        , netQuantityRet = netQuantityRet-0;
 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15750, sellCostBuyPrice =sellCostBuyPrice-14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice-14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-14490
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '244', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '63', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '181', '244', '1', '2026-10-21 20:03:26','0','0'); -- id=16271
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-28 where id = 1084;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-86 where id = 7006;
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 = 4873;
 INSERT INTO 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0,114,0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-27930, sellCostBuyPrice =sellCostBuyPrice-26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-114
                        , netQuantityRet = netQuantityRet-0;
 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-27930, sellCostBuyPrice =sellCostBuyPrice-26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26220
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '208', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '114', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '94', '208', '1', '2026-10-21 20:03:26','0','0'); -- id=16272
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-200 where id = 1000;
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4874;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1906, '2026-10-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0,200,0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-54000, sellCostBuyPrice =sellCostBuyPrice-50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-200
                        , netQuantityRet = netQuantityRet-0;
 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-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-54000, sellCostBuyPrice =sellCostBuyPrice-50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '424', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1906', '1', '200', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '224', '424', '1', '2026-10-21 20:03:26','0','0'); -- id=16273
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 73;
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 = 4875;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1381, '2026-10-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8850, sellCostBuyPrice =sellCostBuyPrice-7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7800
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8850, sellCostBuyPrice =sellCostBuyPrice-7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7800
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 20:53:32' WHERE storedetailid = '1381';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1381', '1', '30', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '114', '144', '1', '2026-10-21 20:03:26','0','0'); -- id=16274
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-60 where id = 71;
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 = 4876;
 INSERT INTO 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0,60,0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-18000, sellCostBuyPrice =sellCostBuyPrice-16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-16200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-60
                        , netQuantityRet = netQuantityRet-0;
 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-18000, sellCostBuyPrice =sellCostBuyPrice-16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-16200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-21 20:53:32' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '60', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '215', '275', '1', '2026-10-21 20:03:26','0','0'); -- id=16275
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 6284;
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 = 4877;
 INSERT INTO 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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4410, 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-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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4410, 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 = '18', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '18', '0', '1204', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '18', '1', '2026-10-21 20:03:26','0','0'); -- id=16276
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','تعديل فاتورة مبيعات','1204', '0', '2026-10-21 20:03:26', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '128940', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 20:03:26','0','0','',''); -- id=1433
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7514098.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 ('7643038.5','128940', '1', '2', 'تعديل فاتورة مبيعات', '1204', '7514098.5', '2026-10-21 20:53:32', '1',  'sellbillController.php','1','','0'); -- id=1490
 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-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-128940, sellCostBuyPrice =sellCostBuyPrice-119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-118850
                        , returnSellVal = returnSellVal-0, 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-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0, 119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-128940, sellCostBuyPrice =sellCostBuyPrice-119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice-119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-118850
                        , returnSellVal = returnSellVal-0, 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, 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165, 119165, 118850)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-128940, netSellCostBuyPrice = netSellCostBuyPrice-119165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-119165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-119165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-119165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-119165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-119165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-119165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-118850;

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


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

COMMIT;
BEGIN;
CALL clientInUse(3,@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-21 20:03:26', '06ad8ead160770', '3', '3184355.00', '3313295', '0', '1', '128940', '128940', '0', '128940', '1', '2026-10-21 20:03:26', '', '1', '0', 'محل الفيوم عروض', '2', '1', '3', '0', 'محل الفيوم عروض', '485', '1204', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-21','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=1207
UPDATE client SET  clientdebt = '3313295', userid = '1' WHERE clientid = '3';
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 ('3','3184355.00','128940','0','اضافة فاتورة مبيعات (معدله)','1207', '3313295', '2026-10-21 20:53:32', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '128940', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-21 20:03:26','0','0','',''); -- id=1434
UPDATE client SET  inUse = 0 where clientid = 3;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+63 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', '1207', '142', '1841', '63.00', '250', '15750', '0', '', '0', '2026-10-21 20:53:32', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-63,','1','1','0','0','250','15750','0','','0','0.00','0','0','0','0'); -- id=4885
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 = 4885;
 INSERT INTO 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15750, sellCostBuyPrice =sellCostBuyPrice+14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+63
                        , netQuantityRet = netQuantityRet+0;
 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-21', 15750, 14805, 14805
                    , 14805, 14805, 14805, 14805
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14805, 14490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15750, sellCostBuyPrice =sellCostBuyPrice+14805
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14805, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14805
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14805, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14805
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14805
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14805
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '181', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '63', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '244', '181', '1', '2026-10-21 20:53:32','0','0'); -- id=16277
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+28 where id = 1084;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+86 where id = 7006;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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', '1207', '154', '1923', '114.00', '245', '27930', '0', '', '0', '2026-10-21 20:53:32', '1923', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1084-28,7006-86,','1','1','0','0','245','27930','0','','0','0.00','0','0','0','0'); -- id=4886
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 = 4886;
 INSERT INTO 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 114, 0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+27930, sellCostBuyPrice =sellCostBuyPrice+26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+114
                        , netQuantityRet = netQuantityRet+0;
 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-21', 27930, 26220, 26220
                    , 26220, 26220, 26220, 26220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26220, 26220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+27930, sellCostBuyPrice =sellCostBuyPrice+26220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '94', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '114', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '208', '94', '1', '2026-10-21 20:53:32','0','0'); -- id=16278
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+200 where id = 1000;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01906', '1207', '150', '1906', '200.00', '270', '54000', '0', '', '0', '2026-10-21 20:53:32', '1906', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1000-200,','1','1','0','0','270','54000','0','','0','0.00','0','0','0','0'); -- id=4887
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4887;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1906, '2026-10-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54000, sellCostBuyPrice =sellCostBuyPrice+50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+200
                        , netQuantityRet = netQuantityRet+0;
 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-21', 54000, 50000, 50000
                    , 50000, 50000, 50000, 50000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50000, 50000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54000, sellCostBuyPrice =sellCostBuyPrice+50000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '224', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '2923';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1906', '1', '200', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '424', '224', '1', '2026-10-21 20:53:32','0','0'); -- id=16279
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 73;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, 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','01381', '1207', '94', '1381', '30.00', '295', '8850', '0', '', '0', '2026-10-21 20:53:32', '1381', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','73-30,','1','1','0','0','295','8850','0','','0','0.00','0','0','0','0'); -- id=4888
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 = 4888;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1381, '2026-10-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8850, sellCostBuyPrice =sellCostBuyPrice+7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-21', 8850, 7800, 7800
                    , 7800, 7800, 7800, 7800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7800, 7800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8850, sellCostBuyPrice =sellCostBuyPrice+7800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '114', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '1381';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1381', '1', '30', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '144', '114', '1', '2026-10-21 20:53:32','0','0'); -- id=16280
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+60 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', '1207', '94', '1379', '60.00', '300', '18000', '0', '', '0', '2026-10-21 20:53:32', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-60,','1','1','0','0','300','18000','0','','0','0.00','0','0','0','0'); -- id=4889
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 = 4889;
 INSERT INTO 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18000, sellCostBuyPrice =sellCostBuyPrice+16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 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-21', 18000, 16200, 16200
                    , 16200, 16200, 16200, 16200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16200, 16200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18000, sellCostBuyPrice =sellCostBuyPrice+16200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '215', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '60', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '275', '215', '1', '2026-10-21 20:53:32','0','0'); -- id=16281
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 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', '1207', '190', '2175', '18.00', '245', '4410', '0', '', '0', '2026-10-21 20:53:32', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-16,','1','1','0','0','245','4410','0','','0','0.00','0','0','0','0'); -- id=4890
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 = 4890;
 INSERT INTO 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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, 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+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-21', 4410, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, 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 = '0', userid = '1', storedetaildate = '2026-10-21 20:53:32' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '18', '1', '1207', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '0', '1', '2026-10-21 20:53:32','0','0'); -- id=16282
UPDATE dailyentry SET totalcreditor = '128940.00', totaldebtor = '128940.00', thedate = '2026-10-21', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 20:03:26', entryComment = 'اضافة فاتورة مبيعات رقم 1204', fromFlag = '1',related='0',isopeningentry='0',operationId='1204',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1204' WHERE id = '4250';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '128940.00', '128940.00', '2026-10-21', '1', '0', '4250', '2026-10-21 20:53:32','تم عكس القيد رقم 4250 ','1','0','0','0','0',''); -- id=4260
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4260', '419', '128940.00', '','0'); -- id=4262
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7514098', 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 ('4260', '143', '128940.00', '','0'); -- id=4374
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13562145', 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 = '119165.00', totaldebtor = '119165.00', thedate = '2026-10-21', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-21 20:03:26', entryComment = 'اضافة فاتورة مبيعات رقم 1204 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='1204',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1204' WHERE id = '4251';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '119165.00', '119165.00', '2026-10-21', '1', '0', '4251', '2026-10-21 20:53:32','تم عكس القيد رقم 4251 ','1','0','0','0','0',''); -- id=4261
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4261', '402', '119165.00', '','0'); -- id=4263
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12547310.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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4261', '382', '119165.00', '','0'); -- id=4375
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25554807.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 ( '128940', '128940', '2026-10-21', '1', '0', '0', '2026-10-21 20:53:32','اضافة فاتورة مبيعات رقم 1207','1','0',null,'0','1207','sellbillController.php?do=showDetail&sellbillid=1207'); -- id=4262
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4262', '495', '128940', '','0'); -- id=4376
UPDATE accountstree SET name = 'محل الفيوم عروض', customName = 'محل الفيوم عروض', customNameEn = 'محل الفيوم عروض', nameEn = 'محل الفيوم عروض', parent = '58', accountNature = '0', theValue = '3313295', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:30:47' WHERE id = '495';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4262', '143', '128940', '','0'); -- id=4264
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '13691085', 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 ( '119165', '119165', '2026-10-21', '1', '0', '0', '2026-10-21 20:53:32','اضافة فاتورة مبيعات رقم 1207 - صرف البضاعة من المخزن','1','0',null,'0','1207','sellbillController.php?do=showDetail&sellbillid=1207'); -- id=4263
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4263', '402', '119165', '','0'); -- id=4377
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '12666475.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 ('4263', '382', '119165', '','0'); -- id=4265
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25435642.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='4262,0,4263' where sellbillid=1207;
 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-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+128940, sellCostBuyPrice =sellCostBuyPrice+119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118850
                        , returnSellVal = returnSellVal+0, 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 (3, '2026-10-21', 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,119165, 118850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+128940, sellCostBuyPrice =sellCostBuyPrice+119165
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119165, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119165
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119165, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119165
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119165
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119165
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+118850
                        , returnSellVal = returnSellVal+0, 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, 128940, 119165, 119165
                    , 119165, 119165, 119165, 119165, 119165, 118850)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+128940, netSellCostBuyPrice = netSellCostBuyPrice+119165
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+119165
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+119165
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+119165
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+119165
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+119165
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+119165
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+118850;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 1204 and newid=1207 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:23:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:53:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-21 20:53:32', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=1207'); -- id=17065
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:24:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:54:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-21 20:54:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=17066
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:24:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:54:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-21 20:54:58', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=17067
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:40', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17069
BEGIN;
CALL supplierInUse(77,@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 ('77', '224150.00', '30000', '1', 'ايصال دفع لمورد', '1', '194150', '2026-10-21 20:55:28', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','169',''); -- id=832
UPDATE supplierdebtchange SET supplierid = '77', supplierdebtchangebefore = '224150.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '194150', supplierdebtchangedate = '2026-10-21 20:55:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='224150',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='194150', paySerialNo='169',tagids='' WHERE supplierdebtchangeid = '832';
UPDATE supplier SET  suppliercurrentDebt = '194150',suppliercurrentDebtInCurrency= '194150' , userid = '1', supplierdate = '2026-10-21 20:55:40'   WHERE supplierid = '77';
UPDATE supplier SET  inUse = 0 where supplierid = 77;
UPDATE save SET  savecurrentvalue = '-41866306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41836306.00','30000', '1', '1', 'ايصال دفع لمورد', '832', '-41866306', '2026-10-21 20:55:40', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1491
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-21', '1', '0', '0', '2026-10-21 20:55:40','ايصال دفع لمورد ( العقرب جينز ) ','1','0','0','0','832','supplierReportsController.php?do=show&id=832'); -- id=4264
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4264', '503', '30000', '','0'); -- id=4378
UPDATE accountstree SET name = 'العقرب جينز', customName = 'العقرب جينز', customNameEn = 'العقرب جينز', nameEn = 'العقرب جينز', parent = '81', accountNature = '1', theValue = '194150', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-01 17:30:16' WHERE id = '503';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4264', '383', '30000', '','0'); -- id=4266
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41866309.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 = '77', supplierdebtchangebefore = '224150.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '194150.00', supplierdebtchangedate = '2026-10-21 20:55:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4264',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='224150',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='194150', paySerialNo='169',tagids='' WHERE supplierdebtchangeid = '832';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:41', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17070
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:42', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:55:43', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17072
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:46', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:59', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17074
BEGIN;
CALL supplierInUse(57,@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 ('57', '23610.00', '20000', '1', 'ايصال دفع لمورد', '1', '3610', '2026-10-21 20:55:46', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','170',''); -- id=833
UPDATE supplierdebtchange SET supplierid = '57', supplierdebtchangebefore = '23610.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3610', supplierdebtchangedate = '2026-10-21 20:55:46', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='23610',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='3610', paySerialNo='170',tagids='' WHERE supplierdebtchangeid = '833';
UPDATE supplier SET  suppliercurrentDebt = '3610',suppliercurrentDebtInCurrency= '3610' , userid = '1', supplierdate = '2026-10-21 20:55:59'   WHERE supplierid = '57';
UPDATE supplier SET  inUse = 0 where supplierid = 57;
UPDATE save SET  savecurrentvalue = '-41886306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41866306.00','20000', '1', '1', 'ايصال دفع لمورد', '833', '-41886306', '2026-10-21 20:55:59', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1492
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-21', '1', '0', '0', '2026-10-21 20:55:59','ايصال دفع لمورد ( الحرمين - مورد ) ','1','0','0','0','833','supplierReportsController.php?do=show&id=833'); -- id=4265
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4265', '476', '20000', '','0'); -- id=4379
UPDATE accountstree SET name = 'الحرمين - مورد', customName = 'الحرمين - مورد', customNameEn = 'الحرمين - مورد', nameEn = 'الحرمين - مورد', parent = '81', accountNature = '1', theValue = '-30600', 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 = '476';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4265', '383', '20000', '','0'); -- id=4267
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41886309.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 = '57', supplierdebtchangebefore = '23610.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3610.00', supplierdebtchangedate = '2026-10-21 20:55:46', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4265',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='23610',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='3610', paySerialNo='170',tagids='' WHERE supplierdebtchangeid = '833';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:25:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:55:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:55:59', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17075
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:56:02', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17077
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:22', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17079
BEGIN;
CALL supplierInUse(62,@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 ('62', '350735.00', '30000', '1', 'ايصال دفع لمورد', '1', '320735', '2026-10-21 20:56:04', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','171',''); -- id=834
UPDATE supplierdebtchange SET supplierid = '62', supplierdebtchangebefore = '350735.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '320735', supplierdebtchangedate = '2026-10-21 20:56:04', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='350735',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='320735', paySerialNo='171',tagids='' WHERE supplierdebtchangeid = '834';
UPDATE supplier SET  suppliercurrentDebt = '320735',suppliercurrentDebtInCurrency= '320735' , userid = '1', supplierdate = '2026-10-21 20:56:22'   WHERE supplierid = '62';
UPDATE supplier SET  inUse = 0 where supplierid = 62;
UPDATE save SET  savecurrentvalue = '-41916306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41886306.00','30000', '1', '1', 'ايصال دفع لمورد', '834', '-41916306', '2026-10-21 20:56:22', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1493
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-21', '1', '0', '0', '2026-10-21 20:56:22','ايصال دفع لمورد ( ستيفن - مورد ) ','1','0','0','0','834','supplierReportsController.php?do=show&id=834'); -- id=4266
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4266', '481', '30000', '','0'); -- id=4380
UPDATE accountstree SET name = 'ستيفن - مورد', customName = 'ستيفن - مورد', customNameEn = 'ستيفن - مورد', nameEn = 'ستيفن - مورد', parent = '81', accountNature = '1', theValue = '-65000', 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 = '481';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4266', '383', '30000', '','0'); -- id=4268
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41916309.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 = '62', supplierdebtchangebefore = '350735.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '320735.00', supplierdebtchangedate = '2026-10-21 20:56:04', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4266',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='350735',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='320735', paySerialNo='171',tagids='' WHERE supplierdebtchangeid = '834';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:23', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:25', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:46', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17083
BEGIN;
CALL supplierInUse(58,@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 ('58', '572543.00', '30000', '1', 'ايصال دفع لمورد', '1', '542543', '2026-10-21 20:56:25', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','172',''); -- id=835
UPDATE supplierdebtchange SET supplierid = '58', supplierdebtchangebefore = '572543.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '542543', supplierdebtchangedate = '2026-10-21 20:56:25', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='572543',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='542543', paySerialNo='172',tagids='' WHERE supplierdebtchangeid = '835';
UPDATE supplier SET  suppliercurrentDebt = '542543',suppliercurrentDebtInCurrency= '542543' , userid = '1', supplierdate = '2026-10-21 20:56:46'   WHERE supplierid = '58';
UPDATE supplier SET  inUse = 0 where supplierid = 58;
UPDATE save SET  savecurrentvalue = '-41946306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41916306.00','30000', '1', '1', 'ايصال دفع لمورد', '835', '-41946306', '2026-10-21 20:56:46', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1494
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-21', '1', '0', '0', '2026-10-21 20:56:46','ايصال دفع لمورد ( زاي وان - مورد ) ','1','0','0','0','835','supplierReportsController.php?do=show&id=835'); -- id=4267
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4267', '477', '30000', '','0'); -- id=4381
UPDATE accountstree SET name = 'زاي وان - مورد', customName = 'زاي وان - مورد', customNameEn = 'زاي وان - مورد', nameEn = 'زاي وان - مورد', parent = '81', accountNature = '1', theValue = '37175', 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 = '477';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4267', '383', '30000', '','0'); -- id=4269
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41946309.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 = '58', supplierdebtchangebefore = '572543.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '542543.00', supplierdebtchangedate = '2026-10-21 20:56:25', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4267',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='572543',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='542543', paySerialNo='172',tagids='' WHERE supplierdebtchangeid = '835';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:46', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17084
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:48', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:56:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17086
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:26:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:56:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:56:51', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17087
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:05', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17088
BEGIN;
CALL supplierInUse(20,@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 ('20', '586180.00', '120000', '1', 'ايصال دفع لمورد', '1', '466180', '2026-10-21 20:56:51', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','120000','1','0','0','0','173',''); -- id=836
UPDATE supplierdebtchange SET supplierid = '20', supplierdebtchangebefore = '586180.00', supplierdebtchangeamount = '120000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '466180', supplierdebtchangedate = '2026-10-21 20:56:51', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='120000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='586180',debtchangamountInSupplierCurrency='120000',debtchangafterInSupplierCurrency='466180', paySerialNo='173',tagids='' WHERE supplierdebtchangeid = '836';
UPDATE supplier SET  suppliercurrentDebt = '466180',suppliercurrentDebtInCurrency= '466180' , userid = '1', supplierdate = '2026-10-21 20:57:05'   WHERE supplierid = '20';
UPDATE supplier SET  inUse = 0 where supplierid = 20;
UPDATE save SET  savecurrentvalue = '-42066306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41946306.00','120000', '1', '1', 'ايصال دفع لمورد', '836', '-42066306', '2026-10-21 20:57:05', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1495
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '120000', '120000', '2026-10-21', '1', '0', '0', '2026-10-21 20:57:05','ايصال دفع لمورد ( فولكانو جينز - مورد ) ','1','0','0','0','836','supplierReportsController.php?do=show&id=836'); -- id=4268
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4268', '439', '120000', '','0'); -- id=4382
UPDATE accountstree SET name = 'فولكانو جينز - مورد', customName = 'فولكانو جينز - مورد', customNameEn = 'فولكانو جينز - مورد', nameEn = 'فولكانو جينز - مورد', parent = '81', accountNature = '1', theValue = '127825', 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 = '439';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4268', '383', '120000', '','0'); -- id=4270
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42066309.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 = '20', supplierdebtchangebefore = '586180.00', supplierdebtchangeamount = '120000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '466180.00', supplierdebtchangedate = '2026-10-21 20:56:51', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4268',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='120000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='586180',debtchangamountInSupplierCurrency='120000',debtchangafterInSupplierCurrency='466180', paySerialNo='173',tagids='' WHERE supplierdebtchangeid = '836';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:05', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:07', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:57:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:12', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:24', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17093
BEGIN;
CALL supplierInUse(10,@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 ('10', '86855.00', '15000', '1', 'ايصال دفع لمورد', '1', '71855', '2026-10-21 20:57:12', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','15000','1','0','0','0','174',''); -- id=837
UPDATE supplierdebtchange SET supplierid = '10', supplierdebtchangebefore = '86855.00', supplierdebtchangeamount = '15000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '71855', supplierdebtchangedate = '2026-10-21 20:57:12', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='86855',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='71855', paySerialNo='174',tagids='' WHERE supplierdebtchangeid = '837';
UPDATE supplier SET  suppliercurrentDebt = '71855',suppliercurrentDebtInCurrency= '71855' , userid = '1', supplierdate = '2026-10-21 20:57:24'   WHERE supplierid = '10';
UPDATE supplier SET  inUse = 0 where supplierid = 10;
UPDATE save SET  savecurrentvalue = '-42081306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42066306.00','15000', '1', '1', 'ايصال دفع لمورد', '837', '-42081306', '2026-10-21 20:57:24', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1496
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15000', '15000', '2026-10-21', '1', '0', '0', '2026-10-21 20:57:24','ايصال دفع لمورد ( هرفي - مورد ) ','1','0','0','0','837','supplierReportsController.php?do=show&id=837'); -- id=4269
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4269', '429', '15000', '','0'); -- id=4383
UPDATE accountstree SET name = 'هرفي - مورد', customName = 'هرفي - مورد', customNameEn = 'هرفي - مورد', nameEn = 'هرفي - مورد', parent = '81', accountNature = '1', theValue = '-155380', 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';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4269', '383', '15000', '','0'); -- id=4271
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42081309.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 = '10', supplierdebtchangebefore = '86855.00', supplierdebtchangeamount = '15000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '71855.00', supplierdebtchangedate = '2026-10-21 20:57:12', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4269',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='86855',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='71855', paySerialNo='174',tagids='' WHERE supplierdebtchangeid = '837';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:24', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17094
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17095
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:57:26', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17096
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17097
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:38', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17098
BEGIN;
CALL supplierInUse(44,@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 ('44', '390110.00', '10000', '1', 'ايصال دفع لمورد', '1', '380110', '2026-10-21 20:57:28', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','10000','1','0','0','0','175',''); -- id=838
UPDATE supplierdebtchange SET supplierid = '44', supplierdebtchangebefore = '390110.00', supplierdebtchangeamount = '10000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '380110', supplierdebtchangedate = '2026-10-21 20:57:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='390110',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='380110', paySerialNo='175',tagids='' WHERE supplierdebtchangeid = '838';
UPDATE supplier SET  suppliercurrentDebt = '380110',suppliercurrentDebtInCurrency= '380110' , userid = '1', supplierdate = '2026-10-21 20:57:38'   WHERE supplierid = '44';
UPDATE supplier SET  inUse = 0 where supplierid = 44;
UPDATE save SET  savecurrentvalue = '-42091306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42081306.00','10000', '1', '1', 'ايصال دفع لمورد', '838', '-42091306', '2026-10-21 20:57:38', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1497
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10000', '10000', '2026-10-21', '1', '0', '0', '2026-10-21 20:57:38','ايصال دفع لمورد ( ميلانو - مورد ) ','1','0','0','0','838','supplierReportsController.php?do=show&id=838'); -- id=4270
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4270', '463', '10000', '','0'); -- id=4384
UPDATE accountstree SET name = 'ميلانو - مورد', customName = 'ميلانو - مورد', customNameEn = 'ميلانو - مورد', nameEn = 'ميلانو - مورد', parent = '81', accountNature = '1', theValue = '117800', 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 = '463';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4270', '383', '10000', '','0'); -- id=4272
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42091309.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 = '44', supplierdebtchangebefore = '390110.00', supplierdebtchangeamount = '10000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '380110.00', supplierdebtchangedate = '2026-10-21 20:57:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4270',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='390110',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='380110', paySerialNo='175',tagids='' WHERE supplierdebtchangeid = '838';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:38', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17099
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:40', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17100
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:57:40', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:44', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17102
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:55', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17103
BEGIN;
CALL supplierInUse(39,@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 ('39', '294250.00', '20000', '1', 'ايصال دفع لمورد', '1', '274250', '2026-10-21 20:57:44', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','176',''); -- id=839
UPDATE supplierdebtchange SET supplierid = '39', supplierdebtchangebefore = '294250.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '274250', supplierdebtchangedate = '2026-10-21 20:57:44', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='294250',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='274250', paySerialNo='176',tagids='' WHERE supplierdebtchangeid = '839';
UPDATE supplier SET  suppliercurrentDebt = '274250',suppliercurrentDebtInCurrency= '274250' , userid = '1', supplierdate = '2026-10-21 20:57:55'   WHERE supplierid = '39';
UPDATE supplier SET  inUse = 0 where supplierid = 39;
UPDATE save SET  savecurrentvalue = '-42111306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42091306.00','20000', '1', '1', 'ايصال دفع لمورد', '839', '-42111306', '2026-10-21 20:57:55', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1498
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-21', '1', '0', '0', '2026-10-21 20:57:55','ايصال دفع لمورد ( غفران - مورد ) ','1','0','0','0','839','supplierReportsController.php?do=show&id=839'); -- id=4271
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4271', '458', '20000', '','0'); -- id=4385
UPDATE accountstree SET name = 'غفران - مورد', customName = 'غفران - مورد', customNameEn = 'غفران - مورد', nameEn = 'غفران - مورد', parent = '81', accountNature = '1', theValue = '-23500', 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 = '458';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4271', '383', '20000', '','0'); -- id=4273
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42111309.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 = '39', supplierdebtchangebefore = '294250.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '274250.00', supplierdebtchangedate = '2026-10-21 20:57:44', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4271',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='294250',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='274250', paySerialNo='176',tagids='' WHERE supplierdebtchangeid = '839';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:55', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17104
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:57', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17105
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:57:57', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:27:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:57:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:57:59', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:58:08', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:10', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17109
BEGIN;
CALL supplierInUse(88,@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 ('88', '150160.00', '20000', '1', 'ايصال دفع لمورد', '1', '130160', '2026-10-21 20:57:59', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','177',''); -- id=840
UPDATE supplierdebtchange SET supplierid = '88', supplierdebtchangebefore = '150160.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '130160', supplierdebtchangedate = '2026-10-21 20:57:59', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='150160',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='130160', paySerialNo='177',tagids='' WHERE supplierdebtchangeid = '840';
UPDATE supplier SET  suppliercurrentDebt = '130160',suppliercurrentDebtInCurrency= '130160' , userid = '1', supplierdate = '2026-10-21 20:58:10'   WHERE supplierid = '88';
UPDATE supplier SET  inUse = 0 where supplierid = 88;
UPDATE save SET  savecurrentvalue = '-42131306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42111306.00','20000', '1', '1', 'ايصال دفع لمورد', '840', '-42131306', '2026-10-21 20:58:10', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1499
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-21', '1', '0', '0', '2026-10-21 20:58:10','ايصال دفع لمورد ( بيدو الالماني ) ','1','0','0','0','840','supplierReportsController.php?do=show&id=840'); -- id=4272
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4272', '569', '20000', '','0'); -- id=4386
UPDATE accountstree SET name = 'بيدو الالماني', customName = 'بيدو الالماني', customNameEn = 'بيدو الالماني', nameEn = 'بيدو الالماني', parent = '81', accountNature = '1', theValue = '130160', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 16:49:11' WHERE id = '569';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4272', '383', '20000', '','0'); -- id=4274
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42131309.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 = '88', supplierdebtchangebefore = '150160.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '130160.00', supplierdebtchangedate = '2026-10-21 20:57:59', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4272',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='150160',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='130160', paySerialNo='177',tagids='' WHERE supplierdebtchangeid = '840';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:11', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17110
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:12', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:58:12', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17112
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:16', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:26', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17114
BEGIN;
CALL supplierInUse(126,@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 ('126', '257940.00', '30000', '1', 'ايصال دفع لمورد', '1', '227940', '2026-10-21 20:58:16', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','178',''); -- id=841
UPDATE supplierdebtchange SET supplierid = '126', supplierdebtchangebefore = '257940.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '227940', supplierdebtchangedate = '2026-10-21 20:58:16', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='257940',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='227940', paySerialNo='178',tagids='' WHERE supplierdebtchangeid = '841';
UPDATE supplier SET  suppliercurrentDebt = '227940',suppliercurrentDebtInCurrency= '227940' , userid = '1', supplierdate = '2026-10-21 20:58:26'   WHERE supplierid = '126';
UPDATE supplier SET  inUse = 0 where supplierid = 126;
UPDATE save SET  savecurrentvalue = '-42161306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42131306.00','30000', '1', '1', 'ايصال دفع لمورد', '841', '-42161306', '2026-10-21 20:58:26', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1500
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-21', '1', '0', '0', '2026-10-21 20:58:26','ايصال دفع لمورد ( دودج ) ','1','0','0','0','841','supplierReportsController.php?do=show&id=841'); -- id=4273
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4273', '609', '30000', '','0'); -- id=4387
UPDATE accountstree SET name = 'دودج', customName = 'دودج', customNameEn = 'دودج', nameEn = 'دودج', parent = '81', accountNature = '1', theValue = '227940', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 14:18:33' WHERE id = '609';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4273', '383', '30000', '','0'); -- id=4275
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42161309.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 = '126', supplierdebtchangebefore = '257940.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '227940.00', supplierdebtchangedate = '2026-10-21 20:58:16', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4273',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='257940',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='227940', paySerialNo='178',tagids='' WHERE supplierdebtchangeid = '841';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:27', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17115
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:28', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:58:29', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:39', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17119
BEGIN;
CALL supplierInUse(181,@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 ('181', '167976.00', '30000', '1', 'ايصال دفع لمورد', '1', '137976', '2026-10-21 20:58:30', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','179',''); -- id=842
UPDATE supplierdebtchange SET supplierid = '181', supplierdebtchangebefore = '167976.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '137976', supplierdebtchangedate = '2026-10-21 20:58:30', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='167976',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='137976', paySerialNo='179',tagids='' WHERE supplierdebtchangeid = '842';
UPDATE supplier SET  suppliercurrentDebt = '137976',suppliercurrentDebtInCurrency= '137976' , userid = '1', supplierdate = '2026-10-21 20:58:39'   WHERE supplierid = '181';
UPDATE supplier SET  inUse = 0 where supplierid = 181;
UPDATE save SET  savecurrentvalue = '-42191306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42161306.00','30000', '1', '1', 'ايصال دفع لمورد', '842', '-42191306', '2026-10-21 20:58:39', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1501
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-21', '1', '0', '0', '2026-10-21 20:58:39','ايصال دفع لمورد ( العمدة ) ','1','0','0','0','842','supplierReportsController.php?do=show&id=842'); -- id=4274
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4274', '664', '30000', '','0'); -- id=4388
UPDATE accountstree SET name = 'العمدة', customName = 'العمدة', customNameEn = 'العمدة', nameEn = 'العمدة', parent = '81', accountNature = '1', theValue = '137976', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 22:23:12' WHERE id = '664';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4274', '383', '30000', '','0'); -- id=4276
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42191309.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 = '181', supplierdebtchangebefore = '167976.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '137976.00', supplierdebtchangedate = '2026-10-21 20:58:30', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4274',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='167976',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='137976', paySerialNo='179',tagids='' WHERE supplierdebtchangeid = '842';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:40', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 20:58:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17121
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:58:42', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17124
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:57', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17125
BEGIN;
CALL supplierInUse(108,@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 ('108', '164650.00', '50000', '1', 'ايصال دفع لمورد', '1', '114650', '2026-10-21 20:58:48', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','180',''); -- id=843
UPDATE supplierdebtchange SET supplierid = '108', supplierdebtchangebefore = '164650.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '114650', supplierdebtchangedate = '2026-10-21 20:58:48', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='164650',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='114650', paySerialNo='180',tagids='' WHERE supplierdebtchangeid = '843';
UPDATE supplier SET  suppliercurrentDebt = '114650',suppliercurrentDebtInCurrency= '114650' , userid = '1', supplierdate = '2026-10-21 20:58:58'   WHERE supplierid = '108';
UPDATE supplier SET  inUse = 0 where supplierid = 108;
UPDATE save SET  savecurrentvalue = '-42241306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42191306.00','50000', '1', '1', 'ايصال دفع لمورد', '843', '-42241306', '2026-10-21 20:58:58', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1502
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-21', '1', '0', '0', '2026-10-21 20:58:58','ايصال دفع لمورد ( ريفال تريكو ) ','1','0','0','0','843','supplierReportsController.php?do=show&id=843'); -- id=4275
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4275', '591', '50000', '','0'); -- id=4389
UPDATE accountstree SET name = 'ريفال تريكو', customName = 'ريفال تريكو', customNameEn = 'ريفال تريكو', nameEn = 'ريفال تريكو', parent = '81', accountNature = '1', theValue = '114650', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-07 12:12:44' WHERE id = '591';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4275', '383', '50000', '','0'); -- id=4277
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42241309.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 = '108', supplierdebtchangebefore = '164650.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '114650.00', supplierdebtchangedate = '2026-10-21 20:58:48', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4275',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='164650',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='114650', paySerialNo='180',tagids='' WHERE supplierdebtchangeid = '843';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:58', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17126
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:28:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:58:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:58:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17127
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:59:00', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17128
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:05', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17129
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:14', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17130
BEGIN;
CALL supplierInUse(19,@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 ('19', '340545.00', '25000', '1', 'ايصال دفع لمورد', '1', '315545', '2026-10-21 20:59:05', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','25000','1','0','0','0','181',''); -- id=844
UPDATE supplierdebtchange SET supplierid = '19', supplierdebtchangebefore = '340545.00', supplierdebtchangeamount = '25000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '315545', supplierdebtchangedate = '2026-10-21 20:59:05', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='340545',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='315545', paySerialNo='181',tagids='' WHERE supplierdebtchangeid = '844';
UPDATE supplier SET  suppliercurrentDebt = '315545',suppliercurrentDebtInCurrency= '315545' , userid = '1', supplierdate = '2026-10-21 20:59:14'   WHERE supplierid = '19';
UPDATE supplier SET  inUse = 0 where supplierid = 19;
UPDATE save SET  savecurrentvalue = '-42266306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42241306.00','25000', '1', '1', 'ايصال دفع لمورد', '844', '-42266306', '2026-10-21 20:59:14', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1503
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '25000', '25000', '2026-10-21', '1', '0', '0', '2026-10-21 20:59:14','ايصال دفع لمورد ( فيفار جينز - مورد ) ','1','0','0','0','844','supplierReportsController.php?do=show&id=844'); -- id=4276
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4276', '438', '25000', '','0'); -- id=4390
UPDATE accountstree SET name = 'فيفار جينز - مورد', customName = 'فيفار جينز - مورد', customNameEn = 'فيفار جينز - مورد', nameEn = 'فيفار جينز - مورد', parent = '81', accountNature = '1', theValue = '-46500', 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 = '438';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4276', '383', '25000', '','0'); -- id=4278
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42266309.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 = '19', supplierdebtchangebefore = '340545.00', supplierdebtchangeamount = '25000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '315545.00', supplierdebtchangedate = '2026-10-21 20:59:05', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4276',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='340545',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='315545', paySerialNo='181',tagids='' WHERE supplierdebtchangeid = '844';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:14', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:16', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17132
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:59:16', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-21 20:59:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=17134
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:20', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17135
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:30', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17136
BEGIN;
CALL supplierInUse(56,@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 ('56', '244900.00', '25000', '1', 'ايصال دفع لمورد', '1', '219900', '2026-10-21 20:59:20', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','25000','1','0','0','0','182',''); -- id=845
UPDATE supplierdebtchange SET supplierid = '56', supplierdebtchangebefore = '244900.00', supplierdebtchangeamount = '25000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '219900', supplierdebtchangedate = '2026-10-21 20:59:20', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='595730',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='219900', paySerialNo='182',tagids='' WHERE supplierdebtchangeid = '845';
UPDATE supplier SET  suppliercurrentDebt = '219900',suppliercurrentDebtInCurrency= '219900' , userid = '1', supplierdate = '2026-10-21 20:59:30'   WHERE supplierid = '56';
UPDATE supplier SET  inUse = 0 where supplierid = 56;
UPDATE save SET  savecurrentvalue = '-42291306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42266306.00','25000', '1', '1', 'ايصال دفع لمورد', '845', '-42291306', '2026-10-21 20:59:30', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1504
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '25000', '25000', '2026-10-21', '1', '0', '0', '2026-10-21 20:59:30','ايصال دفع لمورد ( لاكوست - مورد ) ','1','0','0','0','845','supplierReportsController.php?do=show&id=845'); -- id=4277
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4277', '475', '25000', '','0'); -- id=4391
UPDATE accountstree SET name = 'لاكوست - مورد', customName = 'لاكوست - مورد', customNameEn = 'لاكوست - مورد', nameEn = 'لاكوست - مورد', parent = '81', accountNature = '1', theValue = '24700', 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 = '475';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4277', '383', '25000', '','0'); -- id=4279
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42291309.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 = '56', supplierdebtchangebefore = '244900.00', supplierdebtchangeamount = '25000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '219900.00', supplierdebtchangedate = '2026-10-21 20:59:20', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4277',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='595730',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='219900', paySerialNo='182',tagids='' WHERE supplierdebtchangeid = '845';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:31', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:33', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17138
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:59:33', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17139
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:37', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:51', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17141
BEGIN;
CALL supplierInUse(12,@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 ('12', '80100.00', '20000', '1', 'ايصال دفع لمورد', '1', '60100', '2026-10-21 20:59:37', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','183',''); -- id=846
UPDATE supplierdebtchange SET supplierid = '12', supplierdebtchangebefore = '80100.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '60100', supplierdebtchangedate = '2026-10-21 20:59:37', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='80100',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='60100', paySerialNo='183',tagids='' WHERE supplierdebtchangeid = '846';
UPDATE supplier SET  suppliercurrentDebt = '60100',suppliercurrentDebtInCurrency= '60100' , userid = '1', supplierdate = '2026-10-21 20:59:51'   WHERE supplierid = '12';
UPDATE supplier SET  inUse = 0 where supplierid = 12;
UPDATE save SET  savecurrentvalue = '-42311306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42291306.00','20000', '1', '1', 'ايصال دفع لمورد', '846', '-42311306', '2026-10-21 20:59:51', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1505
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-21', '1', '0', '0', '2026-10-21 20:59:51','ايصال دفع لمورد ( بيتر نادر JP - مورد ) ','1','0','0','0','846','supplierReportsController.php?do=show&id=846'); -- id=4278
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4278', '431', '20000', '','0'); -- id=4392
UPDATE accountstree SET name = 'بيتر نادر JP - مورد', customName = 'بيتر نادر JP - مورد', customNameEn = 'بيتر نادر JP - مورد', nameEn = 'بيتر نادر JP - مورد', parent = '81', accountNature = '1', theValue = '-30000', 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 = '431';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4278', '383', '20000', '','0'); -- id=4280
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42311309.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 = '12', supplierdebtchangebefore = '80100.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '60100.00', supplierdebtchangedate = '2026-10-21 20:59:37', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4278',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='80100',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='60100', paySerialNo='183',tagids='' WHERE supplierdebtchangeid = '846';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:52', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 20:59:54', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17143
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:29:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 20:59:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 20:59:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:01', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:17', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17146
BEGIN;
CALL supplierInUse(38,@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 ('38', '342885.00', '100000', '1', 'ايصال دفع لمورد', '1', '242885', '2026-10-21 21:00:01', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','100000','1','0','0','0','184',''); -- id=847
UPDATE supplierdebtchange SET supplierid = '38', supplierdebtchangebefore = '342885.00', supplierdebtchangeamount = '100000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '242885', supplierdebtchangedate = '2026-10-21 21:00:01', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='100000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='100000',debtchangafterInSupplierCurrency='242885', paySerialNo='184',tagids='' WHERE supplierdebtchangeid = '847';
UPDATE supplier SET  suppliercurrentDebt = '242885',suppliercurrentDebtInCurrency= '242885' , userid = '1', supplierdate = '2026-10-21 21:00:17'   WHERE supplierid = '38';
UPDATE supplier SET  inUse = 0 where supplierid = 38;
UPDATE save SET  savecurrentvalue = '-42411306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42311306.00','100000', '1', '1', 'ايصال دفع لمورد', '847', '-42411306', '2026-10-21 21:00:17', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1506
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '100000', '100000', '2026-10-21', '1', '0', '0', '2026-10-21 21:00:17','ايصال دفع لمورد ( مستر كاجو - مورد ) ','1','0','0','0','847','supplierReportsController.php?do=show&id=847'); -- id=4279
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4279', '457', '100000', '','0'); -- id=4393
UPDATE accountstree SET name = 'مستر كاجو - مورد', customName = 'مستر كاجو - مورد', customNameEn = 'مستر كاجو - مورد', nameEn = 'مستر كاجو - مورد', parent = '81', accountNature = '1', theValue = '-100000', 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 = '457';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4279', '383', '100000', '','0'); -- id=4281
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42411309.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 = '38', supplierdebtchangebefore = '342885.00', supplierdebtchangeamount = '100000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '242885.00', supplierdebtchangedate = '2026-10-21 21:00:01', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4279',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='100000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='100000',debtchangafterInSupplierCurrency='242885', paySerialNo='184',tagids='' WHERE supplierdebtchangeid = '847';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:17', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:19', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 21:00:19', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17149
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:21', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17150
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:32', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17151
BEGIN;
CALL supplierInUse(44,@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 ('44', '380110.00', '40000', '1', 'ايصال دفع لمورد', '1', '340110', '2026-10-21 21:00:21', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','40000','1','0','0','0','185',''); -- id=848
UPDATE supplierdebtchange SET supplierid = '44', supplierdebtchangebefore = '380110.00', supplierdebtchangeamount = '40000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '340110', supplierdebtchangedate = '2026-10-21 21:00:21', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='40000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='380110',debtchangamountInSupplierCurrency='40000',debtchangafterInSupplierCurrency='340110', paySerialNo='185',tagids='' WHERE supplierdebtchangeid = '848';
UPDATE supplier SET  suppliercurrentDebt = '340110',suppliercurrentDebtInCurrency= '340110' , userid = '1', supplierdate = '2026-10-21 21:00:32'   WHERE supplierid = '44';
UPDATE supplier SET  inUse = 0 where supplierid = 44;
UPDATE save SET  savecurrentvalue = '-42451306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42411306.00','40000', '1', '1', 'ايصال دفع لمورد', '848', '-42451306', '2026-10-21 21:00:32', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1507
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40000', '40000', '2026-10-21', '1', '0', '0', '2026-10-21 21:00:32','ايصال دفع لمورد ( ميلانو - مورد ) ','1','0','0','0','848','supplierReportsController.php?do=show&id=848'); -- id=4280
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4280', '463', '40000', '','0'); -- id=4394
UPDATE accountstree SET name = 'ميلانو - مورد', customName = 'ميلانو - مورد', customNameEn = 'ميلانو - مورد', nameEn = 'ميلانو - مورد', parent = '81', accountNature = '1', theValue = '77800', 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 = '463';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4280', '383', '40000', '','0'); -- id=4282
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42451309.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 = '44', supplierdebtchangebefore = '380110.00', supplierdebtchangeamount = '40000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '340110.00', supplierdebtchangedate = '2026-10-21 21:00:21', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4280',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='40000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='380110',debtchangamountInSupplierCurrency='40000',debtchangafterInSupplierCurrency='340110', paySerialNo='185',tagids='' WHERE supplierdebtchangeid = '848';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:33', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17153
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 21:00:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:40', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=17155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:53', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=17156
BEGIN;
CALL supplierInUse(21,@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 ('21', '381145.00', '50000', '1', 'ايصال دفع لمورد', '1', '331145', '2026-10-21 21:00:40', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','186',''); -- id=849
UPDATE supplierdebtchange SET supplierid = '21', supplierdebtchangebefore = '381145.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '331145', supplierdebtchangedate = '2026-10-21 21:00:40', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='693230',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='331145', paySerialNo='186',tagids='' WHERE supplierdebtchangeid = '849';
UPDATE supplier SET  suppliercurrentDebt = '331145',suppliercurrentDebtInCurrency= '331145' , userid = '1', supplierdate = '2026-10-21 21:00:53'   WHERE supplierid = '21';
UPDATE supplier SET  inUse = 0 where supplierid = 21;
UPDATE save SET  savecurrentvalue = '-42501306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-42451306.00','50000', '1', '1', 'ايصال دفع لمورد', '849', '-42501306', '2026-10-21 21:00:53', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1508
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-21', '1', '0', '0', '2026-10-21 21:00:53','ايصال دفع لمورد ( فورجيت - مورد ) ','1','0','0','0','849','supplierReportsController.php?do=show&id=849'); -- id=4281
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4281', '440', '50000', '','0'); -- id=4395
UPDATE accountstree SET name = 'فورجيت - مورد', customName = 'فورجيت - مورد', customNameEn = 'فورجيت - مورد', nameEn = 'فورجيت - مورد', parent = '81', accountNature = '1', theValue = '97200', 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 = '440';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4281', '383', '50000', '','0'); -- id=4283
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-42501309.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 = '21', supplierdebtchangebefore = '381145.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '331145.00', supplierdebtchangedate = '2026-10-21 21:00:40', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4281',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='693230',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='331145', paySerialNo='186',tagids='' WHERE supplierdebtchangeid = '849';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:53', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=17157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-21 21:00:55', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=17158
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:30:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:00:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-21 21:00:56', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=17159
UPDATE product SET productName = 'كود 901', productDescription = '', productCatId = '111', productBuyPrice = '550.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01518',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550.00',lastbuyprice_withDiscount = '495',meanbuyprice = '550.00',meanbuyprice_withDiscount = '495' , productbuypricereal = '550.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='495',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='550',meanbuyprice_withTax='550',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='495',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1518';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1518, 1,'2026-10-21 21:10:24',1)
                ON DUPLICATE KEY UPDATE productid = 1518, edited = 1, sysdate = '2026-10-21 21:10:24', userid = 1; -- id=2312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:40:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:10:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:10:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:40:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:10:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:10:36', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17161
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:41:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:11:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 21:11:19', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17162
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-21 17:41:19";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 21:11:19', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17163
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:41:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:11:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:11:23', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=17164
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:41:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:11:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 21:11:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17165
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-21 17:41:35";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 21:11:35', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:41:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:11:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:11:40', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17167
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:42:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:12:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:12:33', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=17168
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 ('موديل 35 توب سيكرت','','19','550','575','0','0','2026-10-21','0','1','0','','0','0','0','0','0','550','550','550','550','550','0','4.55','0','0','.','0','0','0','550','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','550','550','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','550','0','0','0','0','0','0','','','0','0','0','0'); -- id=2377
UPDATE product SET productName = 'موديل 35 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550', productSellAllPrice = '575', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02377',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2377';
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', '2377', '1', '2026-10-21', '1', '0','0237701','575','0','0','550','','0','0','0','0','0','0','0','0','0','0'); -- id=2377
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2377', '1', '0', '1', '2026-10-21'); -- id=3771
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2377', '1', '0', '0', '2377', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16283
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2377, 1,'2026-10-21 21:12:33',1)
                ON DUPLICATE KEY UPDATE productid = 2377, edited = 1, sysdate = '2026-10-21 21:12:33', userid = 1; -- id=3552
UPDATE product SET productName = 'موديل 35 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550.00', productSellAllPrice = '575.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02377',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2377';
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 ('موديل 36 توب سيكرت','','19','550','575','0','0','2026-10-21','0','1','0','','0','0','0','0','0','550','550','550','550','550','0','4.55','0','0','.','0','0','0','550','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','550','550','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','550','0','0','0','0','0','0','','','0','0','0','0'); -- id=2378
UPDATE product SET productName = 'موديل 36 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550', productSellAllPrice = '575', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02378',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2378';
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', '2378', '1', '2026-10-21', '1', '0','0237801','575','0','0','550','','0','0','0','0','0','0','0','0','0','0'); -- id=2378
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2378', '1', '0', '1', '2026-10-21'); -- id=3772
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2378', '1', '0', '0', '2378', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16284
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2378, 1,'2026-10-21 21:12:33',1)
                ON DUPLICATE KEY UPDATE productid = 2378, edited = 1, sysdate = '2026-10-21 21:12:33', userid = 1; -- id=3553
UPDATE product SET productName = 'موديل 36 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550.00', productSellAllPrice = '575.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02378',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2378';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:42:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:12:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:12:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17169
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:42:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:12:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:12:35', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=17170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:43:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:13:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:13:35', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=17171
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 ('06ad9009373238', '2026-10-21 21:12:35', '65', '555450.00', '653270', '0', '0', '97820.00',  '97820.00', '0', '97820', '1', '2026-10-21 21:13:35', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=308
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 ('02377', '308', '19', '2377', '32', '550', '17600.00', '0', '', '2026-10-21 21:13:35', '2377','','','0','0','0','0','0',null,'550','17600','0','0','0','0','0','0','0','0','1'); -- id=1701
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:12:35', 1, 2377, 0, 0
                    , 550, 32, 0, 0, 1, '2026-10-21 21:13:35')
                ON DUPLICATE KEY UPDATE buyprice = 550,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:13:35' ; -- id=7022
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2377', '550', '32', '0', 'buyBillController.php', '1701', '', '0', '0'); -- id=1250
UPDATE product SET  productBuyPrice = "550" WHERE productId = 2377 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1701 ;
UPDATE product SET productName = 'موديل 35 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550.00', productSellAllPrice = '575.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02377',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2377';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 550, meanbuyprice_withDiscount = 550
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where buybilldetailid = 1701;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 2377;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3771';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2377', '1', '32', '0', '308', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-21 21:12:35','0','0'); -- id=16285
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 ('02378', '308', '19', '2378', '24', '550', '13200.00', '0', '', '2026-10-21 21:13:35', '2378','','','0','0','0','0','0',null,'550','13200','0','0','0','0','0','0','0','0','1'); -- id=1702
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:12:35', 1, 2378, 0, 0
                    , 550, 24, 0, 0, 1, '2026-10-21 21:13:35')
                ON DUPLICATE KEY UPDATE buyprice = 550,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:13:35' ; -- id=7023
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2378', '550', '24', '0', 'buyBillController.php', '1702', '', '0', '0'); -- id=1251
UPDATE product SET  productBuyPrice = "550" WHERE productId = 2378 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1702 ;
UPDATE product SET productName = 'موديل 36 توب سيكرت', productDescription = '', productCatId = '19', productBuyPrice = '550.00', productSellAllPrice = '575.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02378',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',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='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2378';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 550, meanbuyprice_withDiscount = 550
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where buybilldetailid = 1702;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 2378;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3772';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2378', '1', '24', '0', '308', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-21 21:12:35','0','0'); -- id=16286
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 ('09810', '308', '19', '845', '60', '480', '28800.00', '0', '', '2026-10-21 21:13:35', '845','','','0','0','0','0','0',null,'480','28800','0','0','0','0','0','0','0','0','1'); -- id=1703
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:12:35', 1, 845, 0, 0
                    , 480, 60, 0, 0, 1, '2026-10-21 21:13:35')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:13:35' ; -- id=7024
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('845', '480', '60', '0', 'buyBillController.php', '1703', '', '0', '0'); -- id=1252
UPDATE product SET  productBuyPrice = "480" WHERE productId = 845 ;
UPDATE buybilldetail SET  quantitybefore = 5 WHERE buybilldetailid = 1703 ;
UPDATE product SET productName = 'توب سيكرت 2362', productDescription = '', productCatId = '19', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09810',type ='0', expireDate = '0' , dailyentryId = '200',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480.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='480',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9810',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='480',meanbuyprice_withTax='480',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='480',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 = '845';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 1703;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 845;
UPDATE storedetail SET  productquantity = '65', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '845';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('845', '1', '60', '0', '308', 'اضافة فاتورة مشتريات', 'buyBillController.php', '5', '65', '1', '2026-10-21 21:12:35','0','0'); -- id=16287
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 ('09809', '308', '19', '844', '78', '490', '38220.00', '0', '', '2026-10-21 21:13:35', '844','','','0','0','0','0','0',null,'490','38220','0','0','0','0','0','0','0','0','1'); -- id=1704
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:12:35', 1, 844, 0, 0
                    , 490, 78, 0, 0, 1, '2026-10-21 21:13:35')
                ON DUPLICATE KEY UPDATE buyprice = 490,
                        buyQuantity =buyQuantity+78, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:13:35' ; -- id=7025
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('844', '490', '78', '0', 'buyBillController.php', '1704', '', '0', '0'); -- id=1253
UPDATE product SET  productBuyPrice = "490" WHERE productId = 844 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 1704 ;
UPDATE product SET productName = 'توب سيكرت 2391', productDescription = '', productCatId = '19', productBuyPrice = '490.00', productSellAllPrice = '510.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09809',type ='0', expireDate = '0' , dailyentryId = '199',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490.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='490',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9809',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='490',meanbuyprice_withTax='490',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='490',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 = '844';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 490, meanbuyprice_withDiscount = 490
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where buybilldetailid = 1704;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 844;
UPDATE storedetail SET  productquantity = '81', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '844';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('844', '1', '78', '0', '308', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '81', '1', '2026-10-21 21:12:35','0','0'); -- id=16288
UPDATE supplier SET  suppliercurrentDebt = '653270',suppliercurrentDebtInCurrency= '653270' , userid = '1', supplierdate = '2026-10-21 21:13:35'   WHERE supplierid = '65';
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 ('65', '555450.00', '97820', '0', 'اضافة فاتورة مشتريات', '308', '653270', '2026-10-21 21:12:35', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','97820','1','555450','97820','653270','0',''); -- id=850
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97820', '97820', '2026-10-21', '1', '0', '0', '2026-10-21 21:13:35','اضافة فاتورة مشتريات رقم 308','1','0',null,'0','308','buyBillController.php?do=details&id=308'); -- id=4282
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4282', '382', '97820', '','0'); -- id=4396
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25533462.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 ('4282', '484', '97820', '','0'); -- id=4284
UPDATE accountstree SET name = 'توب سيكرت - مورد', customName = 'توب سيكرت - مورد', customNameEn = 'توب سيكرت - مورد', nameEn = 'توب سيكرت - مورد', parent = '81', accountNature = '1', theValue = '-221630', 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 = '484';
update buybill set dailyentryid='4282,0' where buybillid=308;
COMMIT;
UPDATE product SET overAllAveragePrice = 490 WHERE productId = 844;UPDATE product SET overAllAveragePrice = 480 WHERE productId = 845;UPDATE product SET overAllAveragePrice = 550 WHERE productId = 2377;UPDATE product SET overAllAveragePrice = 550 WHERE productId = 2378;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:43:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:13:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:13:36', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=308'); -- id=17172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:43:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:13:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:13:57', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=308&type=2'); -- id=17173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:50:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:20:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:20:36', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=17174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:11', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17175
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:19', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17176
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:26', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=17179
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:51:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:21:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:21:49', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:52:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:22:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:22:12', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=17181
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 ('سويت شيرت 495 مصطفي زورو','','153','470','495','0','0','2026-10-21','0','1','0','','0','0','0','0','0','470','470','470','470','470','0','5.32','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=2379
UPDATE product SET productName = 'سويت شيرت 495 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '470', productSellAllPrice = '495', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02379',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '5.32' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2379';
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', '2379', '1.00', '2026-10-21', '1', '0','0237901','495','0','0','470','','0','0','0','0','0','0','0','0','0','0'); -- id=2379
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2379', '1', '0', '1', '2026-10-21'); -- id=3773
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2379', '1', '0', '0', '2379', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-21','0','0'); -- id=16289
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2379, 1,'2026-10-21 21:22:12',1)
                ON DUPLICATE KEY UPDATE productid = 2379, edited = 1, sysdate = '2026-10-21 21:22:12', userid = 1; -- id=3554
UPDATE product SET productName = 'سويت شيرت 495 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '470.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02379',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '5.32' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2379';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:52:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:22:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:22:13', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=17182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:53:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:23:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:23:15', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=17183
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 ('06ad902749f89e', '2026-10-21 21:20:36', '162', '306580.00', '458185', '0', '0', '151605.00',  '151605.00', '0', '151605', '1', '2026-10-21 21:23:15', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=309
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 ('02379', '309', '153', '2379', '63', '470', '29610.00', '0', '', '2026-10-21 21:23:15', '2379','','','0','0','0','0','0',null,'470','29610','0','0','0','0','0','0','0','0','1'); -- id=1705
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:20:36', 1, 2379, 0, 0
                    , 470, 63, 0, 0, 1, '2026-10-21 21:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+63, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:23:15' ; -- id=7026
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2379', '470', '63', '0', 'buyBillController.php', '1705', '', '0', '0'); -- id=1254
UPDATE product SET  productBuyPrice = "470" WHERE productId = 2379 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1705 ;
UPDATE product SET productName = 'سويت شيرت 495 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '470.00', productSellAllPrice = '495.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-21', conditions = '0', userId = '1', limitamount = '0', parcode = '02379',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.32' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2379';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 1705;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 2379;
UPDATE storedetail SET  productquantity = '63', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '3773';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2379', '1', '63', '0', '309', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '63', '1', '2026-10-21 21:20:36','0','0'); -- id=16290
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 ('01921', '309', '153', '1921', '63', '460', '28980.00', '0', '', '2026-10-21 21:23:15', '1921','','','0','0','0','0','0',null,'460','28980','0','0','0','0','0','0','0','0','1'); -- id=1706
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:20:36', 1, 1921, 0, 0
                    , 460, 63, 0, 0, 1, '2026-10-21 21:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+63, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:23:15' ; -- id=7027
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1921', '460', '63', '0', 'buyBillController.php', '1706', '', '0', '0'); -- id=1255
UPDATE product SET  productBuyPrice = "460" WHERE productId = 1921 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1706 ;
UPDATE product SET productName = 'سويت شيرت 485 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '460.00', productSellAllPrice = '485.00', productSellUnitPrice = '485.00', productSellHalfPrice = '485.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01921',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 = '5.43' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1921';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1706;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 1921;
UPDATE storedetail SET  productquantity = '63', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2938';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1921', '1', '63', '0', '309', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '63', '1', '2026-10-21 21:20:36','0','0'); -- id=16291
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 ('01919', '309', '153', '1919', '63', '425', '26775.00', '0', '', '2026-10-21 21:23:15', '1919','','','0','0','0','0','0',null,'425','26775','0','0','0','0','0','0','0','0','1'); -- id=1707
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:20:36', 1, 1919, 0, 0
                    , 425, 63, 0, 0, 1, '2026-10-21 21:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 425,
                        buyQuantity =buyQuantity+63, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:23:15' ; -- id=7028
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1919', '425', '63', '0', 'buyBillController.php', '1707', '', '0', '0'); -- id=1256
UPDATE product SET  productBuyPrice = "425" WHERE productId = 1919 ;
UPDATE buybilldetail SET  quantitybefore = 28 WHERE buybilldetailid = 1707 ;
UPDATE product SET productName = 'سويت شيرت 450 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '425.00', productSellAllPrice = '450.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01919',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '425',lastbuyprice_withDiscount = '425',meanbuyprice = '425',meanbuyprice_withDiscount = '425' , productbuypricereal = '0.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='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 buybilldetail SET  lastbuyprice = 425 , meanbuyprice = 425, lastbuyprice_withDiscount = 425, meanbuyprice_withDiscount = 425
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where buybilldetailid = 1707;
UPDATE productunit SET proUnitBuyPrice  = 425 * productnumber WHERE productid = 1919;
UPDATE storedetail SET  productquantity = '91', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2936';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1919', '1', '63', '0', '309', 'اضافة فاتورة مشتريات', 'buyBillController.php', '28', '91', '1', '2026-10-21 21:20:36','0','0'); -- id=16292
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 ('01921', '309', '153', '1921', '72', '460', '33120.00', '0', '', '2026-10-21 21:23:15', '1921','','','0','0','0','0','0',null,'460','33120','0','0','0','0','0','0','0','0','1'); -- id=1708
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:20:36', 1, 1921, 0, 0
                    , 460, 72, 0, 0, 1, '2026-10-21 21:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:23:15' ; -- id=7027
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1921', '460', '72', '0', 'buyBillController.php', '1708', '', '0', '0'); -- id=1257
UPDATE product SET  productBuyPrice = "460" WHERE productId = 1921 ;
UPDATE buybilldetail SET  quantitybefore = 63 WHERE buybilldetailid = 1708 ;
UPDATE product SET productName = 'سويت شيرت 485 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '460.00', productSellAllPrice = '485.00', productSellUnitPrice = '485.00', productSellHalfPrice = '485.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01921',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 = '5.43' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1921';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1708;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 1921;
UPDATE storedetail SET  productquantity = '135', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2938';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1921', '1', '72', '0', '309', 'اضافة فاتورة مشتريات', 'buyBillController.php', '63', '135', '1', '2026-10-21 21:20:36','0','0'); -- id=16293
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 ('01921', '309', '153', '1921', '72', '460', '33120.00', '0', '', '2026-10-21 21:23:15', '1921','','','0','0','0','0','0',null,'460','33120','0','0','0','0','0','0','0','0','1'); -- id=1709
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-21 21:20:36', 1, 1921, 0, 0
                    , 460, 72, 0, 0, 1, '2026-10-21 21:23:15')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-21 21:23:15' ; -- id=7027
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1921', '460', '72', '0', 'buyBillController.php', '1709', '', '0', '0'); -- id=1258
UPDATE product SET  productBuyPrice = "460" WHERE productId = 1921 ;
UPDATE buybilldetail SET  quantitybefore = 135 WHERE buybilldetailid = 1709 ;
UPDATE product SET productName = 'سويت شيرت 485 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '460.00', productSellAllPrice = '485.00', productSellUnitPrice = '485.00', productSellHalfPrice = '485.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01921',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 = '5.43' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1921';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1709;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 1921;
UPDATE storedetail SET  productquantity = '207', userid = '1', storedetaildate = '2026-10-21' WHERE storedetailid = '2938';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1921', '1', '72', '0', '309', 'اضافة فاتورة مشتريات', 'buyBillController.php', '135', '207', '1', '2026-10-21 21:20:36','0','0'); -- id=16294
UPDATE supplier SET  suppliercurrentDebt = '458185',suppliercurrentDebtInCurrency= '458185' , userid = '1', supplierdate = '2026-10-21 21:23:15'   WHERE supplierid = '162';
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 ('162', '306580.00', '151605', '0', 'اضافة فاتورة مشتريات', '309', '458185', '2026-10-21 21:20:36', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','151605','1','306580','151605','458185','0',''); -- id=851
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '151605', '151605', '2026-10-21', '1', '0', '0', '2026-10-21 21:23:15','اضافة فاتورة مشتريات رقم 309','1','0',null,'0','309','buyBillController.php?do=details&id=309'); -- id=4283
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4283', '382', '151605', '','0'); -- id=4397
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '25685067.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 ('4283', '645', '151605', '','0'); -- id=4285
UPDATE accountstree SET name = 'مصطفي زورو', customName = 'مصطفي زورو', customNameEn = 'مصطفي زورو', nameEn = 'مصطفي زورو', parent = '81', accountNature = '1', theValue = '458185', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 20:29:34' WHERE id = '645';
update buybill set dailyentryid='4283,0' where buybillid=309;
COMMIT;
UPDATE product SET overAllAveragePrice = 425 WHERE productId = 1919;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 1921;UPDATE product SET overAllAveragePrice = 470 WHERE productId = 2379;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:53:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:23:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-21 21:23:15', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=309'); -- id=17184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:53:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:23:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:23:20', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=309&type=2'); -- id=17185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 17:54:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-21 21:24:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-21 21:24:38', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=309&type=2'); -- id=17186
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:02:44";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:02: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-21 19:02:51";
UPDATE user SET loginip = "105.192.35.192", lastactivetime = "2026-10-21 22:32:51", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-21 22:32:51', '1', '', '105.192.35.192', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=17187
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-21 19:02:52";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-21 22:32:52', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=17188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:02:56";
UPDATE user SET loginip = "105.192.35.192", lastactivetime = "2026-10-21 22:32:56", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 22:32:56', '1', '', '105.192.35.192', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=17189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:03:10";
UPDATE user SET loginip = "105.192.35.192", lastactivetime = "2026-10-21 22:33:10", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-21 22:33:10', '1', 'show', '105.192.35.192', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=17190
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:10:24";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:12:21";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:42:21", 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-21 19:12:21";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-21 22:42:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:13:47";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:43:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:13:52";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:43:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:14:19";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:44:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:14:26";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:44:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:14:49";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:44:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:14:51";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:44:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:15:28";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:45:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:16:37";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:46:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:16:50";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:46:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:16:57";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:46:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:17:24";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:47:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:18:31";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:48:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:22:00";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:52:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:22:04";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:52:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-21 19:23:40";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-21 22:53:40", deviceType = "DESKTOP" WHERE userid = -1;
