UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:23:08";
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-15 07:23:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:53:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-15 10:53:25', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=4246
UPDATE programsettings SET companyname = 'الشاذلي للاضاءه الحديثه', address = ' العنوان :كفر بهيده بجوار المستشفي<br/> المرتجع خلال 3 اشهورمن تاريخ الفاتوره<br/>الا الاسلاك خلال 20يوم<br/>ممنوع رجوع الاسلاك والليد المفتوح', specializtion = '', phone = '01096879556-01091024885', faxnumber = '', email = 'mousa_maged@hotmail.com', website = '', logo = 'a5583ab9a3a85fbef9bfbbd46031c2d2.jpeg', roundnumbers = '1', saveprinting = '1', deptprinting = '1', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '2',clientsearchvalue = '2', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = 'D', taxcard = '123456789123', commercialregistration = '1234', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-10-15',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='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='9aad922c8dc25742295df2779fde48ab62230719d569b9aa71bf6d5e0e08471c7dbda60d508155af60894a0ba3bbd86ffbee699027a409bcd9ca11e28a846cc5',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-15 07:23:32";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-15 10:53:32', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=4247
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:24:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:54:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 10:54:38', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=4248
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:24:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:54:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 10:54:47', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=4249
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3110.25', '3110.25', '2026-10-15', '1', '0', '0', '2026-10-15 10:55:02','تعديل منتج (لفه سلك 1 ملي الفؤاد 100 متر ) السعر من (650.00) الى (715) و الكميه (47.85)','1','0',null,'0','249','productController.php?do=edit&id=249'); -- id=1622
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1622', '382', '3110.25', '','0'); -- id=1636
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2328890.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1622', '53', '3110.25', '','0'); -- id=1626
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '3169', 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  = 715 * productnumber WHERE productid = 249;
UPDATE product SET productName = 'لفه سلك 1 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '715', productSellAllPrice = '745.00', productSellUnitPrice = '790.00', productSellHalfPrice = '745.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00249',type ='0', expireDate = '0' , dailyentryId = '297',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '688.92',meanbuyprice_withDiscount = '688.92' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.22' , buyhalf_precentage = '8.22' , buypart_precentage = '10.96',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='682.5',meanbuyprice_withTax='688.92',price4='0',price5='0',price6='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='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 = '249';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (249, 1,'2026-10-15 10:55:04',1)
                ON DUPLICATE KEY UPDATE productid = 249, edited = 1, sysdate = '2026-10-15 10:55:04', userid = 1; -- id=263
UPDATE productunit SET proUnitSellAllPrice  = 790 * productnumber  WHERE productid = 249;
UPDATE product SET productName = 'لفه سلك 1 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '715.00', productSellAllPrice = '790', productSellUnitPrice = '790.00', productSellHalfPrice = '745.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00249',type ='0', expireDate = '0' , dailyentryId = '297',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '688.92',meanbuyprice_withDiscount = '688.92' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.22' , buyhalf_precentage = '8.22' , buypart_precentage = '10.96',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='682.5',meanbuyprice_withTax='688.92',price4='0',price5='0',price6='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='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 = '249';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (249, 1,'2026-10-15 10:55:06',1)
                ON DUPLICATE KEY UPDATE productid = 249, edited = 1, sysdate = '2026-10-15 10:55:06', userid = 1; -- id=263
UPDATE productunit SET proUnitSellHalfPrice = 790 * productnumber WHERE productid = 249;
UPDATE product SET productName = 'لفه سلك 1 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '715.00', productSellAllPrice = '790.00', productSellUnitPrice = '790.00', productSellHalfPrice = '790', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00249',type ='0', expireDate = '0' , dailyentryId = '297',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '688.92',meanbuyprice_withDiscount = '688.92' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.22' , buyhalf_precentage = '8.22' , buypart_precentage = '10.96',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='682.5',meanbuyprice_withTax='688.92',price4='0',price5='0',price6='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='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 = '249';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (249, 1,'2026-10-15 10:55:08',1)
                ON DUPLICATE KEY UPDATE productid = 249, edited = 1, sysdate = '2026-10-15 10:55:08', userid = 1; -- id=263
UPDATE productunit SET proUnitSellUnitPrice = 820 * productnumber WHERE productid = 249;
UPDATE product SET productName = 'لفه سلك 1 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '715.00', productSellAllPrice = '790.00', productSellUnitPrice = '820', productSellHalfPrice = '790.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00249',type ='0', expireDate = '0' , dailyentryId = '297',isService = '0',isOptic = '0',lastbuyprice = '650.00',lastbuyprice_withDiscount = '650',meanbuyprice = '688.92',meanbuyprice_withDiscount = '688.92' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.22' , buyhalf_precentage = '8.22' , buypart_precentage = '10.96',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='682.5',meanbuyprice_withTax='688.92',price4='0',price5='0',price6='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='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 = '249';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (249, 1,'2026-10-15 10:55:16',1)
                ON DUPLICATE KEY UPDATE productid = 249, edited = 1, sysdate = '2026-10-15 10:55:16', userid = 1; -- id=263
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5148', '5148', '2026-10-15', '1', '0', '0', '2026-10-15 10:55:44','تعديل منتج (لفه سلك 2 ملي الفؤاد 100 متر ) السعر من (1395.00) الى (1538) و الكميه (36)','1','0',null,'0','250','productController.php?do=edit&id=250'); -- id=1623
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1623', '382', '5148', '','0'); -- id=1637
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2334038.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1623', '53', '5148', '','0'); -- id=1627
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '8317', 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  = 1538 * productnumber WHERE productid = 250;
UPDATE product SET productName = 'لفه سلك 2 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1538', productSellAllPrice = '1525.00', productSellUnitPrice = '1595.00', productSellHalfPrice = '1525.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00250',type ='0', expireDate = '0' , dailyentryId = '298',isService = '0',isOptic = '0',lastbuyprice = '1395.00',lastbuyprice_withDiscount = '1395',meanbuyprice = '1466.5',meanbuyprice_withDiscount = '1466.5' , productbuypricereal = '1395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.32' , buyhalf_precentage = '9.32' , buypart_precentage = '14.34',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1466.5',meanbuyprice_withTax='1466.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='1395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '250';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (250, 1,'2026-10-15 10:55:45',1)
                ON DUPLICATE KEY UPDATE productid = 250, edited = 1, sysdate = '2026-10-15 10:55:45', userid = 1; -- id=264
UPDATE productunit SET proUnitSellAllPrice  = 1650 * productnumber  WHERE productid = 250;
UPDATE product SET productName = 'لفه سلك 2 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1538.00', productSellAllPrice = '1650', productSellUnitPrice = '1595.00', productSellHalfPrice = '1525.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00250',type ='0', expireDate = '0' , dailyentryId = '298',isService = '0',isOptic = '0',lastbuyprice = '1395.00',lastbuyprice_withDiscount = '1395',meanbuyprice = '1466.50',meanbuyprice_withDiscount = '1466.5' , productbuypricereal = '1395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.32' , buyhalf_precentage = '9.32' , buypart_precentage = '14.34',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1466.5',meanbuyprice_withTax='1466.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='1395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '250';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (250, 1,'2026-10-15 10:55:48',1)
                ON DUPLICATE KEY UPDATE productid = 250, edited = 1, sysdate = '2026-10-15 10:55:48', userid = 1; -- id=264
UPDATE productunit SET proUnitSellHalfPrice = 1650 * productnumber WHERE productid = 250;
UPDATE product SET productName = 'لفه سلك 2 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1538.00', productSellAllPrice = '1650.00', productSellUnitPrice = '1595.00', productSellHalfPrice = '1650', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00250',type ='0', expireDate = '0' , dailyentryId = '298',isService = '0',isOptic = '0',lastbuyprice = '1395.00',lastbuyprice_withDiscount = '1395',meanbuyprice = '1466.50',meanbuyprice_withDiscount = '1466.5' , productbuypricereal = '1395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.32' , buyhalf_precentage = '9.32' , buypart_precentage = '14.34',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1466.5',meanbuyprice_withTax='1466.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='1395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '250';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (250, 1,'2026-10-15 10:55:50',1)
                ON DUPLICATE KEY UPDATE productid = 250, edited = 1, sysdate = '2026-10-15 10:55:50', userid = 1; -- id=264
UPDATE productunit SET proUnitSellUnitPrice = 1695 * productnumber WHERE productid = 250;
UPDATE product SET productName = 'لفه سلك 2 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1538.00', productSellAllPrice = '1650.00', productSellUnitPrice = '1695', productSellHalfPrice = '1650.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00250',type ='0', expireDate = '0' , dailyentryId = '298',isService = '0',isOptic = '0',lastbuyprice = '1395.00',lastbuyprice_withDiscount = '1395',meanbuyprice = '1466.50',meanbuyprice_withDiscount = '1466.5' , productbuypricereal = '1395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.32' , buyhalf_precentage = '9.32' , buypart_precentage = '14.34',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1466.5',meanbuyprice_withTax='1466.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='1395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '250';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (250, 1,'2026-10-15 10:55:56',1)
                ON DUPLICATE KEY UPDATE productid = 250, edited = 1, sysdate = '2026-10-15 10:55:56', userid = 1; -- id=264
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6475', '6475', '2026-10-15', '1', '0', '0', '2026-10-15 10:56:15','تعديل منتج (لفه سلك 3 ملي الفؤاد 100 متر ) السعر من (2000.00) الى (2175) و الكميه (37)','1','0',null,'0','251','productController.php?do=edit&id=251'); -- id=1624
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1624', '382', '6475', '','0'); -- id=1638
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2340513.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1624', '53', '6475', '','0'); -- id=1628
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '14792', 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  = 2175 * productnumber WHERE productid = 251;
UPDATE product SET productName = 'لفه سلك 3 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2175', productSellAllPrice = '2190.00', productSellUnitPrice = '2250.00', productSellHalfPrice = '2190.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00251',type ='0', expireDate = '0' , dailyentryId = '299',isService = '0',isOptic = '0',lastbuyprice = '2000.00',lastbuyprice_withDiscount = '2000',meanbuyprice = '2087.5',meanbuyprice_withDiscount = '2087.5' , productbuypricereal = '2000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.50' , buyhalf_precentage = '9.50' , buypart_precentage = '12.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2087.5',meanbuyprice_withTax='2087.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='2000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '251';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (251, 1,'2026-10-15 10:56:16',1)
                ON DUPLICATE KEY UPDATE productid = 251, edited = 1, sysdate = '2026-10-15 10:56:16', userid = 1; -- id=265
UPDATE productunit SET proUnitSellAllPrice  = 2290 * productnumber  WHERE productid = 251;
UPDATE product SET productName = 'لفه سلك 3 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2175.00', productSellAllPrice = '2290', productSellUnitPrice = '2250.00', productSellHalfPrice = '2190.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00251',type ='0', expireDate = '0' , dailyentryId = '299',isService = '0',isOptic = '0',lastbuyprice = '2000.00',lastbuyprice_withDiscount = '2000',meanbuyprice = '2087.50',meanbuyprice_withDiscount = '2087.5' , productbuypricereal = '2000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.50' , buyhalf_precentage = '9.50' , buypart_precentage = '12.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2087.5',meanbuyprice_withTax='2087.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='2000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '251';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (251, 1,'2026-10-15 10:56:19',1)
                ON DUPLICATE KEY UPDATE productid = 251, edited = 1, sysdate = '2026-10-15 10:56:19', userid = 1; -- id=265
UPDATE productunit SET proUnitSellHalfPrice = 2290 * productnumber WHERE productid = 251;
UPDATE product SET productName = 'لفه سلك 3 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2175.00', productSellAllPrice = '2290.00', productSellUnitPrice = '2250.00', productSellHalfPrice = '2290', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00251',type ='0', expireDate = '0' , dailyentryId = '299',isService = '0',isOptic = '0',lastbuyprice = '2000.00',lastbuyprice_withDiscount = '2000',meanbuyprice = '2087.50',meanbuyprice_withDiscount = '2087.5' , productbuypricereal = '2000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.50' , buyhalf_precentage = '9.50' , buypart_precentage = '12.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2087.5',meanbuyprice_withTax='2087.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='2000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '251';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (251, 1,'2026-10-15 10:56:21',1)
                ON DUPLICATE KEY UPDATE productid = 251, edited = 1, sysdate = '2026-10-15 10:56:21', userid = 1; -- id=265
UPDATE productunit SET proUnitSellUnitPrice = 2395 * productnumber WHERE productid = 251;
UPDATE product SET productName = 'لفه سلك 3 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2175.00', productSellAllPrice = '2290.00', productSellUnitPrice = '2395', productSellHalfPrice = '2290.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00251',type ='0', expireDate = '0' , dailyentryId = '299',isService = '0',isOptic = '0',lastbuyprice = '2000.00',lastbuyprice_withDiscount = '2000',meanbuyprice = '2087.50',meanbuyprice_withDiscount = '2087.5' , productbuypricereal = '2000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.50' , buyhalf_precentage = '9.50' , buypart_precentage = '12.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2087.5',meanbuyprice_withTax='2087.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='2000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '251';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (251, 1,'2026-10-15 10:56:39',1)
                ON DUPLICATE KEY UPDATE productid = 251, edited = 1, sysdate = '2026-10-15 10:56:39', userid = 1; -- id=265
UPDATE productunit SET proUnitSellUnitPrice = 2395 * productnumber WHERE productid = 251;
UPDATE product SET productName = 'لفه سلك 3 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2175.00', productSellAllPrice = '2290.00', productSellUnitPrice = '2395', productSellHalfPrice = '2290.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00251',type ='0', expireDate = '0' , dailyentryId = '299',isService = '0',isOptic = '0',lastbuyprice = '2000.00',lastbuyprice_withDiscount = '2000',meanbuyprice = '2087.50',meanbuyprice_withDiscount = '2087.5' , productbuypricereal = '2000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.50' , buyhalf_precentage = '9.50' , buypart_precentage = '12.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2087.5',meanbuyprice_withTax='2087.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='2000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '251';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (251, 1,'2026-10-15 10:57:13',1)
                ON DUPLICATE KEY UPDATE productid = 251, edited = 1, sysdate = '2026-10-15 10:57:13', userid = 1; -- id=265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:27:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:57:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 10:57:13', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4250
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:27:24";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:57:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 10:57:24', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4251
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:27:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 10:57:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 10:57:29', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=246'); -- id=4252
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4347', '4347', '2026-10-15', '1', '0', '0', '2026-10-15 11:00:32','تعديل منتج (لفه سلك 1.5 الفؤاد 100 متر ) السعر من (1040.00) الى (1103) و الكميه (69)','1','0',null,'0','208','productController.php?do=edit&id=208'); -- id=1625
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1625', '382', '4347', '','0'); -- id=1639
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2344860.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1625', '53', '4347', '','0'); -- id=1629
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '19139', 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  = 1103 * productnumber WHERE productid = 208;
UPDATE product SET productName = 'لفه سلك 1.5 الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1103', productSellAllPrice = '1165.00', productSellUnitPrice = '1230.00', productSellHalfPrice = '1165.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00208',type ='0', expireDate = '0' , dailyentryId = '235',isService = '0',isOptic = '0',lastbuyprice = '1040.00',lastbuyprice_withDiscount = '1040',meanbuyprice = '1067',meanbuyprice_withDiscount = '1067' , productbuypricereal = '1020.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.78' , buyhalf_precentage = '10.78' , buypart_precentage = '18.63',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1040',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1071.5',meanbuyprice_withTax='1067',price4='0',price5='0',price6='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='1040',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '208';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (208, 1,'2026-10-15 11:00:33',1)
                ON DUPLICATE KEY UPDATE productid = 208, edited = 1, sysdate = '2026-10-15 11:00:33', userid = 1; -- id=216
UPDATE productunit SET proUnitSellAllPrice  = 1200 * productnumber  WHERE productid = 208;
UPDATE product SET productName = 'لفه سلك 1.5 الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1103.00', productSellAllPrice = '1200', productSellUnitPrice = '1230.00', productSellHalfPrice = '1165.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00208',type ='0', expireDate = '0' , dailyentryId = '235',isService = '0',isOptic = '0',lastbuyprice = '1040.00',lastbuyprice_withDiscount = '1040',meanbuyprice = '1067.00',meanbuyprice_withDiscount = '1067' , productbuypricereal = '1020.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.78' , buyhalf_precentage = '10.78' , buypart_precentage = '18.63',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1040',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1071.5',meanbuyprice_withTax='1067',price4='0',price5='0',price6='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='1040',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '208';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (208, 1,'2026-10-15 11:00:35',1)
                ON DUPLICATE KEY UPDATE productid = 208, edited = 1, sysdate = '2026-10-15 11:00:35', userid = 1; -- id=216
UPDATE productunit SET proUnitSellHalfPrice = 1200 * productnumber WHERE productid = 208;
UPDATE product SET productName = 'لفه سلك 1.5 الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1103.00', productSellAllPrice = '1200.00', productSellUnitPrice = '1230.00', productSellHalfPrice = '1200', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00208',type ='0', expireDate = '0' , dailyentryId = '235',isService = '0',isOptic = '0',lastbuyprice = '1040.00',lastbuyprice_withDiscount = '1040',meanbuyprice = '1067.00',meanbuyprice_withDiscount = '1067' , productbuypricereal = '1020.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.78' , buyhalf_precentage = '10.78' , buypart_precentage = '18.63',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1040',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1071.5',meanbuyprice_withTax='1067',price4='0',price5='0',price6='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='1040',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '208';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (208, 1,'2026-10-15 11:00:37',1)
                ON DUPLICATE KEY UPDATE productid = 208, edited = 1, sysdate = '2026-10-15 11:00:37', userid = 1; -- id=216
UPDATE productunit SET proUnitSellUnitPrice = 1295 * productnumber WHERE productid = 208;
UPDATE product SET productName = 'لفه سلك 1.5 الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '1103.00', productSellAllPrice = '1200.00', productSellUnitPrice = '1295', productSellHalfPrice = '1200.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00208',type ='0', expireDate = '0' , dailyentryId = '235',isService = '0',isOptic = '0',lastbuyprice = '1040.00',lastbuyprice_withDiscount = '1040',meanbuyprice = '1067.00',meanbuyprice_withDiscount = '1067' , productbuypricereal = '1020.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.78' , buyhalf_precentage = '10.78' , buypart_precentage = '18.63',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1040',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1071.5',meanbuyprice_withTax='1067',price4='0',price5='0',price6='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='1040',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '208';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (208, 1,'2026-10-15 11:00:50',1)
                ON DUPLICATE KEY UPDATE productid = 208, edited = 1, sysdate = '2026-10-15 11:00:50', userid = 1; -- id=216
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3145', '3145', '2026-10-15', '1', '0', '0', '2026-10-15 11:01:13','تعديل منتج (لفه سلك 4 ملي الفؤاد 100 متر ) السعر من (2600.00) الى (2785) و الكميه (17)','1','0',null,'0','252','productController.php?do=edit&id=252'); -- id=1626
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1626', '382', '3145', '','0'); -- id=1640
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2348005.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1626', '53', '3145', '','0'); -- id=1630
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '22284', 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  = 2785 * productnumber WHERE productid = 252;
UPDATE product SET productName = 'لفه سلك 4 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2785', productSellAllPrice = '2890.00', productSellUnitPrice = '2945.00', productSellHalfPrice = '2890.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00252',type ='0', expireDate = '0' , dailyentryId = '300',isService = '0',isOptic = '0',lastbuyprice = '2600.00',lastbuyprice_withDiscount = '2600',meanbuyprice = '2692.5',meanbuyprice_withDiscount = '2692.5' , productbuypricereal = '2600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.15' , buyhalf_precentage = '11.15' , buypart_precentage = '13.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2692.5',meanbuyprice_withTax='2692.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='2600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '252';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (252, 1,'2026-10-15 11:01:14',1)
                ON DUPLICATE KEY UPDATE productid = 252, edited = 1, sysdate = '2026-10-15 11:01:14', userid = 1; -- id=266
UPDATE productunit SET proUnitSellAllPrice  = 2950 * productnumber  WHERE productid = 252;
UPDATE product SET productName = 'لفه سلك 4 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2785.00', productSellAllPrice = '2950', productSellUnitPrice = '2945.00', productSellHalfPrice = '2890.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00252',type ='0', expireDate = '0' , dailyentryId = '300',isService = '0',isOptic = '0',lastbuyprice = '2600.00',lastbuyprice_withDiscount = '2600',meanbuyprice = '2692.50',meanbuyprice_withDiscount = '2692.5' , productbuypricereal = '2600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.15' , buyhalf_precentage = '11.15' , buypart_precentage = '13.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2692.5',meanbuyprice_withTax='2692.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='2600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '252';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (252, 1,'2026-10-15 11:01:19',1)
                ON DUPLICATE KEY UPDATE productid = 252, edited = 1, sysdate = '2026-10-15 11:01:19', userid = 1; -- id=266
UPDATE productunit SET proUnitSellHalfPrice = 2950 * productnumber WHERE productid = 252;
UPDATE product SET productName = 'لفه سلك 4 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2785.00', productSellAllPrice = '2950.00', productSellUnitPrice = '2945.00', productSellHalfPrice = '2950', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00252',type ='0', expireDate = '0' , dailyentryId = '300',isService = '0',isOptic = '0',lastbuyprice = '2600.00',lastbuyprice_withDiscount = '2600',meanbuyprice = '2692.50',meanbuyprice_withDiscount = '2692.5' , productbuypricereal = '2600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.15' , buyhalf_precentage = '11.15' , buypart_precentage = '13.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2692.5',meanbuyprice_withTax='2692.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='2600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '252';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (252, 1,'2026-10-15 11:01:21',1)
                ON DUPLICATE KEY UPDATE productid = 252, edited = 1, sysdate = '2026-10-15 11:01:21', userid = 1; -- id=266
UPDATE productunit SET proUnitSellUnitPrice = 3095 * productnumber WHERE productid = 252;
UPDATE product SET productName = 'لفه سلك 4 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '2785.00', productSellAllPrice = '2950.00', productSellUnitPrice = '3095', productSellHalfPrice = '2950.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00252',type ='0', expireDate = '0' , dailyentryId = '300',isService = '0',isOptic = '0',lastbuyprice = '2600.00',lastbuyprice_withDiscount = '2600',meanbuyprice = '2692.50',meanbuyprice_withDiscount = '2692.5' , productbuypricereal = '2600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.15' , buyhalf_precentage = '11.15' , buypart_precentage = '13.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2692.5',meanbuyprice_withTax='2692.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='2600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '252';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (252, 1,'2026-10-15 11:01:27',1)
                ON DUPLICATE KEY UPDATE productid = 252, edited = 1, sysdate = '2026-10-15 11:01:27', userid = 1; -- id=266
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3770', '3770', '2026-10-15', '1', '0', '0', '2026-10-15 11:01:52','تعديل منتج (لفه سلك 6 ملي الفؤاد 100 متر ) السعر من (4000.00) الى (4290) و الكميه (13)','1','0',null,'0','253','productController.php?do=edit&id=253'); -- id=1627
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1627', '382', '3770', '','0'); -- id=1641
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2351775.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1627', '53', '3770', '','0'); -- id=1631
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '26054', 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  = 4290 * productnumber WHERE productid = 253;
UPDATE product SET productName = 'لفه سلك 6 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '4290', productSellAllPrice = '4200.00', productSellUnitPrice = '4315.00', productSellHalfPrice = '4200.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00253',type ='0', expireDate = '0' , dailyentryId = '301',isService = '0',isOptic = '0',lastbuyprice = '4000.00',lastbuyprice_withDiscount = '4000',meanbuyprice = '4145',meanbuyprice_withDiscount = '4145' , productbuypricereal = '4000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '5.00' , buypart_precentage = '7.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4145',meanbuyprice_withTax='4145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '253';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (253, 1,'2026-10-15 11:01:53',1)
                ON DUPLICATE KEY UPDATE productid = 253, edited = 1, sysdate = '2026-10-15 11:01:53', userid = 1; -- id=267
UPDATE productunit SET proUnitSellAllPrice  = 4450 * productnumber  WHERE productid = 253;
UPDATE product SET productName = 'لفه سلك 6 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '4290.00', productSellAllPrice = '4450', productSellUnitPrice = '4315.00', productSellHalfPrice = '4200.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00253',type ='0', expireDate = '0' , dailyentryId = '301',isService = '0',isOptic = '0',lastbuyprice = '4000.00',lastbuyprice_withDiscount = '4000',meanbuyprice = '4145.00',meanbuyprice_withDiscount = '4145' , productbuypricereal = '4000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '5.00' , buypart_precentage = '7.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4145',meanbuyprice_withTax='4145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '253';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (253, 1,'2026-10-15 11:01:56',1)
                ON DUPLICATE KEY UPDATE productid = 253, edited = 1, sysdate = '2026-10-15 11:01:56', userid = 1; -- id=267
UPDATE productunit SET proUnitSellHalfPrice = 4450 * productnumber WHERE productid = 253;
UPDATE product SET productName = 'لفه سلك 6 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '4290.00', productSellAllPrice = '4450.00', productSellUnitPrice = '4315.00', productSellHalfPrice = '4450', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00253',type ='0', expireDate = '0' , dailyentryId = '301',isService = '0',isOptic = '0',lastbuyprice = '4000.00',lastbuyprice_withDiscount = '4000',meanbuyprice = '4145.00',meanbuyprice_withDiscount = '4145' , productbuypricereal = '4000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '5.00' , buypart_precentage = '7.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4145',meanbuyprice_withTax='4145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '253';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (253, 1,'2026-10-15 11:01:58',1)
                ON DUPLICATE KEY UPDATE productid = 253, edited = 1, sysdate = '2026-10-15 11:01:58', userid = 1; -- id=267
UPDATE productunit SET proUnitSellUnitPrice = 4495 * productnumber WHERE productid = 253;
UPDATE product SET productName = 'لفه سلك 6 ملي الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '4290.00', productSellAllPrice = '4450.00', productSellUnitPrice = '4495', productSellHalfPrice = '4450.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00253',type ='0', expireDate = '0' , dailyentryId = '301',isService = '0',isOptic = '0',lastbuyprice = '4000.00',lastbuyprice_withDiscount = '4000',meanbuyprice = '4145.00',meanbuyprice_withDiscount = '4145' , productbuypricereal = '4000.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '5.00' , buypart_precentage = '7.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4145',meanbuyprice_withTax='4145',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '253';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (253, 1,'2026-10-15 11:02:04',1)
                ON DUPLICATE KEY UPDATE productid = 253, edited = 1, sysdate = '2026-10-15 11:02:04', userid = 1; -- id=267
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2026-10-15', '1', '0', '0', '2026-10-15 11:02:19','تعديل منتج (لفه سلك 10 ملي شعر الفؤاد 100 متر ) السعر من (6750.00) الى (7000) و الكميه (4)','1','0',null,'0','254','productController.php?do=edit&id=254'); -- id=1628
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1628', '382', '1000', '','0'); -- id=1642
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2352775.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1628', '53', '1000', '','0'); -- id=1632
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '27054', 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  = 7000 * productnumber WHERE productid = 254;
UPDATE product SET productName = 'لفه سلك 10 ملي شعر الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '7000', productSellAllPrice = '7050.00', productSellUnitPrice = '7250.00', productSellHalfPrice = '7050.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00254',type ='0', expireDate = '0' , dailyentryId = '302',isService = '0',isOptic = '0',lastbuyprice = '6750.00',lastbuyprice_withDiscount = '6750',meanbuyprice = '6831.31',meanbuyprice_withDiscount = '6831.31' , productbuypricereal = '6300.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.32' , buyhalf_precentage = '10.32' , buypart_precentage = '13.49',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6875',meanbuyprice_withTax='6831.31',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='6750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '254';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (254, 1,'2026-10-15 11:02:20',1)
                ON DUPLICATE KEY UPDATE productid = 254, edited = 1, sysdate = '2026-10-15 11:02:20', userid = 1; -- id=268
UPDATE productunit SET proUnitSellAllPrice  = 7300 * productnumber  WHERE productid = 254;
UPDATE product SET productName = 'لفه سلك 10 ملي شعر الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '7000.00', productSellAllPrice = '7300', productSellUnitPrice = '7250.00', productSellHalfPrice = '7050.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00254',type ='0', expireDate = '0' , dailyentryId = '302',isService = '0',isOptic = '0',lastbuyprice = '6750.00',lastbuyprice_withDiscount = '6750',meanbuyprice = '6831.31',meanbuyprice_withDiscount = '6831.31' , productbuypricereal = '6300.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.32' , buyhalf_precentage = '10.32' , buypart_precentage = '13.49',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6875',meanbuyprice_withTax='6831.31',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='6750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '254';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (254, 1,'2026-10-15 11:02:22',1)
                ON DUPLICATE KEY UPDATE productid = 254, edited = 1, sysdate = '2026-10-15 11:02:22', userid = 1; -- id=268
UPDATE productunit SET proUnitSellHalfPrice = 7300 * productnumber WHERE productid = 254;
UPDATE product SET productName = 'لفه سلك 10 ملي شعر الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '7000.00', productSellAllPrice = '7300.00', productSellUnitPrice = '7250.00', productSellHalfPrice = '7300', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00254',type ='0', expireDate = '0' , dailyentryId = '302',isService = '0',isOptic = '0',lastbuyprice = '6750.00',lastbuyprice_withDiscount = '6750',meanbuyprice = '6831.31',meanbuyprice_withDiscount = '6831.31' , productbuypricereal = '6300.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.32' , buyhalf_precentage = '10.32' , buypart_precentage = '13.49',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6875',meanbuyprice_withTax='6831.31',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='6750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '254';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (254, 1,'2026-10-15 11:02:24',1)
                ON DUPLICATE KEY UPDATE productid = 254, edited = 1, sysdate = '2026-10-15 11:02:24', userid = 1; -- id=268
UPDATE productunit SET proUnitSellUnitPrice = 7450 * productnumber WHERE productid = 254;
UPDATE product SET productName = 'لفه سلك 10 ملي شعر الفؤاد 100 متر ', productDescription = '', productCatId = '10', productBuyPrice = '7000.00', productSellAllPrice = '7300.00', productSellUnitPrice = '7450', productSellHalfPrice = '7300.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00254',type ='0', expireDate = '0' , dailyentryId = '302',isService = '0',isOptic = '0',lastbuyprice = '6750.00',lastbuyprice_withDiscount = '6750',meanbuyprice = '6831.31',meanbuyprice_withDiscount = '6831.31' , productbuypricereal = '6300.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.32' , buyhalf_precentage = '10.32' , buypart_precentage = '13.49',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6875',meanbuyprice_withTax='6831.31',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='6750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '254';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (254, 1,'2026-10-15 11:02:29',1)
                ON DUPLICATE KEY UPDATE productid = 254, edited = 1, sysdate = '2026-10-15 11:02:29', userid = 1; -- id=268
UPDATE productunit SET proUnitSellAllPrice  = 77 * productnumber  WHERE productid = 255;
UPDATE product SET productName = 'متر سلك 10 ملي شعر الفؤاد', productDescription = '', productCatId = '10', productBuyPrice = '65.00', productSellAllPrice = '77', productSellUnitPrice = '73.00', productSellHalfPrice = '69.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00255',type ='0', expireDate = '0' , dailyentryId = '303',isService = '0',isOptic = '0',lastbuyprice = '65.00',lastbuyprice_withDiscount = '65',meanbuyprice = '65.00',meanbuyprice_withDiscount = '65' , productbuypricereal = '65.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.15' , buyhalf_precentage = '6.15' , buypart_precentage = '12.31',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='65',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='65',meanbuyprice_withTax='65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='65',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '255';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (255, 1,'2026-10-15 11:02:31',1)
                ON DUPLICATE KEY UPDATE productid = 255, edited = 1, sysdate = '2026-10-15 11:02:31', userid = 1; -- id=269
UPDATE productunit SET proUnitSellHalfPrice = 77 * productnumber WHERE productid = 255;
UPDATE product SET productName = 'متر سلك 10 ملي شعر الفؤاد', productDescription = '', productCatId = '10', productBuyPrice = '65.00', productSellAllPrice = '77.00', productSellUnitPrice = '73.00', productSellHalfPrice = '77', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00255',type ='0', expireDate = '0' , dailyentryId = '303',isService = '0',isOptic = '0',lastbuyprice = '65.00',lastbuyprice_withDiscount = '65',meanbuyprice = '65.00',meanbuyprice_withDiscount = '65' , productbuypricereal = '65.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.15' , buyhalf_precentage = '6.15' , buypart_precentage = '12.31',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='65',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='65',meanbuyprice_withTax='65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='65',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '255';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (255, 1,'2026-10-15 11:02:33',1)
                ON DUPLICATE KEY UPDATE productid = 255, edited = 1, sysdate = '2026-10-15 11:02:33', userid = 1; -- id=269
UPDATE productunit SET proUnitSellUnitPrice = 77 * productnumber WHERE productid = 255;
UPDATE product SET productName = 'متر سلك 10 ملي شعر الفؤاد', productDescription = '', productCatId = '10', productBuyPrice = '65.00', productSellAllPrice = '77.00', productSellUnitPrice = '77', productSellHalfPrice = '77.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00255',type ='0', expireDate = '0' , dailyentryId = '303',isService = '0',isOptic = '0',lastbuyprice = '65.00',lastbuyprice_withDiscount = '65',meanbuyprice = '65.00',meanbuyprice_withDiscount = '65' , productbuypricereal = '65.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.15' , buyhalf_precentage = '6.15' , buypart_precentage = '12.31',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='65',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='65',meanbuyprice_withTax='65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='65',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '255';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (255, 1,'2026-10-15 11:02:38',1)
                ON DUPLICATE KEY UPDATE productid = 255, edited = 1, sysdate = '2026-10-15 11:02:38', userid = 1; -- id=269
UPDATE productunit SET proUnitSellAllPrice  = 125 * productnumber  WHERE productid = 256;
UPDATE product SET productName = 'متر سلك 16 ملي شعر', productDescription = '', productCatId = '10', productBuyPrice = '110.00', productSellAllPrice = '125', productSellUnitPrice = '120.00', productSellHalfPrice = '115.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00256',type ='0', expireDate = '0' , dailyentryId = '304',isService = '0',isOptic = '0',lastbuyprice = '110.00',lastbuyprice_withDiscount = '110',meanbuyprice = '110.00',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '4.55' , buypart_precentage = '9.09',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='110',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='110',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '256';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (256, 1,'2026-10-15 11:02:40',1)
                ON DUPLICATE KEY UPDATE productid = 256, edited = 1, sysdate = '2026-10-15 11:02:40', userid = 1; -- id=270
UPDATE productunit SET proUnitSellHalfPrice = 125 * productnumber WHERE productid = 256;
UPDATE product SET productName = 'متر سلك 16 ملي شعر', productDescription = '', productCatId = '10', productBuyPrice = '110.00', productSellAllPrice = '125.00', productSellUnitPrice = '120.00', productSellHalfPrice = '125', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00256',type ='0', expireDate = '0' , dailyentryId = '304',isService = '0',isOptic = '0',lastbuyprice = '110.00',lastbuyprice_withDiscount = '110',meanbuyprice = '110.00',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '4.55' , buypart_precentage = '9.09',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='110',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='110',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '256';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (256, 1,'2026-10-15 11:02:42',1)
                ON DUPLICATE KEY UPDATE productid = 256, edited = 1, sysdate = '2026-10-15 11:02:42', userid = 1; -- id=270
UPDATE productunit SET proUnitSellUnitPrice = 130 * productnumber WHERE productid = 256;
UPDATE product SET productName = 'متر سلك 16 ملي شعر', productDescription = '', productCatId = '10', productBuyPrice = '110.00', productSellAllPrice = '125.00', productSellUnitPrice = '130', productSellHalfPrice = '125.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00256',type ='0', expireDate = '0' , dailyentryId = '304',isService = '0',isOptic = '0',lastbuyprice = '110.00',lastbuyprice_withDiscount = '110',meanbuyprice = '110.00',meanbuyprice_withDiscount = '110' , productbuypricereal = '110.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '4.55' , buypart_precentage = '9.09',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='110',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='110',meanbuyprice_withTax='110',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='110',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '256';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (256, 1,'2026-10-15 11:02:46',1)
                ON DUPLICATE KEY UPDATE productid = 256, edited = 1, sysdate = '2026-10-15 11:02:46', userid = 1; -- id=270
UPDATE productunit SET proUnitSellAllPrice  = 230 * productnumber  WHERE productid = 257;
UPDATE product SET productName = 'متر سلك 25 ملي شعر ', productDescription = '', productCatId = '10', productBuyPrice = '205.00', productSellAllPrice = '230', productSellUnitPrice = '230.00', productSellHalfPrice = '215.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00257',type ='0', expireDate = '0' , dailyentryId = '305',isService = '0',isOptic = '0',lastbuyprice = '205.00',lastbuyprice_withDiscount = '205',meanbuyprice = '205.00',meanbuyprice_withDiscount = '205' , productbuypricereal = '205.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , buyhalf_precentage = '4.88' , buypart_precentage = '12.20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='205',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='205',meanbuyprice_withTax='205',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='205',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '257';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (257, 1,'2026-10-15 11:02:50',1)
                ON DUPLICATE KEY UPDATE productid = 257, edited = 1, sysdate = '2026-10-15 11:02:50', userid = 1; -- id=271
UPDATE productunit SET proUnitSellHalfPrice = 230 * productnumber WHERE productid = 257;
UPDATE product SET productName = 'متر سلك 25 ملي شعر ', productDescription = '', productCatId = '10', productBuyPrice = '205.00', productSellAllPrice = '230.00', productSellUnitPrice = '230.00', productSellHalfPrice = '230', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00257',type ='0', expireDate = '0' , dailyentryId = '305',isService = '0',isOptic = '0',lastbuyprice = '205.00',lastbuyprice_withDiscount = '205',meanbuyprice = '205.00',meanbuyprice_withDiscount = '205' , productbuypricereal = '205.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , buyhalf_precentage = '4.88' , buypart_precentage = '12.20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='205',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='205',meanbuyprice_withTax='205',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='205',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '257';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (257, 1,'2026-10-15 11:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 257, edited = 1, sysdate = '2026-10-15 11:02:52', userid = 1; -- id=271
UPDATE productunit SET proUnitSellUnitPrice = 245 * productnumber WHERE productid = 257;
UPDATE product SET productName = 'متر سلك 25 ملي شعر ', productDescription = '', productCatId = '10', productBuyPrice = '205.00', productSellAllPrice = '230.00', productSellUnitPrice = '245', productSellHalfPrice = '230.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00257',type ='0', expireDate = '0' , dailyentryId = '305',isService = '0',isOptic = '0',lastbuyprice = '205.00',lastbuyprice_withDiscount = '205',meanbuyprice = '205.00',meanbuyprice_withDiscount = '205' , productbuypricereal = '205.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , buyhalf_precentage = '4.88' , buypart_precentage = '12.20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='205',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='205',meanbuyprice_withTax='205',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='205',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '257';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (257, 1,'2026-10-15 11:03:01',1)
                ON DUPLICATE KEY UPDATE productid = 257, edited = 1, sysdate = '2026-10-15 11:03:01', userid = 1; -- id=271
UPDATE product SET productName = 'لفه سلك سماعات 1 ملي الشرق ', productDescription = '', productCatId = '10', productBuyPrice = '200.00', productSellAllPrice = '240.00', productSellUnitPrice = '300.00', productSellHalfPrice = '240.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00265',type ='0', expireDate = '0' , dailyentryId = '313',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '20.00' , buyhalf_precentage = '20.00' , buypart_precentage = '50.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '265';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (265, 1,'2026-10-15 11:03:10',1)
                ON DUPLICATE KEY UPDATE productid = 265, edited = 1, sysdate = '2026-10-15 11:03:10', userid = 1; -- id=279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 07:33:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 11:03:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 11:03:32', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 08:45:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 12:15:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 12:15:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 08:46:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 12:16:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 12:16:12', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4255
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 08:46:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 12:16:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 12:16:21', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=297'); -- id=4256
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 08:46:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 12:16:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 12:16:45', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4257
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:19:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 15:49:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 15:49:30', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4258

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad0a80de01d0
-- ----------------------------------------------------------------------------------------------------

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-15 15:49:31', '06ad0a80de01d0', '1', '0.00', '0', '0', '1', '2837.50', '2837.5', '2837.5', '0', '1', '2026-10-15 15:49:31', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '38' ,'0','','','','','-1','0','0','0','0','0','2837','0','','0','0','2837.5','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-15','1','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=303
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','303', '0', '2026-10-15 15:49:31', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2837.5', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-15 15:49:31','0','0','',''); -- id=511
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 102;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('348','00070', '303', '12', '70', '6', '445', '2670', '0', '', '1', '2026-10-15 15:49:31', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','102-6,','1','1','0','0','445','2670','0','','0','0.00','0','0','0','0'); -- id=2391
UPDATE sellbilldetail SET  lastbuyprice = 348.00 , meanbuyprice = 332.81, lastbuyprice_withDiscount = 348.00, meanbuyprice_withDiscount = 332.81
        , lastbuyprice_withTax = 348, meanbuyprice_withTax = 332.81, lastbuyprice_withDiscountAndTax = 348
                where sellbilldetailid = 2391;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-10-15', 2670, 2088, 2088
                    , 1996.86, 2088, 1996.86, 2040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2088, 1996.86, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2670, sellCostBuyPrice =sellCostBuyPrice+2088
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2088, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1996.86
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2088, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1996.86
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2088
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1996.86
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 2670, 2088, 2088
                    , 1996.86, 2088, 1996.86, 2040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2088, 1996.86, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2670, sellCostBuyPrice =sellCostBuyPrice+2088
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2088, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1996.86
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2088, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1996.86
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2088
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1996.86
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '59', userid = '1', storedetaildate = '2026-10-15 15:49:31' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '6', '1', '303', 'اضافة فاتورة مبيعات', 'sellbillController.php', '65', '59', '1', '2026-10-15 15:49:31','0','0'); -- id=4345
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 104;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('2.5','00074', '303', '12', '74', '30', '2.95', '88.5', '0', '', '1', '2026-10-15 15:49:32', '74', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','104-30,','1','1','0','0','2.95','88.5','0','','0','0.00','0','0','0','0'); -- id=2392
UPDATE sellbilldetail SET  lastbuyprice = 2.50 , meanbuyprice = 2.53, lastbuyprice_withDiscount = 2.50, meanbuyprice_withDiscount = 2.53
        , lastbuyprice_withTax = 2.5, meanbuyprice_withTax = 2.53, lastbuyprice_withDiscountAndTax = 2.5
                where sellbilldetailid = 2392;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (74, '2026-10-15', 88.5, 75, 75
                    , 75.9, 75, 75.9, 75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 75, 75.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+88.5, sellCostBuyPrice =sellCostBuyPrice+75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+75.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+75.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+75.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 88.5, 75, 75
                    , 75.9, 75, 75.9, 75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 75, 75.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+88.5, sellCostBuyPrice =sellCostBuyPrice+75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+75.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+75.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+75.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2183', userid = '1', storedetaildate = '2026-10-15 15:49:32' WHERE storedetailid = '74';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('74', '1', '30', '1', '303', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2213', '2183', '1', '2026-10-15 15:49:32','0','0'); -- id=4346
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '303', '14', '81', '1', '19', '19', '0', '', '1', '2026-10-15 15:49:32', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0'); -- id=2393
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 2393;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-10-15', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-15', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '101', userid = '1', storedetaildate = '2026-10-15 15:49:32' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '1', '1', '303', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '101', '1', '2026-10-15 15:49:32','0','0'); -- id=4347
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('55','00077', '303', '12', '77', '1', '60', '60', '0', '', '1', '2026-10-15 15:49:32', '77', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','60','0','','0','0.00','0','0','0','0'); -- id=2394
UPDATE sellbilldetail SET  lastbuyprice = 55.00 , meanbuyprice = 55.00, lastbuyprice_withDiscount = 55.00, meanbuyprice_withDiscount = 55.00
        , lastbuyprice_withTax = 55, meanbuyprice_withTax = 55, lastbuyprice_withDiscountAndTax = 55
                where sellbilldetailid = 2394;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (77, '2026-10-15', 60, 55, 55
                    , 55, 55, 55, 55
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 55, 55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+55
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+55, sellCostMeanBuyPrice = sellCostMeanBuyPrice+55
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+55, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+55
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+55
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+55
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 60, 55, 55
                    , 55, 55, 55, 55
                    , 0, 0, 0, 0
                    , 0, 0, 0, 55, 55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+55
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+55, sellCostMeanBuyPrice = sellCostMeanBuyPrice+55
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+55, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+55
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+55
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+55
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3.05', userid = '1', storedetaildate = '2026-10-15 15:49:33' WHERE storedetailid = '77';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('77', '1', '1', '1', '303', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.05', '3.05', '1', '2026-10-15 15:49:33','0','0'); -- id=4348
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-826952.25',  userid = '1' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-829789.75','2837.5', '0', '1', 'اضافة فاتورة مبيعات', '303', '-826952.25', '2026-10-15 15:49:33', '1',  'sellbillController.php','1','','0'); -- id=317
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2837.5', '2837.5', '2026-10-15', '1', '0', '0', '2026-10-15 15:49:33','اضافة فاتورة مبيعات رقم 303','1','0',null,'0','303','sellbillController.php?do=showDetail&sellbillid=303'); -- id=1629
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1629', '383', '2837.5', '','0'); -- id=1643
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-10091.51', 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 ('1629', '143', '2837.5', '','0'); -- id=1633
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1273288.53', 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 ( '2236', '2236', '2026-10-15', '1', '0', '0', '2026-10-15 15:49:33','اضافة فاتورة مبيعات رقم 303 - صرف البضاعة من المخزن','1','0',null,'0','303','sellbillController.php?do=showDetail&sellbillid=303'); -- id=1630
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1630', '402', '2236', '','0'); -- id=1644
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1139628.99', 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 ('1630', '382', '2236', '','0'); -- id=1634
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2350539.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1629,0,1630' where sellbillid=303;
 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-15', 2837.5, 2236, 2236
                    , 2145.76, 2236, 2145.76, 2188
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2236, 2145.76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2837.5, sellCostBuyPrice =sellCostBuyPrice+2236
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2236, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2145.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2236, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2145.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2236
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2145.76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 2837.5, 2236, 2236
                    , 2145.76, 2236, 2145.76, 2188
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2236, 2145.76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2837.5, sellCostBuyPrice =sellCostBuyPrice+2236
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2236, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2145.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2236, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2145.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2236
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2145.76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2837.5, 2236, 2236
                    , 2145.76, 2236, 2145.76, 2188, 2236, 2145.76)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2837.5, netSellCostBuyPrice = netSellCostBuyPrice+2236
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2236
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2145.76
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2236
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2145.76
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2188
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2236
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2145.76;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad0a80de01d0 and sellbillId = 303 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:19:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 15:49:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 15:49:34', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4259
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:46:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 16:16:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 16:16:10', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4260

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad0d9ef960ee
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(24,@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,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-15 16:16:15', '06ad0d9ef960ee', '24', '22747.43', '30887.43', '0', '1', '8140.00', '8140', '0', '8140', '1', '2026-10-15 16:16:15', '', '1', '0', 'وليد الهنداوي', '1', '1', '3', '0', '24 - وليد الهنداوي', '26' ,'0','','','','','-1','0','0','0','0','0','8140','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-15','1','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=304
UPDATE client SET  clientdebt = '30887.43', userid = '1' WHERE clientid = '24';
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 ('24','22747.43','8140','0','اضافة فاتورة مبيعات','304', '30887.43', '2026-10-15 16:16:16', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8140', '0', null, '0', null, null,'', '0','1','1','8140','1','2026-10-15 16:16:15','0','0','',''); -- id=512
UPDATE client SET  inUse = 0 where clientid = 24;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 94;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00174', '304', '19', '174', '8', '275', '2200', '0', '', '1', '2026-10-15 16:16:16', '174', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','94-8,','1','1','0','0','275','2200','0','','0','0.00','0','0','0','0'); -- id=2395
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 = 2395;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (174, '2026-10-15', 2200, 2160, 2160
                    , 2160, 2160, 2160, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , 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+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-15', 2200, 2160, 2160
                    , 2160, 2160, 2160, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , 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 = '33', userid = '1', storedetaildate = '2026-10-15 16:16:16' WHERE storedetailid = '174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '8', '1', '304', 'اضافة فاتورة مبيعات', 'sellbillController.php', '41', '33', '1', '2026-10-15 16:16:16','0','0'); -- id=4349
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 95;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('325','00175', '304', '19', '175', '18', '330', '5940', '0', '', '1', '2026-10-15 16:16:17', '175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','95-18,','1','1','0','0','330','5940','0','','0','0.00','0','0','0','0'); -- id=2396
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 325.00, meanbuyprice_withDiscount = 325.00
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 325
                where sellbilldetailid = 2396;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (175, '2026-10-15', 5940, 5850, 5850
                    , 5850, 5850, 5850, 5850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 5850, 5850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5940, sellCostBuyPrice =sellCostBuyPrice+5850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5850
                            , 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+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-15', 5940, 5850, 5850
                    , 5850, 5850, 5850, 5850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5850, 5850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5940, sellCostBuyPrice =sellCostBuyPrice+5850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5850
                            , 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 = '42', userid = '1', storedetaildate = '2026-10-15 16:16:17' WHERE storedetailid = '175';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('175', '1', '18', '1', '304', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '42', '1', '2026-10-15 16:16:17','0','0'); -- id=4350
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8140', '8140', '2026-10-15', '1', '0', '0', '2026-10-15 16:16:17','اضافة فاتورة مبيعات رقم 304','1','0',null,'0','304','sellbillController.php?do=showDetail&sellbillid=304'); -- id=1631
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1631', '453', '8140', '','0'); -- id=1645
UPDATE accountstree SET name = 'وليد الهنداوي', customName = 'وليد الهنداوي', customNameEn = 'وليد الهنداوي', nameEn = 'وليد الهنداوي', parent = '58', accountNature = '0', theValue = '30887.43', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:39:30' WHERE id = '453';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1631', '143', '8140', '','0'); -- id=1635
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1281428.53', 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 ( '8010', '8010', '2026-10-15', '1', '0', '0', '2026-10-15 16:16:17','اضافة فاتورة مبيعات رقم 304 - صرف البضاعة من المخزن','1','0',null,'0','304','sellbillController.php?do=showDetail&sellbillid=304'); -- id=1632
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1632', '402', '8010', '','0'); -- id=1646
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1147638.99', 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 ('1632', '382', '8010', '','0'); -- id=1636
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2342529.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1631,0,1632' where sellbillid=304;
 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-15', 8140, 8010, 8010
                    , 8010, 8010, 8010, 8010
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8010, 8010, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8140, sellCostBuyPrice =sellCostBuyPrice+8010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8010
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8010
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8010
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (24, '2026-10-15', 8140, 8010, 8010
                    , 8010, 8010, 8010, 8010
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8010, 8010, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8140, sellCostBuyPrice =sellCostBuyPrice+8010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8010, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8010
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8010
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8010
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 8140, 8010, 8010
                    , 8010, 8010, 8010, 8010, 8010, 8010)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8140, netSellCostBuyPrice = netSellCostBuyPrice+8010
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8010
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8010
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8010
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8010
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8010
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8010
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8010;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad0d9ef960ee and sellbillId = 304 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:46:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 16:16:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 16:16:19', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:46:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 16:16:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 16:16:34', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=4262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:46:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 16:16:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 16:16:54', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=4263

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =513
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(24,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '10887.43' , clientdate = '2026-10-15 16:16:54', userid = '1' WHERE clientid = '24';
UPDATE client SET  inUse = 0 where clientid = 24;
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 ('24','30887.43','20000','1','ايصال تحصيل (( قبض من عميل ))','513', '10887.43', '2026-10-15 16:16:34', '1', 'clientPayedDeptController.php', '   ', '20000', '0', null, '0', null, null,'', '-1','1','1','20000','1','','50','0','','.'); -- id=513
UPDATE save SET  savecurrentvalue = '-806952.25',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-826952.25','20000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '513', '-806952.25', '2026-10-15 16:16:55', '1',  'clientPayedDeptController.php','24','','0'); -- id=318
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-15', '1', '0', '0', '2026-10-15 16:16:55','اضافة ايصال سداد للعميل وليد الهنداوي','1','0','0','0','513','clientPayedDeptController.php?do=show&id=513'); -- id=1633
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1633', '383', '20000', '','0'); -- id=1647
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '9908.49', 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 ('1633', '453', '20000', '','0'); -- id=1637
UPDATE accountstree SET name = 'وليد الهنداوي', customName = 'وليد الهنداوي', customNameEn = 'وليد الهنداوي', nameEn = 'وليد الهنداوي', parent = '58', accountNature = '0', theValue = '10887.43', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:39:30' WHERE id = '453';
UPDATE clientdebtchange SET clientid = '24', clientdebtchangebefore = '30887.430', clientdebtchangeamount = '20000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '513', clientdebtchangeafter = '10887.430', clientdebtchangedate = '2026-10-15 16:16:34', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '20000.000',discount='', reciptid='0', dailyentryid = '1633',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '513';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 12:46:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 16:16:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 16:16:56', '1', 'editprint2', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=editprint2&id=%20513'); -- id=4264
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:41:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:11:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:11:41', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:46:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:16:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 17:16:58', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4266
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:48:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:18:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 17:18:48', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=4267
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 ('عود بروفايل 2.3 داخل ','','7','105','115','115','115','2026-10-15','0','1','0','','0','0','0','0','0','105','105','105','105','105','0','9.52','9.52','9.52','.','0','0','0','105','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','105','105','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','105','0','0','0','0','0','0','','','0','0','0','0'); -- id=597
UPDATE product SET productName = 'عود بروفايل 2.3 داخل ', productDescription = '', productCatId = '7', productBuyPrice = '105', productSellAllPrice = '115', productSellUnitPrice = '115', productSellHalfPrice = '115', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00597',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105' , buypricereal_precentage = '0' , buytotal_precentage = '9.52' , buyhalf_precentage = '9.52' , buypart_precentage = '9.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',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='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='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='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '597';
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', '597', '1.00', '2026-10-15', '1', '0','0059701','115','115','115','105','','0','0','0','0','0','0','0','0','0','0'); -- id=597
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('597', '1', '6', '1', '2026-10-15'); -- id=597
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('597', '1', '6', '0', '597', 'إضافة منتج', 'productController.php', '0', '6', '1', '2026-10-15','0','0'); -- id=4351
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (597, 1,'2026-10-15 17:18:49',1)
                ON DUPLICATE KEY UPDATE productid = 597, edited = 1, sysdate = '2026-10-15 17:18:49', userid = 1; -- id=796
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '630', '630', '2026-10-15', '1', '0', '0', '2026-10-15 17:18:49','إضافة منتج عود بروفايل 2.3 داخل  الكمية 6','1','0','0','0','597','productController.php?do=edit&id=597'); -- id=1634
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1634', '382', '630', '','0'); -- id=1648
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2343159.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1634', '121', '630', '','0'); -- id=1638
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1833184.77', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'عود بروفايل 2.3 داخل ', productDescription = '', productCatId = '7', productBuyPrice = '105.00', productSellAllPrice = '115.00', productSellUnitPrice = '115.00', productSellHalfPrice = '115.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00597',type ='0', expireDate = '0' , dailyentryId = '1634',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105' , buypricereal_precentage = '0' , buytotal_precentage = '9.52' , buyhalf_precentage = '9.52' , buypart_precentage = '9.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',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='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='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='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '597';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:48:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:18:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 17:18:51', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4268
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:50:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:20:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:20:28', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4269
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:50:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:20:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:20:37', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4270
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:50:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:20:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:20:47', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=304'); -- id=4271
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:51:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:21:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:21:28', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=4272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:52:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:22:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:22:05', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4273

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad0ef78ede21
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(24,@clientdebt,@clientname,@treeIdis);
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-15 17:22:06', '06ad0ef78ede21', '24', '10887.43', '7587.43', '0', '1', '3300', '3300', '0', '-3300', '1', '2026-10-15 17:22:06', '', '1', '0', 'وليد الهنداوي','1', '1', '5', '0', '24 - وليد الهنداوي', '10', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','','0'); -- id=19
UPDATE client SET  clientdebt = '7587.43', userid = '1' WHERE clientid = '24';
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 ('24','10887.43','3300','1','اضافة فاتورة مردوات مبيعات','19', '7587.43', '2026-10-15 17:22:06', '1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '3300', '0', null, '0', null, null,'', '0','1','1','3300','1','2026-10-15 17:22:06','0','0','',''); -- id=514
UPDATE client SET  inUse = 0 where clientid = 24;
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 ('325.00', '00175', '19', '19', '175', '10', '330', '3300', '0', '', '1', '0', '175', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','330','3300','0','','0'); -- id=83
UPDATE returnsellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 325.00, meanbuyprice_withDiscount = 325.00
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 325
                where returnsellbilldetailid = 83;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (175, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3300, 3250, 3250, 3250
                    , 3250, 3250, 3250, 0, 10, 0, 0, 3250, 3250)
                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+3300, returnSellCostBuyPrice = returnSellCostBuyPrice+3250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3250
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3250
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+10;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3300, 3250, 3250, 3250
                    , 3250, 3250, 3250, 0, 0, 3250, 3250)
                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+3300, returnSellCostBuyPrice = returnSellCostBuyPrice+3250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3250
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3250;
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2026-10-15 17:22:07' WHERE storedetailid = '175';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('175', '1', '10', '0', '19', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '42', '52', '1', '2026-10-15 17:22:07','0','0'); -- id=4352
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3300', '3300', '2026-10-15', '1', '0', '0', '2026-10-15 17:22:07','اضافة فاتورة مردود مبيعات رقم 19','1','0',null,'0','19','returnsellbillController.php?do=showDetail&returnsellbillid=19'); -- id=1635
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1635', '143', '3300', '','0'); -- id=1649
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1278128.53', 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 ('1635', '453', '3300', '','0'); -- id=1639
UPDATE accountstree SET name = 'وليد الهنداوي', customName = 'وليد الهنداوي', customNameEn = 'وليد الهنداوي', nameEn = 'وليد الهنداوي', parent = '58', accountNature = '0', theValue = '7587.43', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:39:30' WHERE id = '453';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3250', '3250', '2026-10-15', '1', '0', '0', '2026-10-15 17:22:07','اضافة فاتورة مردود مبيعات رقم 19 - صرف البضاعة من المخزن','1','0',null,'0','19','returnsellbillController.php?do=showDetail&returnsellbillid=19'); -- id=1636
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1636', '382', '3250', '','0'); -- id=1650
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2346409.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1636', '402', '3250', '','0'); -- id=1640
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1144388.99', 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='1635,0,1636' where returnsellbillid=19;
 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-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3300, 3250, 3250, 3250
                    , 3250, 3250, 3250 ,0, 0, 3250, 3250)
                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+3300, returnSellCostBuyPrice = returnSellCostBuyPrice+3250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3250
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3250;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (24, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3300, 3250, 3250, 3250
                    , 3250, 3250, 3250 ,0, 0, 3250, 3250)
                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+3300, returnSellCostBuyPrice = returnSellCostBuyPrice+3250, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3250
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3250, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3250
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3250
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3250
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3250
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3250;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -3300, -3250, -3250
                    , -3250, -3250, -3250, -3250, -3250, -3250)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-3300, netSellCostBuyPrice = netSellCostBuyPrice+-3250
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-3250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-3250
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-3250
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-3250
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-3250
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-3250
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-3250;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad0ef78ede21 and sellbillId = 19 and returnsellbillId = 19
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 13:52:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 17:22:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 17:22:09', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=4274
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:00:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:30:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:30:12', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4275

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad0ed2db010d
-- ----------------------------------------------------------------------------------------------------

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-15 18:30:13', '06ad0ed2db010d', '1', '0.00', '0', '0', '1', '32731.80', '32731.8', '32731.8', '0', '1', '2026-10-15 18:30:13', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '568.5' ,'0','','','','','-1','0','0','0','0','0','32731','0','','0','0','32731.8','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-15','1','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=305
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','305', '0', '2026-10-15 18:30:14', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '32731.8', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-15 18:30:13','0','0','',''); -- id=515
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+70 where id = 155;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('52.75','00001', '305', '1', '1', '70', '54.78', '3834.6', '0', '', '1', '2026-10-15 18:30:14', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','155-70,','1','1','0','0','54.78','3834.6','0','','0','0.00','0','0','0','0'); -- id=2397
UPDATE sellbilldetail SET  lastbuyprice = 52.75 , meanbuyprice = 52.75, lastbuyprice_withDiscount = 52.75, meanbuyprice_withDiscount = 52.75
        , lastbuyprice_withTax = 52.75, meanbuyprice_withTax = 52.75, lastbuyprice_withDiscountAndTax = 52.75
                where sellbilldetailid = 2397;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 70, 0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3834.6, sellCostBuyPrice =sellCostBuyPrice+3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3692.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+70
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3834.6, sellCostBuyPrice =sellCostBuyPrice+3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3692.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 = '1980', userid = '1', storedetaildate = '2026-10-15 18:30:14' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '70', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2050', '1980', '1', '2026-10-15 18:30:14','0','0'); -- id=4353
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 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 ('34.8','00004', '305', '1', '4', '50', '36', '1800', '0', '', '1', '2026-10-15 18:30:14', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','154-50,','1','1','0','0','36','1800','0','','0','0.00','0','0','0','0'); -- id=2398
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2398;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2933', userid = '1', storedetaildate = '2026-10-15 18:30:15' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '50', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2983', '2933', '1', '2026-10-15 18:30:15','0','0'); -- id=4354
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 where id = 153;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34.8','00003', '305', '1', '3', '50', '36', '1800', '0', '', '1', '2026-10-15 18:30:15', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','153-50,','1','1','0','0','36','1800','0','','0','0.00','0','0','0','0'); -- id=2399
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2399;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2759', userid = '1', storedetaildate = '2026-10-15 18:30:15' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '50', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2809', '2759', '1', '2026-10-15 18:30:15','0','0'); -- id=4355
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 162;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00011', '305', '1', '11', '5', '109', '545', '0', '', '1', '2026-10-15 18:30:15', '11', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','162-5,','1','1','0','0','109','545','0','','0','0.00','0','0','0','0'); -- id=2400
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2400;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '270', userid = '1', storedetaildate = '2026-10-15 18:30:15' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '5', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '275', '270', '1', '2026-10-15 18:30:15','0','0'); -- id=4356
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 161;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00006', '305', '1', '6', '5', '109', '545', '0', '', '1', '2026-10-15 18:30:15', '6', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','161-5,','1','1','0','0','109','545','0','','0','0.00','0','0','0','0'); -- id=2401
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2401;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '439', userid = '1', storedetaildate = '2026-10-15 18:30:16' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '5', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '444', '439', '1', '2026-10-15 18:30:16','0','0'); -- id=4357
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 67;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('63','00016', '305', '1', '16', '1', '67', '67', '0', '', '1', '2026-10-15 18:30:16', '16', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','67-1,','1','1','0','0','67','67','0','','0','0.00','0','0','0','0'); -- id=2402
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 2402;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-10-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '247', userid = '1', storedetaildate = '2026-10-15 18:30:16' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '248', '247', '1', '2026-10-15 18:30:16','0','0'); -- id=4358
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('84.46','00007', '305', '1', '7', '2', '87', '174', '0', '', '1', '2026-10-15 18:30:16', '7', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','87','174','0','','0','0.00','0','0','0','0'); -- id=2403
UPDATE sellbilldetail SET  lastbuyprice = 84.46 , meanbuyprice = 84.46, lastbuyprice_withDiscount = 84.46, meanbuyprice_withDiscount = 84.46
        , lastbuyprice_withTax = 84.46, meanbuyprice_withTax = 84.46, lastbuyprice_withDiscountAndTax = 84.46
                where sellbilldetailid = 2403;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7, '2026-10-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+174, sellCostBuyPrice =sellCostBuyPrice+168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+174, sellCostBuyPrice =sellCostBuyPrice+168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '111', userid = '1', storedetaildate = '2026-10-15 18:30:16' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '2', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '113', '111', '1', '2026-10-15 18:30:16','0','0'); -- id=4359
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('47','00014', '305', '1', '14', '3', '49.9', '149.7', '0', '', '1', '2026-10-15 18:30:16', '14', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','49.9','149.7','0','','0','0.00','0','0','0','0'); -- id=2404
UPDATE sellbilldetail SET  lastbuyprice = 47.00 , meanbuyprice = 47.00, lastbuyprice_withDiscount = 47.00, meanbuyprice_withDiscount = 47.00
        , lastbuyprice_withTax = 47, meanbuyprice_withTax = 47, lastbuyprice_withDiscountAndTax = 47
                where sellbilldetailid = 2404;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14, '2026-10-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+149.7, sellCostBuyPrice =sellCostBuyPrice+141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+141, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+149.7, sellCostBuyPrice =sellCostBuyPrice+141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+141, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '62', userid = '1', storedetaildate = '2026-10-15 18:30:17' WHERE storedetailid = '14';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '3', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '65', '62', '1', '2026-10-15 18:30:17','0','0'); -- id=4360
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237','00010', '305', '1', '10', '3', '246.5', '739.5', '0', '', '1', '2026-10-15 18:30:17', '10', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','149-3,','1','1','0','0','246.5','739.5','0','','0','0.00','0','0','0','0'); -- id=2405
UPDATE sellbilldetail SET  lastbuyprice = 237.00 , meanbuyprice = 237.00, lastbuyprice_withDiscount = 237.00, meanbuyprice_withDiscount = 237.00
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where sellbilldetailid = 2405;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10, '2026-10-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+739.5, sellCostBuyPrice =sellCostBuyPrice+711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+711, sellCostMeanBuyPrice = sellCostMeanBuyPrice+711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+711
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+739.5, sellCostBuyPrice =sellCostBuyPrice+711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+711, sellCostMeanBuyPrice = sellCostMeanBuyPrice+711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+711
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '206', userid = '1', storedetaildate = '2026-10-15 18:30:17' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '3', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '209', '206', '1', '2026-10-15 18:30:17','0','0'); -- id=4361
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+130 where id = 163;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('10.55','00005', '305', '1', '5', '130', '10.95', '1423.5', '0', '', '1', '2026-10-15 18:30:17', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','163-130,','1','1','0','0','10.95','1423.5','0','','0','0.00','0','0','0','0'); -- id=2406
UPDATE sellbilldetail SET  lastbuyprice = 10.55 , meanbuyprice = 10.55, lastbuyprice_withDiscount = 10.55, meanbuyprice_withDiscount = 10.55
        , lastbuyprice_withTax = 10.55, meanbuyprice_withTax = 10.55, lastbuyprice_withDiscountAndTax = 10.55
                where sellbilldetailid = 2406;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1423.5, sellCostBuyPrice =sellCostBuyPrice+1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1371.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+130
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1423.5, sellCostBuyPrice =sellCostBuyPrice+1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1371.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 = '5892', userid = '1', storedetaildate = '2026-10-15 18:30:17' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '130', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6022', '5892', '1', '2026-10-15 18:30:17','0','0'); -- id=4362
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00059', '305', '1', '59', '8', '136', '1088', '0', '', '1', '2026-10-15 18:30:17', '59', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','1088','0','','0','0.00','0','0','0','0'); -- id=2407
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2407;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (59, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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+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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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 = '154', userid = '1', storedetaildate = '2026-10-15 18:30:18' WHERE storedetailid = '59';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('59', '1', '8', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '162', '154', '1', '2026-10-15 18:30:18','0','0'); -- id=4363
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00060', '305', '1', '60', '8', '136', '1088', '0', '', '1', '2026-10-15 18:30:18', '60', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','1088','0','','0','0.00','0','0','0','0'); -- id=2408
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2408;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (60, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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+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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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 = '35', userid = '1', storedetaildate = '2026-10-15 18:30:18' WHERE storedetailid = '60';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('60', '1', '8', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '35', '1', '2026-10-15 18:30:18','0','0'); -- id=4364
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00062', '305', '1', '62', '3', '136', '408', '0', '', '1', '2026-10-15 18:30:18', '62', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','408','0','','0','0.00','0','0','0','0'); -- id=2409
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2409;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (62, '2026-10-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408, sellCostBuyPrice =sellCostBuyPrice+389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+389.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408, sellCostBuyPrice =sellCostBuyPrice+389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+389.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:18' WHERE storedetailid = '62';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('62', '1', '3', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '16', '1', '2026-10-15 18:30:18','0','0'); -- id=4365
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('262','00065', '305', '1', '65', '1', '275', '275', '0', '', '1', '2026-10-15 18:30:18', '65', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','275','275','0','','0','0.00','0','0','0','0'); -- id=2410
UPDATE sellbilldetail SET  lastbuyprice = 262.00 , meanbuyprice = 262.00, lastbuyprice_withDiscount = 262.00, meanbuyprice_withDiscount = 262.00
        , lastbuyprice_withTax = 262, meanbuyprice_withTax = 262, lastbuyprice_withDiscountAndTax = 262
                where sellbilldetailid = 2410;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (65, '2026-10-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:19' WHERE storedetailid = '65';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('65', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '1', '2026-10-15 18:30:19','0','0'); -- id=4366
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '305', '14', '81', '6', '19', '114', '0', '', '1', '2026-10-15 18:30:19', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','114','0','','0','0.00','0','0','0','0'); -- id=2411
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 2411;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-10-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '95', userid = '1', storedetaildate = '2026-10-15 18:30:19' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '6', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '101', '95', '1', '2026-10-15 18:30:19','0','0'); -- id=4367
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('60','00298', '305', '6', '298', '1', '75', '75', '0', '', '1', '2026-10-15 18:30:19', '298', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','75','75','0','','0','0.00','0','0','0','0'); -- id=2412
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 2412;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (298, '2026-10-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+75, sellCostBuyPrice =sellCostBuyPrice+60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+60, sellCostMeanBuyPrice = sellCostMeanBuyPrice+60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+60
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+75, sellCostBuyPrice =sellCostBuyPrice+60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+60, sellCostMeanBuyPrice = sellCostMeanBuyPrice+60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+60
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:30:19' WHERE storedetailid = '298';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('298', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '1', '2026-10-15 18:30:19','0','0'); -- id=4368
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('35','00297', '305', '6', '297', '1', '40', '40', '0', '', '1', '2026-10-15 18:30:20', '297', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','40','40','0','','0','0.00','0','0','0','0'); -- id=2413
UPDATE sellbilldetail SET  lastbuyprice = 35.00 , meanbuyprice = 35.00, lastbuyprice_withDiscount = 35.00, meanbuyprice_withDiscount = 35.00
        , lastbuyprice_withTax = 35, meanbuyprice_withTax = 35, lastbuyprice_withDiscountAndTax = 35
                where sellbilldetailid = 2413;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (297, '2026-10-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+40, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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+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-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+40, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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 = '6', userid = '1', storedetaildate = '2026-10-15 18:30:20' WHERE storedetailid = '297';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('297', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '1', '2026-10-15 18:30:20','0','0'); -- id=4369
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('80','00387', '305', '7', '387', '30', '93', '2790', '0', '', '1', '2026-10-15 18:30:20', '387', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','93','2790','0','','0','0.00','0','0','0','0'); -- id=2414
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2414;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2417.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+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-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2417.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 = '1', userid = '1', storedetaildate = '2026-10-15 18:30:20' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '30', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '1', '1', '2026-10-15 18:30:20','0','0'); -- id=4370
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 140;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('889','00268', '305', '10', '268', '1', '1050', '1050', '0', '', '1', '2026-10-15 18:30:20', '268', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','140-1,','1','1','0','0','1050','1050','0','','0','0.00','0','0','0','0'); -- id=2415
UPDATE sellbilldetail SET  lastbuyprice = 889.00 , meanbuyprice = 882.83, lastbuyprice_withDiscount = 889.00, meanbuyprice_withDiscount = 882.83
        , lastbuyprice_withTax = 889, meanbuyprice_withTax = 882.83, lastbuyprice_withDiscountAndTax = 889
                where sellbilldetailid = 2415;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (268, '2026-10-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+889, sellCostMeanBuyPrice = sellCostMeanBuyPrice+882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+882.83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+889, sellCostMeanBuyPrice = sellCostMeanBuyPrice+882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+882.83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:30:20' WHERE storedetailid = '268';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('268', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '1', '2026-10-15 18:30:20','0','0'); -- id=4371
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00562', '305', '10', '562', '1', '525', '525', '0', '', '1', '2026-10-15 18:30:21', '562', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','525','525','0','','0','0.00','0','0','0','0'); -- id=2416
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 = 2416;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (562, '2026-10-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:21' WHERE storedetailid = '562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('562', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '1', '2026-10-15 18:30:21','0','0'); -- id=4372
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 111;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('650','00249', '305', '10', '249', '1', '820', '820', '0', '', '1', '2026-10-15 18:30:21', '249', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','111-1,','1','1','0','0','820','820','0','','0','0.00','0','0','0','0'); -- id=2417
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 688.92, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 688.92
        , lastbuyprice_withTax = 682.5, meanbuyprice_withTax = 688.92, lastbuyprice_withDiscountAndTax = 650
                where sellbilldetailid = 2417;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (249, '2026-10-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+688.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+688.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '46.85', userid = '1', storedetaildate = '2026-10-15 18:30:21' WHERE storedetailid = '249';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('249', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '47.85', '46.85', '1', '2026-10-15 18:30:21','0','0'); -- id=4373
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('82','00080', '305', '14', '80', '.5', '95', '47.5', '0', '', '1', '2026-10-15 18:30:21', '80', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','47.5','0','','0','0.00','0','0','0','0'); -- id=2418
UPDATE sellbilldetail SET  lastbuyprice = 82.00 , meanbuyprice = 82.00, lastbuyprice_withDiscount = 82.00, meanbuyprice_withDiscount = 82.00
        , lastbuyprice_withTax = 82, meanbuyprice_withTax = 82, lastbuyprice_withDiscountAndTax = 82
                where sellbilldetailid = 2418;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (80, '2026-10-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+47.5, sellCostBuyPrice =sellCostBuyPrice+41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.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-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+47.5, sellCostBuyPrice =sellCostBuyPrice+41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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.4', userid = '1', storedetaildate = '2026-10-15 18:30:22' WHERE storedetailid = '80';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '0.5', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6.9', '6.4', '1', '2026-10-15 18:30:22','0','0'); -- id=4374
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('77','00211', '305', '6', '211', '6', '85', '510', '0', '', '1', '2026-10-15 18:30:22', '211', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','85','510','0','','0','0.00','0','0','0','0'); -- id=2419
UPDATE sellbilldetail SET  lastbuyprice = 77.00 , meanbuyprice = 77.00, lastbuyprice_withDiscount = 77.00, meanbuyprice_withDiscount = 77.00
        , lastbuyprice_withTax = 77, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 77
                where sellbilldetailid = 2419;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (211, '2026-10-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+462, sellCostMeanBuyPrice = sellCostMeanBuyPrice+462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+462
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+462, sellCostMeanBuyPrice = sellCostMeanBuyPrice+462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+462
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:22' WHERE storedetailid = '211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('211', '1', '6', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '25', '1', '2026-10-15 18:30:22','0','0'); -- id=4375
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('65','00126', '305', '15', '126', '20', '95', '1900', '0', '', '1', '2026-10-15 18:30:22', '126', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','1900','0','','0','0.00','0','0','0','0'); -- id=2420
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        , lastbuyprice_withTax = 65, meanbuyprice_withTax = 65, lastbuyprice_withDiscountAndTax = 65
                where sellbilldetailid = 2420;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (126, '2026-10-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2026-10-15 18:30:22' WHERE storedetailid = '126';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('126', '1', '20', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '23', '1', '2026-10-15 18:30:22','0','0'); -- id=4376
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15.5','00194', '305', '20', '194', '30', '16.5', '495', '0', '', '1', '2026-10-15 18:30:22', '194', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16.5','495','0','','0','0.00','0','0','0','0'); -- id=2421
UPDATE sellbilldetail SET  lastbuyprice = 15.50 , meanbuyprice = 15.50, lastbuyprice_withDiscount = 15.50, meanbuyprice_withDiscount = 15.50
        , lastbuyprice_withTax = 15.5, meanbuyprice_withTax = 15.5, lastbuyprice_withDiscountAndTax = 15.5
                where sellbilldetailid = 2421;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (194, '2026-10-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 18:30:22' WHERE storedetailid = '194';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '1', '30', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '65', '35', '1', '2026-10-15 18:30:22','0','0'); -- id=4377
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 116;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('17.5','00549', '305', '2', '549', '30', '28', '840', '0', '', '1', '2026-10-15 18:30:22', '549', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','116-30,','1','1','0','0','28','840','0','','0','0.00','0','0','0','0'); -- id=2422
UPDATE sellbilldetail SET  lastbuyprice = 17.50 , meanbuyprice = 17.50, lastbuyprice_withDiscount = 17.50, meanbuyprice_withDiscount = 17.50
        , lastbuyprice_withTax = 17.5, meanbuyprice_withTax = 17.5, lastbuyprice_withDiscountAndTax = 17.5
                where sellbilldetailid = 2422;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (549, '2026-10-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '508', userid = '1', storedetaildate = '2026-10-15 18:30:23' WHERE storedetailid = '549';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('549', '1', '30', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '538', '508', '1', '2026-10-15 18:30:23','0','0'); -- id=4378
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00597', '305', '7', '597', '4', '115', '460', '0', '', '1', '2026-10-15 18:30:23', '597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','115','460','0','','0','0.00','0','0','0','0'); -- id=2423
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2423;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (597, '2026-10-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:30:23' WHERE storedetailid = '597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('597', '1', '4', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '2', '1', '2026-10-15 18:30:23','0','0'); -- id=4379
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00197', '305', '20', '197', '20', '245', '4900', '0', '', '1', '2026-10-15 18:30:23', '197', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','4900','0','','0','0.00','0','0','0','0'); -- id=2424
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 211.46, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 211.46
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 211.46, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 2424;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (197, '2026-10-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4900, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4229.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4900, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4229.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:23' WHERE storedetailid = '197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '1', '20', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '40', '1', '2026-10-15 18:30:23','0','0'); -- id=4380
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.5','00392', '305', '7', '392', '40', '5', '200', '0', '', '1', '2026-10-15 18:30:24', '392', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','200','0','','0','0.00','0','0','0','0'); -- id=2425
UPDATE sellbilldetail SET  lastbuyprice = 4.50 , meanbuyprice = 4.50, lastbuyprice_withDiscount = 4.50, meanbuyprice_withDiscount = 4.50
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where sellbilldetailid = 2425;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (392, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+40
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:24' WHERE storedetailid = '392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('392', '1', '40', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '-7', '1', '2026-10-15 18:30:24','0','0'); -- id=4381
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4','00393', '305', '7', '393', '20', '5', '100', '0', '', '1', '2026-10-15 18:30:24', '393', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','100','0','','0','0.00','0','0','0','0'); -- id=2426
UPDATE sellbilldetail SET  lastbuyprice = 4.00 , meanbuyprice = 4.00, lastbuyprice_withDiscount = 4.00, meanbuyprice_withDiscount = 4.00
        , lastbuyprice_withTax = 4, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 4
                where sellbilldetailid = 2426;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (393, '2026-10-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '235', userid = '1', storedetaildate = '2026-10-15 18:30:24' WHERE storedetailid = '393';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('393', '1', '20', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '255', '235', '1', '2026-10-15 18:30:24','0','0'); -- id=4382
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1100','00203', '305', '6', '203', '1', '1350', '1350', '0', '', '1', '2026-10-15 18:30:24', '203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1350','1350','0','','0','0.00','0','0','0','0'); -- id=2427
UPDATE sellbilldetail SET  lastbuyprice = 1100.00 , meanbuyprice = 1100.00, lastbuyprice_withDiscount = 1100.00, meanbuyprice_withDiscount = 1100.00
        , lastbuyprice_withTax = 1100, meanbuyprice_withTax = 1100, lastbuyprice_withDiscountAndTax = 1100
                where sellbilldetailid = 2427;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (203, '2026-10-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:24' WHERE storedetailid = '203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('203', '1', '1', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '1', '2026-10-15 18:30:24','0','0'); -- id=4383
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11','00207', '305', '6', '207', '10', '15', '150', '0', '', '1', '2026-10-15 18:30:24', '207', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','150','0','','0','0.00','0','0','0','0'); -- id=2428
UPDATE sellbilldetail SET  lastbuyprice = 11.00 , meanbuyprice = 11.00, lastbuyprice_withDiscount = 11.00, meanbuyprice_withDiscount = 11.00
        , lastbuyprice_withTax = 11, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 11
                where sellbilldetailid = 2428;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-10-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:30:25' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '10', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '104', '94', '1', '2026-10-15 18:30:25','0','0'); -- id=4384
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00299', '305', '24', '299', '4', '397', '1588', '0', '', '1', '2026-10-15 18:30:25', '299', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','397','1588','0','','0','0.00','0','0','0','0'); -- id=2429
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 = 2429;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (299, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1588, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1588, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , 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 = '26', userid = '1', storedetaildate = '2026-10-15 18:30:25' WHERE storedetailid = '299';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('299', '1', '4', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '26', '1', '2026-10-15 18:30:25','0','0'); -- id=4385
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00300', '305', '24', '300', '3', '280', '840', '0', '', '1', '2026-10-15 18:30:25', '300', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','280','840','0','','0','0.00','0','0','0','0'); -- id=2430
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 = 2430;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (300, '2026-10-15', 840, 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+840, 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-15', 840, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, 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 = '7', userid = '1', storedetaildate = '2026-10-15 18:30:25' WHERE storedetailid = '300';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('300', '1', '3', '1', '305', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '7', '1', '2026-10-15 18:30:25','0','0'); -- id=4386
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-774220.45',  userid = '1' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-806952.25','32731.8', '0', '1', 'اضافة فاتورة مبيعات', '305', '-774220.45', '2026-10-15 18:30:26', '1',  'sellbillController.php','1','','0'); -- id=319
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32731.8', '32731.8', '2026-10-15', '1', '0', '0', '2026-10-15 18:30:26','اضافة فاتورة مبيعات رقم 305','1','0',null,'0','305','sellbillController.php?do=showDetail&sellbillid=305'); -- id=1637
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1637', '383', '32731.8', '','0'); -- id=1651
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '42640.29', 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 ('1637', '143', '32731.8', '','0'); -- id=1641
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1310860.33', 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 ( '30274.22', '30274.22', '2026-10-15', '1', '0', '0', '2026-10-15 18:30:26','اضافة فاتورة مبيعات رقم 305 - صرف البضاعة من المخزن','1','0',null,'0','305','sellbillController.php?do=showDetail&sellbillid=305'); -- id=1638
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1638', '402', '30274.22', '','0'); -- id=1652
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1174663.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 ('1638', '382', '30274.22', '','0'); -- id=1642
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2316134.88', 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='1637,0,1638' where sellbillid=305;
 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-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32731.8, sellCostBuyPrice =sellCostBuyPrice+30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29353.57
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32731.8, sellCostBuyPrice =sellCostBuyPrice+30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29353.57
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22, 30306.72, 29353.57)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+32731.8, netSellCostBuyPrice = netSellCostBuyPrice+30339.22
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+30274.22
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+29353.57
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+30274.22
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+29353.57
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+30274.22
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+30306.72
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+29353.57;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad0ed2db010d and sellbillId = 305 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:00:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:30:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:30:28', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4276
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:00:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:30:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:30:29', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:10:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:40:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:40:18', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4278
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:10:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:40:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:40:26', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:10:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:40:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:40:33', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=305'); -- id=4280
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('عبدالله سعد' , '', '', '', '0', '', '0', '2026-10-15 18:40:58', '1', '0','','0','','-10','0','0',',','0','0','.','0','0','.','2026-10-15','0','0','','0','0','0','','','0','0','','','','','','','','','','0','','','','0','','','0','0',''); -- id=66
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('66', '0', '0', '', ''); -- id=66
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 ('66','0','0','0','إضافة عميل جديد','66', '0', '2026-10-15 18:40:58', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=516
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('عبدالله سعد', 'عبدالله سعد', 'عبدالله سعد', 'عبدالله سعد', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-10-15 18:40:59'); -- id=499
UPDATE client SET clientname = 'عبدالله سعد', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-10-15', userid = '1'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='499',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '66';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:11:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:41:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:41:12', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=4281
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 305;
UPDATE sellbill SET  sellbillsysdate = '2026-10-15 18:41:12', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '305';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-70 where id = 155;
UPDATE sellbilldetail SET  lastbuyprice = 52.75 , meanbuyprice = 52.75, lastbuyprice_withDiscount = 52.75, meanbuyprice_withDiscount = 52.75
        , lastbuyprice_withTax = 52.75, meanbuyprice_withTax = 52.75, lastbuyprice_withDiscountAndTax = 52.75
                where sellbilldetailid = 2397;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,70,0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3834.6, sellCostBuyPrice =sellCostBuyPrice-3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3692.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-70
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3834.6, sellCostBuyPrice =sellCostBuyPrice-3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3692.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 = '2050', userid = '1', storedetaildate = '2026-10-15 18:41:12' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '70', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1980', '2050', '1', '2026-10-15 18:30:13','0','0'); -- id=4387
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-50 where id = 154;
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2398;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0,50,0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1740
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-50
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1740
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2983', userid = '1', storedetaildate = '2026-10-15 18:41:12' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '50', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2933', '2983', '1', '2026-10-15 18:30:13','0','0'); -- id=4388
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-50 where id = 153;
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2399;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0,50,0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1740
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-50
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1740
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2809', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '50', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2759', '2809', '1', '2026-10-15 18:30:13','0','0'); -- id=4389
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 162;
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2400;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-545, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-545, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '275', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '5', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '270', '275', '1', '2026-10-15 18:30:13','0','0'); -- id=4390
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 161;
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2401;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-545, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-545, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '444', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '5', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '439', '444', '1', '2026-10-15 18:30:13','0','0'); -- id=4391
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 67;
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 2402;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-10-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-67, sellCostBuyPrice =sellCostBuyPrice-63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-63, sellCostMeanBuyPrice = sellCostMeanBuyPrice-63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-63
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-67, sellCostBuyPrice =sellCostBuyPrice-63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-63, sellCostMeanBuyPrice = sellCostMeanBuyPrice-63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-63
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '248', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '247', '248', '1', '2026-10-15 18:30:13','0','0'); -- id=4392
UPDATE sellbilldetail SET  lastbuyprice = 84.46 , meanbuyprice = 84.46, lastbuyprice_withDiscount = 84.46, meanbuyprice_withDiscount = 84.46
        , lastbuyprice_withTax = 84.46, meanbuyprice_withTax = 84.46, lastbuyprice_withDiscountAndTax = 84.46
                where sellbilldetailid = 2403;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7, '2026-10-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-174, sellCostBuyPrice =sellCostBuyPrice-168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice-168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-168.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-174, sellCostBuyPrice =sellCostBuyPrice-168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice-168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-168.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '113', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '2', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '111', '113', '1', '2026-10-15 18:30:13','0','0'); -- id=4393
UPDATE sellbilldetail SET  lastbuyprice = 47.00 , meanbuyprice = 47.00, lastbuyprice_withDiscount = 47.00, meanbuyprice_withDiscount = 47.00
        , lastbuyprice_withTax = 47, meanbuyprice_withTax = 47, lastbuyprice_withDiscountAndTax = 47
                where sellbilldetailid = 2404;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14, '2026-10-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-149.7, sellCostBuyPrice =sellCostBuyPrice-141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-141, sellCostMeanBuyPrice = sellCostMeanBuyPrice-141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-141
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-149.7, sellCostBuyPrice =sellCostBuyPrice-141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-141, sellCostMeanBuyPrice = sellCostMeanBuyPrice-141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-141
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '14';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '3', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '62', '65', '1', '2026-10-15 18:30:13','0','0'); -- id=4394
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 149;
UPDATE sellbilldetail SET  lastbuyprice = 237.00 , meanbuyprice = 237.00, lastbuyprice_withDiscount = 237.00, meanbuyprice_withDiscount = 237.00
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where sellbilldetailid = 2405;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10, '2026-10-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-739.5, sellCostBuyPrice =sellCostBuyPrice-711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-711, sellCostMeanBuyPrice = sellCostMeanBuyPrice-711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-711
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-739.5, sellCostBuyPrice =sellCostBuyPrice-711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-711, sellCostMeanBuyPrice = sellCostMeanBuyPrice-711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-711
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '209', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '3', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '206', '209', '1', '2026-10-15 18:30:13','0','0'); -- id=4395
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-130 where id = 163;
UPDATE sellbilldetail SET  lastbuyprice = 10.55 , meanbuyprice = 10.55, lastbuyprice_withDiscount = 10.55, meanbuyprice_withDiscount = 10.55
        , lastbuyprice_withTax = 10.55, meanbuyprice_withTax = 10.55, lastbuyprice_withDiscountAndTax = 10.55
                where sellbilldetailid = 2406;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,130,0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1423.5, sellCostBuyPrice =sellCostBuyPrice-1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1371.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-130
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1423.5, sellCostBuyPrice =sellCostBuyPrice-1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1371.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 = '6022', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '130', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5892', '6022', '1', '2026-10-15 18:30:13','0','0'); -- id=4396
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2407;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (59, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1088, sellCostBuyPrice =sellCostBuyPrice-1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1037.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-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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1088, sellCostBuyPrice =sellCostBuyPrice-1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1037.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 = '162', userid = '1', storedetaildate = '2026-10-15 18:41:13' WHERE storedetailid = '59';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('59', '1', '8', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '154', '162', '1', '2026-10-15 18:30:13','0','0'); -- id=4397
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2408;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (60, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1088, sellCostBuyPrice =sellCostBuyPrice-1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1037.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-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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1088, sellCostBuyPrice =sellCostBuyPrice-1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1037.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 = '43', userid = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '60';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('60', '1', '8', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '35', '43', '1', '2026-10-15 18:30:13','0','0'); -- id=4398
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2409;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (62, '2026-10-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0,3,0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-408, sellCostBuyPrice =sellCostBuyPrice-389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-389.1
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-408, sellCostBuyPrice =sellCostBuyPrice-389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-389.1
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '62';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('62', '1', '3', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '19', '1', '2026-10-15 18:30:13','0','0'); -- id=4399
UPDATE sellbilldetail SET  lastbuyprice = 262.00 , meanbuyprice = 262.00, lastbuyprice_withDiscount = 262.00, meanbuyprice_withDiscount = 262.00
        , lastbuyprice_withTax = 262, meanbuyprice_withTax = 262, lastbuyprice_withDiscountAndTax = 262
                where sellbilldetailid = 2410;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (65, '2026-10-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-275, sellCostBuyPrice =sellCostBuyPrice-262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-262, sellCostMeanBuyPrice = sellCostMeanBuyPrice-262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-262
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-275, sellCostBuyPrice =sellCostBuyPrice-262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-262, sellCostMeanBuyPrice = sellCostMeanBuyPrice-262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-262
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:14' WHERE storedetailid = '65';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('65', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '1', '2026-10-15 18:30:13','0','0'); -- id=4400
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 2411;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-10-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-114, sellCostBuyPrice =sellCostBuyPrice-108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-108, sellCostMeanBuyPrice = sellCostMeanBuyPrice-108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-108
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-114, sellCostBuyPrice =sellCostBuyPrice-108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-108, sellCostMeanBuyPrice = sellCostMeanBuyPrice-108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-108
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '101', userid = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '6', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '95', '101', '1', '2026-10-15 18:30:13','0','0'); -- id=4401
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 2412;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (298, '2026-10-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-75, sellCostBuyPrice =sellCostBuyPrice-60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-60, sellCostMeanBuyPrice = sellCostMeanBuyPrice-60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-60
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-75, sellCostBuyPrice =sellCostBuyPrice-60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-60, sellCostMeanBuyPrice = sellCostMeanBuyPrice-60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-60
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:14' WHERE storedetailid = '298';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('298', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-10-15 18:30:13','0','0'); -- id=4402
UPDATE sellbilldetail SET  lastbuyprice = 35.00 , meanbuyprice = 35.00, lastbuyprice_withDiscount = 35.00, meanbuyprice_withDiscount = 35.00
        , lastbuyprice_withTax = 35, meanbuyprice_withTax = 35, lastbuyprice_withDiscountAndTax = 35
                where sellbilldetailid = 2413;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (297, '2026-10-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-40, sellCostBuyPrice =sellCostBuyPrice-35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-35, sellCostMeanBuyPrice = sellCostMeanBuyPrice-35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-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-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-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-40, sellCostBuyPrice =sellCostBuyPrice-35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-35, sellCostMeanBuyPrice = sellCostMeanBuyPrice-35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-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 = '7', userid = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '297';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('297', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '7', '1', '2026-10-15 18:30:13','0','0'); -- id=4403
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2414;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2790, sellCostBuyPrice =sellCostBuyPrice-2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2417.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-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-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2790, sellCostBuyPrice =sellCostBuyPrice-2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2417.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 = '31', userid = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '30', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1', '31', '1', '2026-10-15 18:30:13','0','0'); -- id=4404
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 140;
UPDATE sellbilldetail SET  lastbuyprice = 889.00 , meanbuyprice = 882.83, lastbuyprice_withDiscount = 889.00, meanbuyprice_withDiscount = 882.83
        , lastbuyprice_withTax = 889, meanbuyprice_withTax = 882.83, lastbuyprice_withDiscountAndTax = 889
                where sellbilldetailid = 2415;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (268, '2026-10-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1050, sellCostBuyPrice =sellCostBuyPrice-889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-889, sellCostMeanBuyPrice = sellCostMeanBuyPrice-882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-882.83
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1050, sellCostBuyPrice =sellCostBuyPrice-889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-889, sellCostMeanBuyPrice = sellCostMeanBuyPrice-882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-882.83
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:14' WHERE storedetailid = '268';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('268', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-10-15 18:30:13','0','0'); -- id=4405
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 = 2416;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (562, '2026-10-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-525, sellCostBuyPrice =sellCostBuyPrice-460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-460
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-525, sellCostBuyPrice =sellCostBuyPrice-460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-460
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:14' WHERE storedetailid = '562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('562', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '4', '1', '2026-10-15 18:30:13','0','0'); -- id=4406
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 111;
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 688.92, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 688.92
        , lastbuyprice_withTax = 682.5, meanbuyprice_withTax = 688.92, lastbuyprice_withDiscountAndTax = 650
                where sellbilldetailid = 2417;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (249, '2026-10-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-820, sellCostBuyPrice =sellCostBuyPrice-715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-688.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-820, sellCostBuyPrice =sellCostBuyPrice-715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-688.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '47.85', userid = '1', storedetaildate = '2026-10-15 18:41:14' WHERE storedetailid = '249';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('249', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '46.85', '47.85', '1', '2026-10-15 18:30:13','0','0'); -- id=4407
UPDATE sellbilldetail SET  lastbuyprice = 82.00 , meanbuyprice = 82.00, lastbuyprice_withDiscount = 82.00, meanbuyprice_withDiscount = 82.00
        , lastbuyprice_withTax = 82, meanbuyprice_withTax = 82, lastbuyprice_withDiscountAndTax = 82
                where sellbilldetailid = 2418;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (80, '2026-10-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.5,0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-47.5, sellCostBuyPrice =sellCostBuyPrice-41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-41, sellCostMeanBuyPrice = sellCostMeanBuyPrice-41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-41
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-0.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-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-47.5, sellCostBuyPrice =sellCostBuyPrice-41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-41, sellCostMeanBuyPrice = sellCostMeanBuyPrice-41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-41
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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.9', userid = '1', storedetaildate = '2026-10-15 18:41:15' WHERE storedetailid = '80';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '0.5', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6.4', '6.9', '1', '2026-10-15 18:30:13','0','0'); -- id=4408
UPDATE sellbilldetail SET  lastbuyprice = 77.00 , meanbuyprice = 77.00, lastbuyprice_withDiscount = 77.00, meanbuyprice_withDiscount = 77.00
        , lastbuyprice_withTax = 77, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 77
                where sellbilldetailid = 2419;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (211, '2026-10-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-510, sellCostBuyPrice =sellCostBuyPrice-462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-462, sellCostMeanBuyPrice = sellCostMeanBuyPrice-462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-462
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-510, sellCostBuyPrice =sellCostBuyPrice-462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-462, sellCostMeanBuyPrice = sellCostMeanBuyPrice-462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-462
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2026-10-15 18:41:15' WHERE storedetailid = '211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('211', '1', '6', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '31', '1', '2026-10-15 18:30:13','0','0'); -- id=4409
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        , lastbuyprice_withTax = 65, meanbuyprice_withTax = 65, lastbuyprice_withDiscountAndTax = 65
                where sellbilldetailid = 2420;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (126, '2026-10-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1900, sellCostBuyPrice =sellCostBuyPrice-1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1900, sellCostBuyPrice =sellCostBuyPrice-1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '126';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('126', '1', '20', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '23', '43', '1', '2026-10-15 18:30:13','0','0'); -- id=4410
UPDATE sellbilldetail SET  lastbuyprice = 15.50 , meanbuyprice = 15.50, lastbuyprice_withDiscount = 15.50, meanbuyprice_withDiscount = 15.50
        , lastbuyprice_withTax = 15.5, meanbuyprice_withTax = 15.5, lastbuyprice_withDiscountAndTax = 15.5
                where sellbilldetailid = 2421;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (194, '2026-10-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-495, sellCostBuyPrice =sellCostBuyPrice-465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-465, sellCostMeanBuyPrice = sellCostMeanBuyPrice-465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-465
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-495, sellCostBuyPrice =sellCostBuyPrice-465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-465, sellCostMeanBuyPrice = sellCostMeanBuyPrice-465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-465
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 18:41:15' WHERE storedetailid = '194';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '1', '30', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '35', '65', '1', '2026-10-15 18:30:13','0','0'); -- id=4411
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 116;
UPDATE sellbilldetail SET  lastbuyprice = 17.50 , meanbuyprice = 17.50, lastbuyprice_withDiscount = 17.50, meanbuyprice_withDiscount = 17.50
        , lastbuyprice_withTax = 17.5, meanbuyprice_withTax = 17.5, lastbuyprice_withDiscountAndTax = 17.5
                where sellbilldetailid = 2422;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (549, '2026-10-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-840, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-840, sellCostBuyPrice =sellCostBuyPrice-525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-525, sellCostMeanBuyPrice = sellCostMeanBuyPrice-525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-525
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '538', userid = '1', storedetaildate = '2026-10-15 18:41:15' WHERE storedetailid = '549';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('549', '1', '30', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '508', '538', '1', '2026-10-15 18:30:13','0','0'); -- id=4412
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2423;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (597, '2026-10-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-460, sellCostBuyPrice =sellCostBuyPrice-420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('597', '1', '4', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '6', '1', '2026-10-15 18:30:13','0','0'); -- id=4413
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 211.46, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 211.46
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 211.46, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 2424;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (197, '2026-10-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4900, sellCostBuyPrice =sellCostBuyPrice-5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4229.2
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4900, sellCostBuyPrice =sellCostBuyPrice-5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4229.2
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '1', '20', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '40', '60', '1', '2026-10-15 18:30:13','0','0'); -- id=4414
UPDATE sellbilldetail SET  lastbuyprice = 4.50 , meanbuyprice = 4.50, lastbuyprice_withDiscount = 4.50, meanbuyprice_withDiscount = 4.50
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where sellbilldetailid = 2425;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (392, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-180
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-40
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-180, sellCostMeanBuyPrice = sellCostMeanBuyPrice-180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-180
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('392', '1', '40', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-7', '33', '1', '2026-10-15 18:30:13','0','0'); -- id=4415
UPDATE sellbilldetail SET  lastbuyprice = 4.00 , meanbuyprice = 4.00, lastbuyprice_withDiscount = 4.00, meanbuyprice_withDiscount = 4.00
        , lastbuyprice_withTax = 4, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 4
                where sellbilldetailid = 2426;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (393, '2026-10-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-80, sellCostMeanBuyPrice = sellCostMeanBuyPrice-80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-80
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-80, sellCostMeanBuyPrice = sellCostMeanBuyPrice-80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-80
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '393';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('393', '1', '20', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '235', '255', '1', '2026-10-15 18:30:13','0','0'); -- id=4416
UPDATE sellbilldetail SET  lastbuyprice = 1100.00 , meanbuyprice = 1100.00, lastbuyprice_withDiscount = 1100.00, meanbuyprice_withDiscount = 1100.00
        , lastbuyprice_withTax = 1100, meanbuyprice_withTax = 1100, lastbuyprice_withDiscountAndTax = 1100
                where sellbilldetailid = 2427;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (203, '2026-10-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1350, sellCostBuyPrice =sellCostBuyPrice-1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1350, sellCostBuyPrice =sellCostBuyPrice-1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 18:41:15' WHERE storedetailid = '203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('203', '1', '1', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '1', '2026-10-15 18:30:13','0','0'); -- id=4417
UPDATE sellbilldetail SET  lastbuyprice = 11.00 , meanbuyprice = 11.00, lastbuyprice_withDiscount = 11.00, meanbuyprice_withDiscount = 11.00
        , lastbuyprice_withTax = 11, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 11
                where sellbilldetailid = 2428;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-10-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-110, sellCostMeanBuyPrice = sellCostMeanBuyPrice-110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-110
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-150, sellCostBuyPrice =sellCostBuyPrice-110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-110, sellCostMeanBuyPrice = sellCostMeanBuyPrice-110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-110
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '104', userid = '1', storedetaildate = '2026-10-15 18:41:16' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '10', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '94', '104', '1', '2026-10-15 18:30:13','0','0'); -- id=4418
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 = 2429;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (299, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1588, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1588, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , 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 = '30', userid = '1', storedetaildate = '2026-10-15 18:41:16' WHERE storedetailid = '299';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('299', '1', '4', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '26', '30', '1', '2026-10-15 18:30:13','0','0'); -- id=4419
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 = 2430;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (300, '2026-10-15', 840, 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-840, 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-15', 840, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-840, 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 = '10', userid = '1', storedetaildate = '2026-10-15 18:41:16' WHERE storedetailid = '300';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('300', '1', '3', '0', '305', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '10', '1', '2026-10-15 18:30:13','0','0'); -- id=4420
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','تعديل فاتورة مبيعات','305', '0', '2026-10-15 18:30:13', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '32731.8', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-15 18:30:13','0','0','',''); -- id=517
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-806952.2375',  userid = '1' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-774220.4375','32731.8', '1', '1', 'تعديل فاتورة مبيعات', '305', '-806952.2375', '2026-10-15 18:41:16', '1',  'sellbillController.php','1','','0'); -- id=320
 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-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-32731.8, sellCostBuyPrice =sellCostBuyPrice-30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice-29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-29353.57
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-32731.8, sellCostBuyPrice =sellCostBuyPrice-30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice-29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-29353.57
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22, 30306.72, 29353.57)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-32731.8, netSellCostBuyPrice = netSellCostBuyPrice-30339.22
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-30274.22
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-29353.57
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-30274.22
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-29353.57
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-30274.22
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-30306.72
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-29353.57;

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


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

COMMIT;
BEGIN;
CALL clientInUse(66,@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-15 18:30:13', '06ad0ed2db010d', '66', '0.00', '32731.8', '0', '1', '32731.8', '32731.8', '0', '32731.8', '1', '2026-10-15 18:30:13', '', '1', '0', 'عبدالله سعد', '1', '1', '3', '0', 'عبدالله سعد', '568.5', '305', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-15','1','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=306
UPDATE client SET  clientdebt = '32731.8', userid = '1' WHERE clientid = '66';
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 ('66','0.00','32731.8','0','اضافة فاتورة مبيعات (معدله)','306', '32731.8', '2026-10-15 18:41:17', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '32731.8', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-15 18:30:13','0','0','',''); -- id=518
UPDATE client SET  inUse = 0 where clientid = 66;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+70 where id = 155;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('52.75','00001', '306', '1', '1', '70.00', '54.78', '3834.6', '0', '', '1', '2026-10-15 18:41:17', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','155-70,','1','1','0','0','54.78','3834.6','0','','0','0.00','0','0','0','0'); -- id=2431
UPDATE sellbilldetail SET  lastbuyprice = 52.75 , meanbuyprice = 52.75, lastbuyprice_withDiscount = 52.75, meanbuyprice_withDiscount = 52.75
        , lastbuyprice_withTax = 52.75, meanbuyprice_withTax = 52.75, lastbuyprice_withDiscountAndTax = 52.75
                where sellbilldetailid = 2431;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 70, 0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3834.6, sellCostBuyPrice =sellCostBuyPrice+3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3692.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+70
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 3834.6, 3692.5, 3692.5
                    , 3692.5, 3692.5, 3692.5, 3692.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3692.5, 3692.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3834.6, sellCostBuyPrice =sellCostBuyPrice+3692.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3692.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3692.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3692.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3692.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3692.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3692.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3692.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 = '1980', userid = '1', storedetaildate = '2026-10-15 18:41:17' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '70', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2050', '1980', '1', '2026-10-15 18:41:17','0','0'); -- id=4421
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 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 ('34.8','00004', '306', '1', '4', '50.00', '36', '1800', '0', '', '1', '2026-10-15 18:41:17', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','154-50,','1','1','0','0','36','1800','0','','0','0.00','0','0','0','0'); -- id=2432
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2432;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2933', userid = '1', storedetaildate = '2026-10-15 18:41:18' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '50', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2983', '2933', '1', '2026-10-15 18:41:18','0','0'); -- id=4422
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 where id = 153;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34.8','00003', '306', '1', '3', '50.00', '36', '1800', '0', '', '1', '2026-10-15 18:41:18', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','153-50,','1','1','0','0','36','1800','0','','0','0.00','0','0','0','0'); -- id=2433
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 2433;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2759', userid = '1', storedetaildate = '2026-10-15 18:41:18' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '50', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2809', '2759', '1', '2026-10-15 18:41:18','0','0'); -- id=4423
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 162;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00011', '306', '1', '11', '5.00', '109', '545', '0', '', '1', '2026-10-15 18:41:18', '11', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','162-5,','1','1','0','0','109','545','0','','0','0.00','0','0','0','0'); -- id=2434
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2434;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '270', userid = '1', storedetaildate = '2026-10-15 18:41:18' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '5', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '275', '270', '1', '2026-10-15 18:41:18','0','0'); -- id=4424
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 161;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00006', '306', '1', '6', '5.00', '109', '545', '0', '', '1', '2026-10-15 18:41:18', '6', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','161-5,','1','1','0','0','109','545','0','','0','0.00','0','0','0','0'); -- id=2435
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2435;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-10-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 545, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+545, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '439', userid = '1', storedetaildate = '2026-10-15 18:41:19' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '5', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '444', '439', '1', '2026-10-15 18:41:19','0','0'); -- id=4425
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 67;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('63','00016', '306', '1', '16', '1.00', '67', '67', '0', '', '1', '2026-10-15 18:41:19', '16', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','67-1,','1','1','0','0','67','67','0','','0','0.00','0','0','0','0'); -- id=2436
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 2436;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-10-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '247', userid = '1', storedetaildate = '2026-10-15 18:41:19' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '248', '247', '1', '2026-10-15 18:41:19','0','0'); -- id=4426
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('84.46','00007', '306', '1', '7', '2.00', '87', '174', '0', '', '1', '2026-10-15 18:41:19', '7', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','87','174','0','','0','0.00','0','0','0','0'); -- id=2437
UPDATE sellbilldetail SET  lastbuyprice = 84.46 , meanbuyprice = 84.46, lastbuyprice_withDiscount = 84.46, meanbuyprice_withDiscount = 84.46
        , lastbuyprice_withTax = 84.46, meanbuyprice_withTax = 84.46, lastbuyprice_withDiscountAndTax = 84.46
                where sellbilldetailid = 2437;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7, '2026-10-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+174, sellCostBuyPrice =sellCostBuyPrice+168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 174, 168.92, 168.92
                    , 168.92, 168.92, 168.92, 168.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 168.92, 168.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+174, sellCostBuyPrice =sellCostBuyPrice+168.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '111', userid = '1', storedetaildate = '2026-10-15 18:41:19' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '2', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '113', '111', '1', '2026-10-15 18:41:19','0','0'); -- id=4427
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('47','00014', '306', '1', '14', '3.00', '49.9', '149.7', '0', '', '1', '2026-10-15 18:41:19', '14', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','49.9','149.7','0','','0','0.00','0','0','0','0'); -- id=2438
UPDATE sellbilldetail SET  lastbuyprice = 47.00 , meanbuyprice = 47.00, lastbuyprice_withDiscount = 47.00, meanbuyprice_withDiscount = 47.00
        , lastbuyprice_withTax = 47, meanbuyprice_withTax = 47, lastbuyprice_withDiscountAndTax = 47
                where sellbilldetailid = 2438;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14, '2026-10-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+149.7, sellCostBuyPrice =sellCostBuyPrice+141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+141, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 149.7, 141, 141
                    , 141, 141, 141, 141
                    , 0, 0, 0, 0
                    , 0, 0, 0, 141, 141, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+149.7, sellCostBuyPrice =sellCostBuyPrice+141
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+141, sellCostMeanBuyPrice = sellCostMeanBuyPrice+141
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+141, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+141
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+141
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+141
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+141
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '62', userid = '1', storedetaildate = '2026-10-15 18:41:20' WHERE storedetailid = '14';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '3', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '65', '62', '1', '2026-10-15 18:41:20','0','0'); -- id=4428
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237','00010', '306', '1', '10', '3.00', '246.5', '739.5', '0', '', '1', '2026-10-15 18:41:20', '10', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','149-3,','1','1','0','0','246.5','739.5','0','','0','0.00','0','0','0','0'); -- id=2439
UPDATE sellbilldetail SET  lastbuyprice = 237.00 , meanbuyprice = 237.00, lastbuyprice_withDiscount = 237.00, meanbuyprice_withDiscount = 237.00
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where sellbilldetailid = 2439;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10, '2026-10-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+739.5, sellCostBuyPrice =sellCostBuyPrice+711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+711, sellCostMeanBuyPrice = sellCostMeanBuyPrice+711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+711
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 739.5, 711, 711
                    , 711, 711, 711, 711
                    , 0, 0, 0, 0
                    , 0, 0, 0, 711, 711, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+739.5, sellCostBuyPrice =sellCostBuyPrice+711
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+711, sellCostMeanBuyPrice = sellCostMeanBuyPrice+711
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+711, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+711
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+711
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+711
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+711
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '206', userid = '1', storedetaildate = '2026-10-15 18:41:20' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '3', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '209', '206', '1', '2026-10-15 18:41:20','0','0'); -- id=4429
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+130 where id = 163;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('10.55','00005', '306', '1', '5', '130.00', '10.95', '1423.5', '0', '', '1', '2026-10-15 18:41:20', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','163-130,','1','1','0','0','10.95','1423.5','0','','0','0.00','0','0','0','0'); -- id=2440
UPDATE sellbilldetail SET  lastbuyprice = 10.55 , meanbuyprice = 10.55, lastbuyprice_withDiscount = 10.55, meanbuyprice_withDiscount = 10.55
        , lastbuyprice_withTax = 10.55, meanbuyprice_withTax = 10.55, lastbuyprice_withDiscountAndTax = 10.55
                where sellbilldetailid = 2440;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1423.5, sellCostBuyPrice =sellCostBuyPrice+1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1371.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+130
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1423.5, 1371.5, 1371.5
                    , 1371.5, 1371.5, 1371.5, 1371.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1371.5, 1371.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1423.5, sellCostBuyPrice =sellCostBuyPrice+1371.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1371.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1371.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1371.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1371.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1371.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1371.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1371.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 = '5892', userid = '1', storedetaildate = '2026-10-15 18:41:20' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '130', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6022', '5892', '1', '2026-10-15 18:41:20','0','0'); -- id=4430
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00059', '306', '1', '59', '8.00', '136', '1088', '0', '', '1', '2026-10-15 18:41:21', '59', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','1088','0','','0','0.00','0','0','0','0'); -- id=2441
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2441;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (59, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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+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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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 = '154', userid = '1', storedetaildate = '2026-10-15 18:41:21' WHERE storedetailid = '59';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('59', '1', '8', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '162', '154', '1', '2026-10-15 18:41:21','0','0'); -- id=4431
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00060', '306', '1', '60', '8.00', '136', '1088', '0', '', '1', '2026-10-15 18:41:21', '60', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','1088','0','','0','0.00','0','0','0','0'); -- id=2442
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2442;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (60, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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+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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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 = '35', userid = '1', storedetaildate = '2026-10-15 18:41:21' WHERE storedetailid = '60';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('60', '1', '8', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '43', '35', '1', '2026-10-15 18:41:21','0','0'); -- id=4432
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00062', '306', '1', '62', '3.00', '136', '408', '0', '', '1', '2026-10-15 18:41:21', '62', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','408','0','','0','0.00','0','0','0','0'); -- id=2443
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2443;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (62, '2026-10-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408, sellCostBuyPrice =sellCostBuyPrice+389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+389.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 408, 389.1, 389.1
                    , 389.1, 389.1, 389.1, 389.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 389.1, 389.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+408, sellCostBuyPrice =sellCostBuyPrice+389.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+389.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+389.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+389.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+389.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+389.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+389.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+389.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:21' WHERE storedetailid = '62';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('62', '1', '3', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '16', '1', '2026-10-15 18:41:22','0','0'); -- id=4433
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('262','00065', '306', '1', '65', '1.00', '275', '275', '0', '', '1', '2026-10-15 18:41:22', '65', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','275','275','0','','0','0.00','0','0','0','0'); -- id=2444
UPDATE sellbilldetail SET  lastbuyprice = 262.00 , meanbuyprice = 262.00, lastbuyprice_withDiscount = 262.00, meanbuyprice_withDiscount = 262.00
        , lastbuyprice_withTax = 262, meanbuyprice_withTax = 262, lastbuyprice_withDiscountAndTax = 262
                where sellbilldetailid = 2444;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (65, '2026-10-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 275, 262, 262
                    , 262, 262, 262, 262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 262, 262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:22' WHERE storedetailid = '65';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('65', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '1', '2026-10-15 18:41:22','0','0'); -- id=4434
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '306', '14', '81', '6.00', '19', '114', '0', '', '1', '2026-10-15 18:41:22', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','114','0','','0','0.00','0','0','0','0'); -- id=2445
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 2445;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-10-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '95', userid = '1', storedetaildate = '2026-10-15 18:41:22' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '6', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '101', '95', '1', '2026-10-15 18:41:22','0','0'); -- id=4435
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('60','00298', '306', '6', '298', '1.00', '75', '75', '0', '', '1', '2026-10-15 18:41:22', '298', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','75','75','0','','0','0.00','0','0','0','0'); -- id=2446
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 2446;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (298, '2026-10-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+75, sellCostBuyPrice =sellCostBuyPrice+60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+60, sellCostMeanBuyPrice = sellCostMeanBuyPrice+60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+60
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 75, 60, 60
                    , 60, 60, 60, 60
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 60, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+75, sellCostBuyPrice =sellCostBuyPrice+60
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+60, sellCostMeanBuyPrice = sellCostMeanBuyPrice+60
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+60
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+60
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:41:23' WHERE storedetailid = '298';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('298', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-10-15 18:41:23','0','0'); -- id=4436
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('35','00297', '306', '6', '297', '1.00', '40', '40', '0', '', '1', '2026-10-15 18:41:23', '297', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','40','40','0','','0','0.00','0','0','0','0'); -- id=2447
UPDATE sellbilldetail SET  lastbuyprice = 35.00 , meanbuyprice = 35.00, lastbuyprice_withDiscount = 35.00, meanbuyprice_withDiscount = 35.00
        , lastbuyprice_withTax = 35, meanbuyprice_withTax = 35, lastbuyprice_withDiscountAndTax = 35
                where sellbilldetailid = 2447;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (297, '2026-10-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+40, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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+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-15', 40, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+40, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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 = '6', userid = '1', storedetaildate = '2026-10-15 18:41:23' WHERE storedetailid = '297';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('297', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '6', '1', '2026-10-15 18:41:23','0','0'); -- id=4437
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('80','00387', '306', '7', '387', '30.00', '93', '2790', '0', '', '1', '2026-10-15 18:41:23', '387', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','93','2790','0','','0','0.00','0','0','0','0'); -- id=2448
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2448;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2417.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+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-15', 2790, 2400, 2400
                    , 2417.4, 2400, 2417.4, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2417.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2417.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2417.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2417.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 = '1', userid = '1', storedetaildate = '2026-10-15 18:41:23' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '30', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '31', '1', '1', '2026-10-15 18:41:23','0','0'); -- id=4438
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 140;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('889','00268', '306', '10', '268', '1.00', '1050', '1050', '0', '', '1', '2026-10-15 18:41:23', '268', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','140-1,','1','1','0','0','1050','1050','0','','0','0.00','0','0','0','0'); -- id=2449
UPDATE sellbilldetail SET  lastbuyprice = 889.00 , meanbuyprice = 882.83, lastbuyprice_withDiscount = 889.00, meanbuyprice_withDiscount = 882.83
        , lastbuyprice_withTax = 889, meanbuyprice_withTax = 882.83, lastbuyprice_withDiscountAndTax = 889
                where sellbilldetailid = 2449;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (268, '2026-10-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+889, sellCostMeanBuyPrice = sellCostMeanBuyPrice+882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+882.83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1050, 889, 889
                    , 882.83, 889, 882.83, 889
                    , 0, 0, 0, 0
                    , 0, 0, 0, 889, 882.83, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+889
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+889, sellCostMeanBuyPrice = sellCostMeanBuyPrice+882.83
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+889, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+882.83
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+889
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+889
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+882.83
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:41:24' WHERE storedetailid = '268';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('268', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-10-15 18:41:24','0','0'); -- id=4439
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00562', '306', '10', '562', '1.00', '525', '525', '0', '', '1', '2026-10-15 18:41:24', '562', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','525','525','0','','0','0.00','0','0','0','0'); -- id=2450
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 = 2450;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (562, '2026-10-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 525, 460, 460
                    , 460, 460, 460, 460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 460, 460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+525, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:24' WHERE storedetailid = '562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('562', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '1', '2026-10-15 18:41:24','0','0'); -- id=4440
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 111;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('650','00249', '306', '10', '249', '1.00', '820', '820', '0', '', '1', '2026-10-15 18:41:24', '249', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','111-1,','1','1','0','0','820','820','0','','0','0.00','0','0','0','0'); -- id=2451
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 688.92, lastbuyprice_withDiscount = 650.00, meanbuyprice_withDiscount = 688.92
        , lastbuyprice_withTax = 682.5, meanbuyprice_withTax = 688.92, lastbuyprice_withDiscountAndTax = 650
                where sellbilldetailid = 2451;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (249, '2026-10-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+688.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 820, 715, 650
                    , 688.92, 650, 688.92, 650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 682.5, 688.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+820, sellCostBuyPrice =sellCostBuyPrice+715
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+688.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+688.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+682.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+688.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '46.85', userid = '1', storedetaildate = '2026-10-15 18:41:24' WHERE storedetailid = '249';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('249', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '47.85', '46.85', '1', '2026-10-15 18:41:24','0','0'); -- id=4441
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('82','00080', '306', '14', '80', '0.50', '95', '47.5', '0', '', '1', '2026-10-15 18:41:24', '80', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','47.5','0','','0','0.00','0','0','0','0'); -- id=2452
UPDATE sellbilldetail SET  lastbuyprice = 82.00 , meanbuyprice = 82.00, lastbuyprice_withDiscount = 82.00, meanbuyprice_withDiscount = 82.00
        , lastbuyprice_withTax = 82, meanbuyprice_withTax = 82, lastbuyprice_withDiscountAndTax = 82
                where sellbilldetailid = 2452;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (80, '2026-10-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+47.5, sellCostBuyPrice =sellCostBuyPrice+41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.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-15', 47.5, 41, 41
                    , 41, 41, 41, 41
                    , 0, 0, 0, 0
                    , 0, 0, 0, 41, 41, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+47.5, sellCostBuyPrice =sellCostBuyPrice+41
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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.4', userid = '1', storedetaildate = '2026-10-15 18:41:25' WHERE storedetailid = '80';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '0.5', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6.9', '6.4', '1', '2026-10-15 18:41:25','0','0'); -- id=4442
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('77','00211', '306', '6', '211', '6.00', '85', '510', '0', '', '1', '2026-10-15 18:41:25', '211', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','85','510','0','','0','0.00','0','0','0','0'); -- id=2453
UPDATE sellbilldetail SET  lastbuyprice = 77.00 , meanbuyprice = 77.00, lastbuyprice_withDiscount = 77.00, meanbuyprice_withDiscount = 77.00
        , lastbuyprice_withTax = 77, meanbuyprice_withTax = 77, lastbuyprice_withDiscountAndTax = 77
                where sellbilldetailid = 2453;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (211, '2026-10-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+462, sellCostMeanBuyPrice = sellCostMeanBuyPrice+462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+462
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 510, 462, 462
                    , 462, 462, 462, 462
                    , 0, 0, 0, 0
                    , 0, 0, 0, 462, 462, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+462
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+462, sellCostMeanBuyPrice = sellCostMeanBuyPrice+462
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+462, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+462
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+462
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+462
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+462
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:25' WHERE storedetailid = '211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('211', '1', '6', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '31', '25', '1', '2026-10-15 18:41:25','0','0'); -- id=4443
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('65','00126', '306', '15', '126', '20.00', '95', '1900', '0', '', '1', '2026-10-15 18:41:25', '126', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','1900','0','','0','0.00','0','0','0','0'); -- id=2454
UPDATE sellbilldetail SET  lastbuyprice = 65.00 , meanbuyprice = 65.00, lastbuyprice_withDiscount = 65.00, meanbuyprice_withDiscount = 65.00
        , lastbuyprice_withTax = 65, meanbuyprice_withTax = 65, lastbuyprice_withDiscountAndTax = 65
                where sellbilldetailid = 2454;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (126, '2026-10-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1900, 1300, 1300
                    , 1300, 1300, 1300, 1300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1300, 1300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2026-10-15 18:41:25' WHERE storedetailid = '126';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('126', '1', '20', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '43', '23', '1', '2026-10-15 18:41:25','0','0'); -- id=4444
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15.5','00194', '306', '20', '194', '30.00', '16.5', '495', '0', '', '1', '2026-10-15 18:41:25', '194', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16.5','495','0','','0','0.00','0','0','0','0'); -- id=2455
UPDATE sellbilldetail SET  lastbuyprice = 15.50 , meanbuyprice = 15.50, lastbuyprice_withDiscount = 15.50, meanbuyprice_withDiscount = 15.50
        , lastbuyprice_withTax = 15.5, meanbuyprice_withTax = 15.5, lastbuyprice_withDiscountAndTax = 15.5
                where sellbilldetailid = 2455;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (194, '2026-10-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 495, 465, 465
                    , 465, 465, 465, 465
                    , 0, 0, 0, 0
                    , 0, 0, 0, 465, 465, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+495, sellCostBuyPrice =sellCostBuyPrice+465
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+465, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+465, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+465
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+465
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+465
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 18:41:26' WHERE storedetailid = '194';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '1', '30', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '65', '35', '1', '2026-10-15 18:41:26','0','0'); -- id=4445
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 116;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('17.5','00549', '306', '2', '549', '30.00', '28', '840', '0', '', '1', '2026-10-15 18:41:26', '549', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','116-30,','1','1','0','0','28','840','0','','0','0.00','0','0','0','0'); -- id=2456
UPDATE sellbilldetail SET  lastbuyprice = 17.50 , meanbuyprice = 17.50, lastbuyprice_withDiscount = 17.50, meanbuyprice_withDiscount = 17.50
        , lastbuyprice_withTax = 17.5, meanbuyprice_withTax = 17.5, lastbuyprice_withDiscountAndTax = 17.5
                where sellbilldetailid = 2456;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (549, '2026-10-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 840, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '508', userid = '1', storedetaildate = '2026-10-15 18:41:26' WHERE storedetailid = '549';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('549', '1', '30', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '538', '508', '1', '2026-10-15 18:41:26','0','0'); -- id=4446
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00597', '306', '7', '597', '4.00', '115', '460', '0', '', '1', '2026-10-15 18:41:26', '597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','115','460','0','','0','0.00','0','0','0','0'); -- id=2457
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 2457;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (597, '2026-10-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 460, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+460, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 18:41:26' WHERE storedetailid = '597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('597', '1', '4', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '2', '1', '2026-10-15 18:41:26','0','0'); -- id=4447
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00197', '306', '20', '197', '20.00', '245', '4900', '0', '', '1', '2026-10-15 18:41:27', '197', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','4900','0','','0','0.00','0','0','0','0'); -- id=2458
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 211.46, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 211.46
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 211.46, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 2458;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (197, '2026-10-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4900, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4229.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 4900, 5200, 5200
                    , 4229.2, 5200, 4229.2, 5200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5200, 4229.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4900, sellCostBuyPrice =sellCostBuyPrice+5200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4229.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4229.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4229.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:27' WHERE storedetailid = '197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '1', '20', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '60', '40', '1', '2026-10-15 18:41:27','0','0'); -- id=4448
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.5','00392', '306', '7', '392', '40.00', '5', '200', '0', '', '1', '2026-10-15 18:41:27', '392', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','200','0','','0','0.00','0','0','0','0'); -- id=2459
UPDATE sellbilldetail SET  lastbuyprice = 4.50 , meanbuyprice = 4.50, lastbuyprice_withDiscount = 4.50, meanbuyprice_withDiscount = 4.50
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where sellbilldetailid = 2459;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (392, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+40
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 200, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:27' WHERE storedetailid = '392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('392', '1', '40', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '33', '-7', '1', '2026-10-15 18:41:27','0','0'); -- id=4449
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4','00393', '306', '7', '393', '20.00', '5', '100', '0', '', '1', '2026-10-15 18:41:27', '393', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','100','0','','0','0.00','0','0','0','0'); -- id=2460
UPDATE sellbilldetail SET  lastbuyprice = 4.00 , meanbuyprice = 4.00, lastbuyprice_withDiscount = 4.00, meanbuyprice_withDiscount = 4.00
        , lastbuyprice_withTax = 4, meanbuyprice_withTax = 4, lastbuyprice_withDiscountAndTax = 4
                where sellbilldetailid = 2460;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (393, '2026-10-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 100, 80, 80
                    , 80, 80, 80, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 80, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '235', userid = '1', storedetaildate = '2026-10-15 18:41:27' WHERE storedetailid = '393';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('393', '1', '20', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '255', '235', '1', '2026-10-15 18:41:27','0','0'); -- id=4450
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1100','00203', '306', '6', '203', '1.00', '1350', '1350', '0', '', '1', '2026-10-15 18:41:27', '203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1350','1350','0','','0','0.00','0','0','0','0'); -- id=2461
UPDATE sellbilldetail SET  lastbuyprice = 1100.00 , meanbuyprice = 1100.00, lastbuyprice_withDiscount = 1100.00, meanbuyprice_withDiscount = 1100.00
        , lastbuyprice_withTax = 1100, meanbuyprice_withTax = 1100, lastbuyprice_withDiscountAndTax = 1100
                where sellbilldetailid = 2461;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (203, '2026-10-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1350, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:28' WHERE storedetailid = '203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('203', '1', '1', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-10-15 18:41:28','0','0'); -- id=4451
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11','00207', '306', '6', '207', '10.00', '15', '150', '0', '', '1', '2026-10-15 18:41:28', '207', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','150','0','','0','0.00','0','0','0','0'); -- id=2462
UPDATE sellbilldetail SET  lastbuyprice = 11.00 , meanbuyprice = 11.00, lastbuyprice_withDiscount = 11.00, meanbuyprice_withDiscount = 11.00
        , lastbuyprice_withTax = 11, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 11
                where sellbilldetailid = 2462;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-10-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 150, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:41:28' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '10', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '104', '94', '1', '2026-10-15 18:41:28','0','0'); -- id=4452
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00299', '306', '24', '299', '4.00', '397', '1588', '0', '', '1', '2026-10-15 18:41:28', '299', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','397','1588','0','','0','0.00','0','0','0','0'); -- id=2463
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 = 2463;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (299, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1588, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 1588, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1588, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , 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 = '26', userid = '1', storedetaildate = '2026-10-15 18:41:28' WHERE storedetailid = '299';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('299', '1', '4', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '26', '1', '2026-10-15 18:41:28','0','0'); -- id=4453
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00300', '306', '24', '300', '3.00', '280', '840', '0', '', '1', '2026-10-15 18:41:28', '300', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','280','840','0','','0','0.00','0','0','0','0'); -- id=2464
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 = 2464;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (300, '2026-10-15', 840, 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+840, 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-15', 840, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, 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 = '7', userid = '1', storedetaildate = '2026-10-15 18:41:29' WHERE storedetailid = '300';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('300', '1', '3', '1', '306', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '7', '1', '2026-10-15 18:41:29','0','0'); -- id=4454
UPDATE dailyentry SET totalcreditor = '32731.80', totaldebtor = '32731.80', thedate = '2026-10-15', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-15 18:30:26', entryComment = 'اضافة فاتورة مبيعات رقم 305', fromFlag = '1',related='0',isopeningentry='0',operationId='305',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=305' WHERE id = '1637';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32731.80', '32731.80', '2026-10-15', '1', '0', '1637', '2026-10-15 18:41:29','تم عكس القيد رقم 1637 ','1','0','0','0','0',''); -- id=1639
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1639', '383', '32731.80', '','0'); -- id=1643
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '9908.49', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1639', '143', '32731.80', '','0'); -- id=1653
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1278128.53', 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 = '30274.22', totaldebtor = '30274.22', thedate = '2026-10-15', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-15 18:30:26', entryComment = 'اضافة فاتورة مبيعات رقم 305 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='305',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=305' WHERE id = '1638';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30274.22', '30274.22', '2026-10-15', '1', '0', '1638', '2026-10-15 18:41:29','تم عكس القيد رقم 1638 ','1','0','0','0','0',''); -- id=1640
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1640', '402', '30274.22', '','0'); -- id=1644
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1144388.99', 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 ('1640', '382', '30274.22', '','0'); -- id=1654
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2346409.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32731.8', '32731.8', '2026-10-15', '1', '0', '0', '2026-10-15 18:41:30','اضافة فاتورة مبيعات رقم 306','1','0',null,'0','306','sellbillController.php?do=showDetail&sellbillid=306'); -- id=1641
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1641', '499', '32731.8', '','0'); -- id=1655
UPDATE accountstree SET name = 'عبدالله سعد', customName = 'عبدالله سعد', customNameEn = 'عبدالله سعد', nameEn = 'عبدالله سعد', parent = '58', accountNature = '0', theValue = '32731.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-15 18:40:59' WHERE id = '499';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1641', '143', '32731.8', '','0'); -- id=1645
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1310860.33', 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 ( '30274.22', '30274.22', '2026-10-15', '1', '0', '0', '2026-10-15 18:41:30','اضافة فاتورة مبيعات رقم 306 - صرف البضاعة من المخزن','1','0',null,'0','306','sellbillController.php?do=showDetail&sellbillid=306'); -- id=1642
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1642', '402', '30274.22', '','0'); -- id=1656
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1174663.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 ('1642', '382', '30274.22', '','0'); -- id=1646
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2316134.88', 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='1641,0,1642' where sellbillid=306;
 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-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32731.8, sellCostBuyPrice =sellCostBuyPrice+30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29353.57
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (66, '2026-10-15', 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,30306.72, 29353.57, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+32731.8, sellCostBuyPrice =sellCostBuyPrice+30339.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30274.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29353.57
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30274.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29353.57
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30274.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30306.72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29353.57
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 32731.8, 30339.22, 30274.22
                    , 29353.57, 30274.22, 29353.57, 30274.22, 30306.72, 29353.57)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+32731.8, netSellCostBuyPrice = netSellCostBuyPrice+30339.22
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+30274.22
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+29353.57
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+30274.22
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+29353.57
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+30274.22
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+30306.72
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+29353.57;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 305 and newid=306 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:11:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:41:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:41:34', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=306'); -- id=4282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:13:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:43:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:43:07', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4283

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad0ffa4e37b5
-- ----------------------------------------------------------------------------------------------------

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-15 18:43:08', '06ad0ffa4e37b5', '1', '0.00', '0', '0', '1', '1965.00', '1965', '1965', '0', '1', '2026-10-15 18:43:08', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '16' ,'0','','','','','-1','0','0','0','0','0','1965','0','','0','0','1965','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-15','1','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=307
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','307', '0', '2026-10-15 18:43:09', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1965', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-15 18:43:08','0','0','',''); -- id=519
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('80','00387', '307', '7', '387', '5', '93', '465', '0', '', '1', '2026-10-15 18:43:09', '387', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','93','465','0','','0','0.00','0','0','0','0'); -- id=2465
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2465;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 465, 400, 400
                    , 402.9, 400, 402.9, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 400, 402.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+402.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 465, 400, 400
                    , 402.9, 400, 402.9, 400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 400, 402.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+465, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+402.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+402.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+402.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2026-10-15 18:43:09' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '5', '1', '307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '-4', '1', '2026-10-15 18:43:09','0','0'); -- id=4455
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00197', '307', '20', '197', '3', '245', '735', '0', '', '1', '2026-10-15 18:43:09', '197', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','735','0','','0','0.00','0','0','0','0'); -- id=2466
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 211.46, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 211.46
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 211.46, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 2466;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (197, '2026-10-15', 735, 780, 780
                    , 634.38, 780, 634.38, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 780, 634.38, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+634.38
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+634.38
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+634.38
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 735, 780, 780
                    , 634.38, 780, 634.38, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 780, 634.38, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+735, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+634.38
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+634.38
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+634.38
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2026-10-15 18:43:09' WHERE storedetailid = '197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '1', '3', '1', '307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '37', '1', '2026-10-15 18:43:09','0','0'); -- id=4456
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 109;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('217.92','00196', '307', '20', '196', '2', '245', '490', '0', '', '1', '2026-10-15 18:43:09', '196', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','109-2,','1','1','0','0','245','490','0','','0','0.00','0','0','0','0'); -- id=2467
UPDATE sellbilldetail SET  lastbuyprice = 217.92 , meanbuyprice = 215.92, lastbuyprice_withDiscount = 217.92, meanbuyprice_withDiscount = 215.92
        , lastbuyprice_withTax = 217.92, meanbuyprice_withTax = 215.92, lastbuyprice_withDiscountAndTax = 217.92
                where sellbilldetailid = 2467;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (196, '2026-10-15', 490, 435.84, 435.84
                    , 431.84, 435.84, 431.84, 435.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 435.84, 431.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+435.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+431.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+431.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+431.84
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 490, 435.84, 435.84
                    , 431.84, 435.84, 431.84, 435.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 435.84, 431.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+490, sellCostBuyPrice =sellCostBuyPrice+435.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+435.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+431.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+435.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+431.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+435.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+435.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+431.84
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '180', userid = '1', storedetaildate = '2026-10-15 18:43:10' WHERE storedetailid = '196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '2', '1', '307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '182', '180', '1', '2026-10-15 18:43:10','0','0'); -- id=4457
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','00287', '307', '7', '287', '1', '250', '250', '0', '', '1', '2026-10-15 18:43:10', '287', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','250','0','','0','0.00','0','0','0','0'); -- id=2468
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where sellbilldetailid = 2468;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (287, '2026-10-15', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 250, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 18:43:10' WHERE storedetailid = '287';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('287', '1', '1', '1', '307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1', '0', '1', '2026-10-15 18:43:10','0','0'); -- id=4458
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.5','00392', '307', '7', '392', '5', '5', '25', '0', '', '1', '2026-10-15 18:43:10', '392', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','25','0','','0','0.00','0','0','0','0'); -- id=2469
UPDATE sellbilldetail SET  lastbuyprice = 4.50 , meanbuyprice = 4.50, lastbuyprice_withDiscount = 4.50, meanbuyprice_withDiscount = 4.50
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where sellbilldetailid = 2469;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (392, '2026-10-15', 25, 22.5, 22.5
                    , 22.5, 22.5, 22.5, 22.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 22.5, 22.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25, sellCostBuyPrice =sellCostBuyPrice+22.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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+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-15', 25, 22.5, 22.5
                    , 22.5, 22.5, 22.5, 22.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.5, 22.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25, sellCostBuyPrice =sellCostBuyPrice+22.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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 = '-12', userid = '1', storedetaildate = '2026-10-15 18:43:10' WHERE storedetailid = '392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('392', '1', '5', '1', '307', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-7', '-12', '1', '2026-10-15 18:43:10','0','0'); -- id=4459
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-804987.25',  userid = '1' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-806952.25','1965', '0', '1', 'اضافة فاتورة مبيعات', '307', '-804987.25', '2026-10-15 18:43:11', '1',  'sellbillController.php','1','','0'); -- id=321
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1965', '1965', '2026-10-15', '1', '0', '0', '2026-10-15 18:43:11','اضافة فاتورة مبيعات رقم 307','1','0',null,'0','307','sellbillController.php?do=showDetail&sellbillid=307'); -- id=1643
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1643', '383', '1965', '','0'); -- id=1657
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '11873.49', 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 ('1643', '143', '1965', '','0'); -- id=1647
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1312825.33', 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 ( '1848.34', '1848.34', '2026-10-15', '1', '0', '0', '2026-10-15 18:43:11','اضافة فاتورة مبيعات رقم 307 - صرف البضاعة من المخزن','1','0',null,'0','307','sellbillController.php?do=showDetail&sellbillid=307'); -- id=1644
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1644', '402', '1848.34', '','0'); -- id=1658
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1176511.55', 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 ('1644', '382', '1848.34', '','0'); -- id=1648
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2314286.54', 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='1643,0,1644' where sellbillid=307;
 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-15', 1965, 1848.34, 1848.34
                    , 1701.62, 1848.34, 1701.62, 1848.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1848.34, 1701.62, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1965, sellCostBuyPrice =sellCostBuyPrice+1848.34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1848.34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1701.62
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1848.34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1701.62
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1848.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1848.34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1701.62
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1965, 1848.34, 1848.34
                    , 1701.62, 1848.34, 1701.62, 1848.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1848.34, 1701.62, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1965, sellCostBuyPrice =sellCostBuyPrice+1848.34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1848.34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1701.62
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1848.34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1701.62
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1848.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1848.34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1701.62
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 1965, 1848.34, 1848.34
                    , 1701.62, 1848.34, 1701.62, 1848.34, 1848.34, 1701.62)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1965, netSellCostBuyPrice = netSellCostBuyPrice+1848.34
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1848.34
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1701.62
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1848.34
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1701.62
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1848.34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1848.34
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1701.62;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad0ffa4e37b5 and sellbillId = 307 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:13:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:43:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:43:12', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4284
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:14:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:44:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:44:33', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4285
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:14:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:44:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:44:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 15:14:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 18:44:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 18:44:46', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=306'); -- id=4287
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:09:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:39:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:39:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=4288
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:10:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:40:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:40:56', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4289
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:11:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:41:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:41:19', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4290
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:11:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:41:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:41:44', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=168'); -- id=4291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:14:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:44:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:44:56', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=4292

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad10fee91eec
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(39,@clientdebt,@clientname,@treeIdis);
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-15 19:44:57', '06ad10fee91eec', '39', '588.00', '-6090', '0', '1', '6678', '6678', '0', '-6678', '1', '2026-10-15 19:44:57', '', '1', '0', 'محمد عباس الطوخي','1', '1', '5', '0', 'محمد عباس الطوخي', '45', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','','0'); -- id=20
UPDATE client SET  clientdebt = '-6090', userid = '1' WHERE clientid = '39';
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 ('39','588.00','6678','1','اضافة فاتورة مردوات مبيعات','20', '-6090', '2026-10-15 19:44:57', '1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '6678', '0', null, '0', null, null,'', '0','1','1','6678','1','2026-10-15 19:44:57','0','0','',''); -- id=520
UPDATE client SET  inUse = 0 where clientid = 39;
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 ('190.00', '00548', '20', '1', '548', '9', '198', '1782', '0', '', '1', '0', '548', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','198','1782','0','','0'); -- id=84
UPDATE returnsellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where returnsellbilldetailid = 84;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (548, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1782, 1710, 1710, 1710
                    , 1710, 1710, 1710, 0, 9, 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+1782, 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+9;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1782, 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+1782, 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 = '38', userid = '1', storedetaildate = '2026-10-15 19:44:58' WHERE storedetailid = '548';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('548', '1', '9', '0', '20', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '29', '38', '1', '2026-10-15 19:44:58','0','0'); -- id=4460
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 ('129.70', '00062', '20', '1', '62', '7', '136', '952', '0', '', '1', '0', '62', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','136','952','0','','0'); -- id=85
UPDATE returnsellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where returnsellbilldetailid = 85;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (62, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 952, 907.9, 907.9, 907.9
                    , 907.9, 907.9, 907.9, 0, 7, 0, 0, 907.9, 907.9)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+952, returnSellCostBuyPrice = returnSellCostBuyPrice+907.9, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+907.9
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+907.9, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+907.9
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+907.9
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+907.9
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+907.9
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+907.9
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+7;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 952, 907.9, 907.9, 907.9
                    , 907.9, 907.9, 907.9, 0, 0, 907.9, 907.9)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+952, returnSellCostBuyPrice = returnSellCostBuyPrice+907.9, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+907.9
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+907.9, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+907.9
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+907.9
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+907.9
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+907.9
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+907.9;
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2026-10-15 19:44:58' WHERE storedetailid = '62';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('62', '1', '7', '0', '20', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '16', '23', '1', '2026-10-15 19:44:58','0','0'); -- id=4461
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 ('129.70', '00059', '20', '1', '59', '15', '136', '2040', '0', '', '1', '0', '59', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','136','2040','0','','0'); -- id=86
UPDATE returnsellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where returnsellbilldetailid = 86;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (59, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2040, 1945.5, 1945.5, 1945.5
                    , 1945.5, 1945.5, 1945.5, 0, 15, 0, 0, 1945.5, 1945.5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2040, returnSellCostBuyPrice = returnSellCostBuyPrice+1945.5, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1945.5
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1945.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1945.5
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1945.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1945.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1945.5
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1945.5
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+15;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2040, 1945.5, 1945.5, 1945.5
                    , 1945.5, 1945.5, 1945.5, 0, 0, 1945.5, 1945.5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2040, returnSellCostBuyPrice = returnSellCostBuyPrice+1945.5, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1945.5
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1945.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1945.5
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1945.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1945.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1945.5
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1945.5;
UPDATE storedetail SET  productquantity = '169', userid = '1', storedetaildate = '2026-10-15 19:44:58' WHERE storedetailid = '59';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('59', '1', '15', '0', '20', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '154', '169', '1', '2026-10-15 19:44:58','0','0'); -- id=4462
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 ('129.70', '00060', '20', '1', '60', '8', '136', '1088', '0', '', '1', '0', '60', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','136','1088','0','','0'); -- id=87
UPDATE returnsellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where returnsellbilldetailid = 87;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (60, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1088, 1037.6, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 0, 8, 0, 0, 1037.6, 1037.6)
                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+1088, returnSellCostBuyPrice = returnSellCostBuyPrice+1037.6, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1037.6
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1037.6, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1037.6
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1037.6
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1037.6
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1037.6
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1037.6
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+8;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1088, 1037.6, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 0, 0, 1037.6, 1037.6)
                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+1088, returnSellCostBuyPrice = returnSellCostBuyPrice+1037.6, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1037.6
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1037.6, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1037.6
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1037.6
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1037.6
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1037.6
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1037.6;
UPDATE storedetail SET  productquantity = '43', userid = '1', storedetaildate = '2026-10-15 19:44:59' WHERE storedetailid = '60';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('60', '1', '8', '0', '20', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '35', '43', '1', '2026-10-15 19:44:59','0','0'); -- id=4463
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 ('129.70', '00061', '20', '1', '61', '6', '136', '816', '0', '', '1', '0', '61', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','136','816','0','','0'); -- id=88
UPDATE returnsellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where returnsellbilldetailid = 88;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (61, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 816, 778.2, 778.2, 778.2
                    , 778.2, 778.2, 778.2, 0, 6, 0, 0, 778.2, 778.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+816, returnSellCostBuyPrice = returnSellCostBuyPrice+778.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+778.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+778.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+778.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+778.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+778.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+778.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+778.2
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+6;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 816, 778.2, 778.2, 778.2
                    , 778.2, 778.2, 778.2, 0, 0, 778.2, 778.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+816, returnSellCostBuyPrice = returnSellCostBuyPrice+778.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+778.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+778.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+778.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+778.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+778.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+778.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+778.2;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-10-15 19:44:59' WHERE storedetailid = '61';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('61', '1', '6', '0', '20', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '49', '55', '1', '2026-10-15 19:44:59','0','0'); -- id=4464
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6678', '6678', '2026-10-15', '1', '0', '0', '2026-10-15 19:44:59','اضافة فاتورة مردود مبيعات رقم 20','1','0',null,'0','20','returnsellbillController.php?do=showDetail&returnsellbillid=20'); -- id=1645
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1645', '143', '6678', '','0'); -- id=1659
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1306147.33', 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 ('1645', '471', '6678', '','0'); -- id=1649
UPDATE accountstree SET name = 'محمد عباس الطوخي', customName = 'محمد عباس الطوخي', customNameEn = 'محمد عباس الطوخي', nameEn = 'محمد عباس الطوخي', parent = '58', accountNature = '0', theValue = '-6090', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 19:10:39' WHERE id = '471';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6379.2', '6379.2', '2026-10-15', '1', '0', '0', '2026-10-15 19:44:59','اضافة فاتورة مردود مبيعات رقم 20 - صرف البضاعة من المخزن','1','0',null,'0','20','returnsellbillController.php?do=showDetail&returnsellbillid=20'); -- id=1646
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1646', '382', '6379.2', '','0'); -- id=1660
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2320665.74', 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 ('1646', '402', '6379.2', '','0'); -- id=1650
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1170132.35', 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='1645,0,1646' where returnsellbillid=20;
 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-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 6678, 6379.2, 6379.2, 6379.2
                    , 6379.2, 6379.2, 6379.2 ,0, 0, 6379.2, 6379.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+6678, returnSellCostBuyPrice = returnSellCostBuyPrice+6379.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+6379.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+6379.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+6379.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+6379.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+6379.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+6379.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+6379.2;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (39, '2026-10-15', 0, 0, 0
                    , 0, 0, 0, 0
                    , 6678, 6379.2, 6379.2, 6379.2
                    , 6379.2, 6379.2, 6379.2 ,0, 0, 6379.2, 6379.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+6678, returnSellCostBuyPrice = returnSellCostBuyPrice+6379.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+6379.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+6379.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+6379.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+6379.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+6379.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+6379.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+6379.2;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -6678, -6379.2, -6379.2
                    , -6379.2, -6379.2, -6379.2, -6379.2, -6379.2, -6379.2)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-6678, netSellCostBuyPrice = netSellCostBuyPrice+-6379.2
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-6379.2
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-6379.2
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-6379.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-6379.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-6379.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-6379.2
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-6379.2;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad10fee91eec and sellbillId = 20 and returnsellbillId = 20
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:15:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:45:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:45:02', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=4293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:15:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:45:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:45:06', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4294
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:15:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:45:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:45:12', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4295
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:15:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:45:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:45:19', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:15:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:45:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:45:25', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=300'); -- id=4297
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:16:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:46:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:46:06', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4298
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:16:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:46:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:46:13', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:16:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:46:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:46:25', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=150'); -- id=4300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:17:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:47:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:47:47', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=4301
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 300;
UPDATE sellbill SET  sellbillsysdate = '2026-10-15 19:47:48', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '300';
UPDATE sellbilldetail SET  lastbuyprice = 41.00 , meanbuyprice = 41.00, lastbuyprice_withDiscount = 41.00, meanbuyprice_withDiscount = 41.00
        , lastbuyprice_withTax = 41, meanbuyprice_withTax = 41, lastbuyprice_withDiscountAndTax = 41
                where sellbilldetailid = 2361;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (411, '2026-10-15', 100, 82, 82
                    , 82, 82, 82, 82
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 82, 82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-82
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-82, sellCostMeanBuyPrice = sellCostMeanBuyPrice-82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-82, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-82
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-82
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 100, 82, 82
                    , 82, 82, 82, 82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 82, 82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-100, sellCostBuyPrice =sellCostBuyPrice-82
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-82, sellCostMeanBuyPrice = sellCostMeanBuyPrice-82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-82, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-82
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-82
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 19:47:48' WHERE storedetailid = '411';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('411', '1', '2', '0', '300', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7', '9', '1', '2026-10-14 20:11:13','0','0'); -- id=4465
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 2362;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (412, '2026-10-15', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 19:47:48' WHERE storedetailid = '412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '1', '0', '300', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-10-14 20:11:13','0','0'); -- id=4466
UPDATE sellbilldetail SET  lastbuyprice = 21.00 , meanbuyprice = 21.00, lastbuyprice_withDiscount = 21.00, meanbuyprice_withDiscount = 21.00
        , lastbuyprice_withTax = 21, meanbuyprice_withTax = 21, lastbuyprice_withDiscountAndTax = 21
                where sellbilldetailid = 2363;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (409, '2026-10-15', 60, 42, 42
                    , 42, 42, 42, 42
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 42, 42, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-42
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-42, sellCostMeanBuyPrice = sellCostMeanBuyPrice-42
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-42, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-42
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-42
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-42
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 60, 42, 42
                    , 42, 42, 42, 42
                    , 0, 0, 0, 0
                    , 0, 0, 0, 42, 42, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-42
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-42, sellCostMeanBuyPrice = sellCostMeanBuyPrice-42
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-42, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-42
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-42
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-42
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 19:47:48' WHERE storedetailid = '409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('409', '1', '2', '0', '300', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '8', '1', '2026-10-14 20:11:13','0','0'); -- id=4467
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2364;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 93, 80, 80
                    , 80.58, 80, 80.58, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 80, 80.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-93, sellCostBuyPrice =sellCostBuyPrice-80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-80, sellCostMeanBuyPrice = sellCostMeanBuyPrice-80.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-80.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-80.58
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 93, 80, 80
                    , 80.58, 80, 80.58, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 80.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-93, sellCostBuyPrice =sellCostBuyPrice-80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-80, sellCostMeanBuyPrice = sellCostMeanBuyPrice-80.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-80.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-80.58
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 19:47:48' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '1', '0', '300', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-4', '-3', '1', '2026-10-14 20:11:13','0','0'); -- id=4468
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 2365;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (596, '2026-10-15', 275, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-275, sellCostBuyPrice =sellCostBuyPrice-190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-190, sellCostMeanBuyPrice = sellCostMeanBuyPrice-190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-190
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-15', 275, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-275, sellCostBuyPrice =sellCostBuyPrice-190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-190, sellCostMeanBuyPrice = sellCostMeanBuyPrice-190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-190
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-15 19:47:48' WHERE storedetailid = '596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('596', '1', '1', '0', '300', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '1', '2026-10-14 20:11:13','0','0'); -- id=4469
CALL clientInUse(39,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-6678', userid = '1' WHERE clientid = '39';
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 ('39','-6090.00','588.00','1','تعديل فاتورة مبيعات','300', '-6678', '2026-10-14 20:11:13', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '588', '0', null, '0', null, null,'', '0','1','1','588','1','2026-10-14 20:11:13','0','0','',''); -- id=521
UPDATE client SET  inUse = 0 where clientid = 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-15', 588, 444, 444
                    , 444.58, 444, 444.58, 444
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,444, 444.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-588, sellCostBuyPrice =sellCostBuyPrice-444
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-444, sellCostMeanBuyPrice = sellCostMeanBuyPrice-444.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-444, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-444.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-444
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-444
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-444.58
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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 (39, '2026-10-15', 588, 444, 444
                    , 444.58, 444, 444.58, 444
                    , 0, 0, 0, 0
                    , 0, 0, 0, 444, 444.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-588, sellCostBuyPrice =sellCostBuyPrice-444
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-444, sellCostMeanBuyPrice = sellCostMeanBuyPrice-444.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-444, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-444.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-444
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-444
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-444.58
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 588, 444, 444
                    , 444.58, 444, 444.58, 444, 444, 444.58)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-588, netSellCostBuyPrice = netSellCostBuyPrice-444
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-444
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-444.58
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-444
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-444.58
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-444
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-444
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-444.58;

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


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

COMMIT;
BEGIN;
CALL clientInUse(39,@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-14 20:11:13', '06acfc45573e4e', '39', '-6678.00', '636', '0', '1', '7314', '7314', '0', '7314', '1', '2026-10-14 20:11:13', '', '1', '0', 'محمد عباس الطوخي', '1', '1', '3', '0', 'محمد عباس الطوخي', '57', '300', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-14','1','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=308
UPDATE client SET  clientdebt = '636', userid = '1' WHERE clientid = '39';
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 ('39','-6678.00','7314','0','اضافة فاتورة مبيعات (معدله)','308', '636', '2026-10-15 19:47:49', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '7314', '0', null, '0', null, null,'', '0','1','1','588','1','2026-10-14 20:11:13','0','0','',''); -- id=522
UPDATE client SET  inUse = 0 where clientid = 39;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('41','00411', '308', '6', '411', '2.00', '50', '100', '0', '', '1', '2026-10-15 19:47:50', '411', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','50','100','0','','0','0.00','0','0','0','0'); -- id=2470
UPDATE sellbilldetail SET  lastbuyprice = 41.00 , meanbuyprice = 41.00, lastbuyprice_withDiscount = 41.00, meanbuyprice_withDiscount = 41.00
        , lastbuyprice_withTax = 41, meanbuyprice_withTax = 41, lastbuyprice_withDiscountAndTax = 41
                where sellbilldetailid = 2470;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (411, '2026-10-15', 100, 82, 82
                    , 82, 82, 82, 82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 82, 82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+82
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+82, sellCostMeanBuyPrice = sellCostMeanBuyPrice+82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+82, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+82
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+82
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 100, 82, 82
                    , 82, 82, 82, 82
                    , 0, 0, 0, 0
                    , 0, 0, 0, 82, 82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, sellCostBuyPrice =sellCostBuyPrice+82
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+82, sellCostMeanBuyPrice = sellCostMeanBuyPrice+82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+82, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+82
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+82
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+82
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 19:47:50' WHERE storedetailid = '411';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('411', '1', '2', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '7', '1', '2026-10-15 19:47:50','0','0'); -- id=4470
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('50','00412', '308', '6', '412', '1.00', '60', '60', '0', '', '1', '2026-10-15 19:47:50', '412', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','60','0','','0','0.00','0','0','0','0'); -- id=2471
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 2471;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (412, '2026-10-15', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-10-15 19:47:50' WHERE storedetailid = '412';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '1', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-10-15 19:47:50','0','0'); -- id=4471
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('21','00409', '308', '6', '409', '2.00', '30', '60', '0', '', '1', '2026-10-15 19:47:50', '409', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','30','60','0','','0','0.00','0','0','0','0'); -- id=2472
UPDATE sellbilldetail SET  lastbuyprice = 21.00 , meanbuyprice = 21.00, lastbuyprice_withDiscount = 21.00, meanbuyprice_withDiscount = 21.00
        , lastbuyprice_withTax = 21, meanbuyprice_withTax = 21, lastbuyprice_withDiscountAndTax = 21
                where sellbilldetailid = 2472;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (409, '2026-10-15', 60, 42, 42
                    , 42, 42, 42, 42
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 42, 42, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+42
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+42, sellCostMeanBuyPrice = sellCostMeanBuyPrice+42
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+42, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+42
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+42
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+42
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 60, 42, 42
                    , 42, 42, 42, 42
                    , 0, 0, 0, 0
                    , 0, 0, 0, 42, 42, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+60, sellCostBuyPrice =sellCostBuyPrice+42
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+42, sellCostMeanBuyPrice = sellCostMeanBuyPrice+42
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+42, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+42
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+42
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+42
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+42
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 19:47:51' WHERE storedetailid = '409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('409', '1', '2', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '6', '1', '2026-10-15 19:47:51','0','0'); -- id=4472
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('80','00387', '308', '7', '387', '1.00', '93', '93', '0', '', '1', '2026-10-15 19:47:51', '387', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','93','93','0','','0','0.00','0','0','0','0'); -- id=2473
UPDATE sellbilldetail SET  lastbuyprice = 80.00 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80.00, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where sellbilldetailid = 2473;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (387, '2026-10-15', 93, 80, 80
                    , 80.58, 80, 80.58, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 80, 80.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+93, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80.58
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 93, 80, 80
                    , 80.58, 80, 80.58, 80
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 80.58, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+93, sellCostBuyPrice =sellCostBuyPrice+80
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+80, sellCostMeanBuyPrice = sellCostMeanBuyPrice+80.58
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+80, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+80.58
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+80
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+80
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+80.58
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 19:47:51' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '1', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-3', '-4', '1', '2026-10-15 19:47:51','0','0'); -- id=4473
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','00596', '308', '6', '596', '1.00', '275', '275', '0', '', '1', '2026-10-15 19:47:51', '596', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','275','275','0','','0','0.00','0','0','0','0'); -- id=2474
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 2474;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (596, '2026-10-15', 275, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 275, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+275, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 19:47:51' WHERE storedetailid = '596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('596', '1', '1', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-10-15 19:47:51','0','0'); -- id=4474
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 23;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 174;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('101','00107', '308', '3', '107', '15', '103', '1545', '0', '', '1', '2026-10-15 19:47:51', '107', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','23-3,174-12,','1','1','0','0','103','1545','0','','0','0.00','0','0','0','0'); -- id=2475
UPDATE sellbilldetail SET  lastbuyprice = 101.00 , meanbuyprice = 101.00, lastbuyprice_withDiscount = 101.00, meanbuyprice_withDiscount = 101.00
        , lastbuyprice_withTax = 101, meanbuyprice_withTax = 101, lastbuyprice_withDiscountAndTax = 101
                where sellbilldetailid = 2475;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (107, '2026-10-15', 1545, 1515, 1515
                    , 1515, 1515, 1515, 1515
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 1515, 1515, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1515, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1515
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1515
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1545, 1515, 1515
                    , 1515, 1515, 1515, 1515
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1515, 1515, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1515, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1515
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1515
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1515
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1515
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-15 19:47:52' WHERE storedetailid = '107';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('107', '1', '15', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '85', '70', '1', '2026-10-15 19:47:52','0','0'); -- id=4475
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00060', '308', '1', '60', '8', '136', '1088', '0', '', '1', '2026-10-15 19:47:52', '60', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','1088','0','','0','0.00','0','0','0','0'); -- id=2476
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2476;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (60, '2026-10-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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+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-15', 1088, 1037.6, 1037.6
                    , 1037.6, 1037.6, 1037.6, 1037.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1037.6, 1037.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1088, sellCostBuyPrice =sellCostBuyPrice+1037.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1037.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1037.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1037.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1037.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1037.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1037.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1037.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 = '35', userid = '1', storedetaildate = '2026-10-15 19:47:52' WHERE storedetailid = '60';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('60', '1', '8', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '43', '35', '1', '2026-10-15 19:47:52','0','0'); -- id=4476
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00061', '308', '1', '61', '6', '136', '816', '0', '', '1', '2026-10-15 19:47:52', '61', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','816','0','','0','0.00','0','0','0','0'); -- id=2477
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2477;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (61, '2026-10-15', 816, 778.2, 778.2
                    , 778.2, 778.2, 778.2, 778.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 778.2, 778.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+816, sellCostBuyPrice =sellCostBuyPrice+778.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+778.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+778.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+778.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+778.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+778.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+778.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+778.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 816, 778.2, 778.2
                    , 778.2, 778.2, 778.2, 778.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 778.2, 778.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+816, sellCostBuyPrice =sellCostBuyPrice+778.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+778.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+778.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+778.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+778.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+778.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+778.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+778.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '49', userid = '1', storedetaildate = '2026-10-15 19:47:52' WHERE storedetailid = '61';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('61', '1', '6', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '55', '49', '1', '2026-10-15 19:47:52','0','0'); -- id=4477
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('129.7','00062', '308', '1', '62', '7', '136', '952', '0', '', '1', '2026-10-15 19:47:52', '62', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','136','952','0','','0','0.00','0','0','0','0'); -- id=2478
UPDATE sellbilldetail SET  lastbuyprice = 129.70 , meanbuyprice = 129.70, lastbuyprice_withDiscount = 129.70, meanbuyprice_withDiscount = 129.70
        , lastbuyprice_withTax = 129.7, meanbuyprice_withTax = 129.7, lastbuyprice_withDiscountAndTax = 129.7
                where sellbilldetailid = 2478;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (62, '2026-10-15', 952, 907.9, 907.9
                    , 907.9, 907.9, 907.9, 907.9
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 907.9, 907.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+952, sellCostBuyPrice =sellCostBuyPrice+907.9
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+907.9, sellCostMeanBuyPrice = sellCostMeanBuyPrice+907.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+907.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+907.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+907.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+907.9
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+907.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-15', 952, 907.9, 907.9
                    , 907.9, 907.9, 907.9, 907.9
                    , 0, 0, 0, 0
                    , 0, 0, 0, 907.9, 907.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+952, sellCostBuyPrice =sellCostBuyPrice+907.9
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+907.9, sellCostMeanBuyPrice = sellCostMeanBuyPrice+907.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+907.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+907.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+907.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+907.9
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+907.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-15 19:47:53' WHERE storedetailid = '62';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('62', '1', '7', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '23', '16', '1', '2026-10-15 19:47:53','0','0'); -- id=4478
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '308', '14', '81', '5', '19', '95', '0', '', '1', '2026-10-15 19:47:53', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','95','0','','0','0.00','0','0','0','0'); -- id=2479
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 2479;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-10-15', 95, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+90
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 95, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+90
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-15 19:47:53' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '5', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '95', '90', '1', '2026-10-15 19:47:53','0','0'); -- id=4479
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('23','00528', '308', '6', '528', '2', '25', '50', '0', '', '1', '2026-10-15 19:47:53', '528', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','25','50','0','','0','0.00','0','0','0','0'); -- id=2480
UPDATE sellbilldetail SET  lastbuyprice = 23.00 , meanbuyprice = 23.00, lastbuyprice_withDiscount = 23.00, meanbuyprice_withDiscount = 23.00
        , lastbuyprice_withTax = 23, meanbuyprice_withTax = 23, lastbuyprice_withDiscountAndTax = 23
                where sellbilldetailid = 2480;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (528, '2026-10-15', 50, 46, 46
                    , 46, 46, 46, 46
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 46, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+46
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+46, sellCostMeanBuyPrice = sellCostMeanBuyPrice+46
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+46, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+46
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+46
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+46
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 50, 46, 46
                    , 46, 46, 46, 46
                    , 0, 0, 0, 0
                    , 0, 0, 0, 46, 46, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+46
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+46, sellCostMeanBuyPrice = sellCostMeanBuyPrice+46
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+46, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+46
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+46
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+46
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+46
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2026-10-15 19:47:53' WHERE storedetailid = '528';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('528', '1', '2', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '17', '1', '2026-10-15 19:47:53','0','0'); -- id=4480
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 130;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('254','00314', '308', '1', '314', '1', '266', '266', '0', '', '1', '2026-10-15 19:47:53', '314', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','130-1,','1','1','0','0','266','266','0','','0','0.00','0','0','0','0'); -- id=2481
UPDATE sellbilldetail SET  lastbuyprice = 254.00 , meanbuyprice = 254.00, lastbuyprice_withDiscount = 254.00, meanbuyprice_withDiscount = 254.00
        , lastbuyprice_withTax = 254, meanbuyprice_withTax = 254, lastbuyprice_withDiscountAndTax = 254
                where sellbilldetailid = 2481;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (314, '2026-10-15', 266, 254, 254
                    , 254, 254, 254, 254
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 254, 254, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+266, sellCostBuyPrice =sellCostBuyPrice+254
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+254, sellCostMeanBuyPrice = sellCostMeanBuyPrice+254
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+254, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+254
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+254
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+254
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+254
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 266, 254, 254
                    , 254, 254, 254, 254
                    , 0, 0, 0, 0
                    , 0, 0, 0, 254, 254, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+266, sellCostBuyPrice =sellCostBuyPrice+254
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+254, sellCostMeanBuyPrice = sellCostMeanBuyPrice+254
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+254, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+254
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+254
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+254
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+254
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2026-10-15 19:47:54' WHERE storedetailid = '314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('314', '1', '1', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '17', '1', '2026-10-15 19:47:54','0','0'); -- id=4481
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 71;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 156;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','00009', '308', '1', '9', '6', '319', '1914', '0', '', '1', '2026-10-15 19:47:54', '9', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','71-3,156-3,','1','1','0','0','319','1914','0','','0','0.00','0','0','0','0'); -- id=2482
UPDATE sellbilldetail SET  lastbuyprice = 306.00 , meanbuyprice = 306.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 2482;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9, '2026-10-15', 1914, 1836, 1836
                    , 1836, 1836, 1836, 1836
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1836, 1836, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1914, sellCostBuyPrice =sellCostBuyPrice+1836
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1836, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1836
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1836, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1836
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1836
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1836
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-15', 1914, 1836, 1836
                    , 1836, 1836, 1836, 1836
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1836, 1836, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1914, sellCostBuyPrice =sellCostBuyPrice+1836
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1836, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1836
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1836, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1836
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1836
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1836
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '205', userid = '1', storedetaildate = '2026-10-15 19:47:54' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '6', '1', '308', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '211', '205', '1', '2026-10-15 19:47:54','0','0'); -- id=4482
UPDATE dailyentry SET totalcreditor = '588.00', totaldebtor = '588.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 20:11:15', entryComment = 'اضافة فاتورة مبيعات رقم 300', fromFlag = '1',related='0',isopeningentry='0',operationId='300',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=300' WHERE id = '1612';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '588.00', '588.00', '2026-10-15', '1', '0', '1612', '2026-10-15 19:47:54','تم عكس القيد رقم 1612 ','1','0','0','0','0',''); -- id=1647
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1647', '471', '588.00', '','0'); -- id=1651
UPDATE accountstree SET name = 'محمد عباس الطوخي', customName = 'محمد عباس الطوخي', customNameEn = 'محمد عباس الطوخي', nameEn = 'محمد عباس الطوخي', parent = '58', accountNature = '0', theValue = '-6678', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 19:10:39' WHERE id = '471';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1647', '143', '588.00', '','0'); -- id=1661
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1305559.33', 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 = '444.00', totaldebtor = '444.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 20:11:15', entryComment = 'اضافة فاتورة مبيعات رقم 300 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='300',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=300' WHERE id = '1613';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '444.00', '444.00', '2026-10-15', '1', '0', '1613', '2026-10-15 19:47:55','تم عكس القيد رقم 1613 ','1','0','0','0','0',''); -- id=1648
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1648', '402', '444.00', '','0'); -- id=1652
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1169688.35', 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 ('1648', '382', '444.00', '','0'); -- id=1662
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2321109.74', 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 ( '7314', '7314', '2026-10-15', '1', '0', '0', '2026-10-15 19:47:55','اضافة فاتورة مبيعات رقم 308','1','0',null,'0','308','sellbillController.php?do=showDetail&sellbillid=308'); -- id=1649
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1649', '471', '7314', '','0'); -- id=1663
UPDATE accountstree SET name = 'محمد عباس الطوخي', customName = 'محمد عباس الطوخي', customNameEn = 'محمد عباس الطوخي', nameEn = 'محمد عباس الطوخي', parent = '58', accountNature = '0', theValue = '636', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 19:10:39' WHERE id = '471';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1649', '143', '7314', '','0'); -- id=1653
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1312873.33', 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 ( '6908.7', '6908.7', '2026-10-15', '1', '0', '0', '2026-10-15 19:47:55','اضافة فاتورة مبيعات رقم 308 - صرف البضاعة من المخزن','1','0',null,'0','308','sellbillController.php?do=showDetail&sellbillid=308'); -- id=1650
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1650', '402', '6908.7', '','0'); -- id=1664
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '1176597.05', 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 ('1650', '382', '6908.7', '','0'); -- id=1654
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2314201.04', 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='1649,0,1650' where sellbillid=308;
 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-15', 7314, 6908.7, 6908.7
                    , 6909.28, 6908.7, 6909.28, 6908.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6908.7, 6909.28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7314, sellCostBuyPrice =sellCostBuyPrice+6908.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6908.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6909.28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6908.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6909.28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6908.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6908.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6909.28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (39, '2026-10-15', 7314, 6908.7, 6908.7
                    , 6909.28, 6908.7, 6909.28, 6908.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6908.7, 6909.28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7314, sellCostBuyPrice =sellCostBuyPrice+6908.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6908.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6909.28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6908.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6909.28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6908.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6908.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6909.28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 7314, 6908.7, 6908.7
                    , 6909.28, 6908.7, 6909.28, 6908.7, 6908.7, 6909.28)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7314, netSellCostBuyPrice = netSellCostBuyPrice+6908.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6908.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6909.28
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6908.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6909.28
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6908.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6908.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6909.28;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 300 and newid=308 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:17:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:47:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:47:57', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=308'); -- id=4302
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 19:48:14', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 19:48:20', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-15 19:48:32', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/returnsellbillController.php?do=showDetail&returnsellbillid=20'); -- id=4305
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:48:34', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=300'); -- id=4306
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 19:48:49', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:18:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:48:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 19:48:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:19:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:49:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:49:05', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=308'); -- id=4309
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:19:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:49:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 19:49:40', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4310
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:23:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:53:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 19:53:19', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=4311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:23:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:53:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:53:40', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:24:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:54:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:54:10', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=4313
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 ('لمبه 100 وات ايفر ','','6','15','16','18','16','2026-10-15','0','1','0','','0','0','0','0','0','15','15','15','15','15','0','6.67','6.67','20','.','0','0','0','15','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','15','15','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','15','0','0','0','0','0','0','','','0','0','0','0'); -- id=598
UPDATE product SET productName = 'لمبه 100 وات ايفر ', productDescription = '', productCatId = '6', productBuyPrice = '15', productSellAllPrice = '16', productSellUnitPrice = '18', productSellHalfPrice = '16', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00598',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '15',lastbuyprice_withDiscount = '15',meanbuyprice = '15',meanbuyprice_withDiscount = '15' , productbuypricereal = '15' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '6.67' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='15',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='15',meanbuyprice_withTax='15',price4='0',price5='0',price6='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='15',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '598';
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', '598', '1.00', '2026-10-15', '1', '0','0059801','16','16','18','15','','0','0','0','0','0','0','0','0','0','0'); -- id=598
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('598', '1', '400', '1', '2026-10-15'); -- id=598
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('598', '1', '400', '0', '598', 'إضافة منتج', 'productController.php', '0', '400', '1', '2026-10-15','0','0'); -- id=4483
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (598, 1,'2026-10-15 19:54:11',1)
                ON DUPLICATE KEY UPDATE productid = 598, edited = 1, sysdate = '2026-10-15 19:54:11', userid = 1; -- id=797
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6000', '6000', '2026-10-15', '1', '0', '0', '2026-10-15 19:54:11','إضافة منتج لمبه 100 وات ايفر  الكمية 400','1','0','0','0','598','productController.php?do=edit&id=598'); -- id=1651
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1651', '382', '6000', '','0'); -- id=1665
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2320201.04', 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 ('1651', '121', '6000', '','0'); -- id=1655
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1839184.77', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'لمبه 100 وات ايفر ', productDescription = '', productCatId = '6', productBuyPrice = '15.00', productSellAllPrice = '16.00', productSellUnitPrice = '18.00', productSellHalfPrice = '16.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00598',type ='0', expireDate = '0' , dailyentryId = '1651',isService = '0',isOptic = '0',lastbuyprice = '15',lastbuyprice_withDiscount = '15',meanbuyprice = '15',meanbuyprice_withDiscount = '15' , productbuypricereal = '15' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '6.67' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='15',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='15',meanbuyprice_withTax='15',price4='0',price5='0',price6='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='15',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '598';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:24:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:54:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:54:14', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4314
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:24:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:54:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:54:34', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:24:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:54:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:54:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=4316
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 ('شريط لحام 20 متر لوك ','','6','17.85','18.5','19','18.5','2026-10-15','0','1','0','','0','0','0','0','0','17.85','17.85','17.85','17.85','17.85','0','3.64','3.64','6.44','.','0','0','0','17.85','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','17.85','17.85','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','17.85','0','0','0','0','0','0','','','0','0','0','0'); -- id=599
UPDATE product SET productName = 'شريط لحام 20 متر لوك ', productDescription = '', productCatId = '6', productBuyPrice = '17.85', productSellAllPrice = '18.5', productSellUnitPrice = '19', productSellHalfPrice = '18.5', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00599',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '17.85',lastbuyprice_withDiscount = '17.85',meanbuyprice = '17.85',meanbuyprice_withDiscount = '17.85' , productbuypricereal = '17.85' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '3.64' , buypart_precentage = '6.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='17.85',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='17.85',meanbuyprice_withTax='17.85',price4='0',price5='0',price6='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='17.85',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '599';
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', '599', '1.00', '2026-10-15', '1', '0','0059901','18.5','18.5','19','17.85','','0','0','0','0','0','0','0','0','0','0'); -- id=599
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('599', '1', '200', '1', '2026-10-15'); -- id=599
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('599', '1', '200', '0', '599', 'إضافة منتج', 'productController.php', '0', '200', '1', '2026-10-15','0','0'); -- id=4484
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (599, 1,'2026-10-15 19:55:01',1)
                ON DUPLICATE KEY UPDATE productid = 599, edited = 1, sysdate = '2026-10-15 19:55:01', userid = 1; -- id=798
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3570', '3570', '2026-10-15', '1', '0', '0', '2026-10-15 19:55:01','إضافة منتج شريط لحام 20 متر لوك  الكمية 200','1','0','0','0','599','productController.php?do=edit&id=599'); -- id=1652
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1652', '382', '3570', '','0'); -- id=1666
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2323771.04', 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 ('1652', '121', '3570', '','0'); -- id=1656
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1842754.77', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'شريط لحام 20 متر لوك ', productDescription = '', productCatId = '6', productBuyPrice = '17.85', productSellAllPrice = '18.50', productSellUnitPrice = '19.00', productSellHalfPrice = '18.50', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00599',type ='0', expireDate = '0' , dailyentryId = '1652',isService = '0',isOptic = '0',lastbuyprice = '17.85',lastbuyprice_withDiscount = '17.85',meanbuyprice = '17.85',meanbuyprice_withDiscount = '17.85' , productbuypricereal = '17.85' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '3.64' , buypart_precentage = '6.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='17.85',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='17.85',meanbuyprice_withTax='17.85',price4='0',price5='0',price6='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='17.85',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '599';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:25:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 19:55:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-15 19:55:04', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=4317
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:33:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:03:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 20:03:13', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=4318
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 ('06ad11311d7676', '2026-10-15 19:53:21', '1', '81528.92', '81528.92', '0', '0', '26472.50',  '26472.50', '26472.5', '0', '1', '2026-10-15 20:03:13', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=55
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 ('00240', '55', '2', '240', '150', '26.25', '3937.50', '0', '', '2026-10-15 20:03:13', '240','','','0','0','0','0','0',null,'26.25','3937.5','0','0','0','0','0','0','0','0','1'); -- id=196
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 240, 0, 0
                    , 26.25, 150, 0, 0, 1, '2026-10-15 20:03:14')
                ON DUPLICATE KEY UPDATE buyprice = 26.25,
                        buyQuantity =buyQuantity+150, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:14' ; -- id=196
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('240', '26.25', '150', '0', 'buyBillController.php', '196', '', '0', '0'); -- id=196
UPDATE product SET  productBuyPrice = "26.25" WHERE productId = 240 ;
UPDATE buybilldetail SET  quantitybefore = 190 WHERE buybilldetailid = 196 ;
UPDATE product SET productName = 'لمبه 200 وات نيازا ', productDescription = '', productCatId = '2', productBuyPrice = '26.25', productSellAllPrice = '27.00', productSellUnitPrice = '28.00', productSellHalfPrice = '27.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00240',type ='0', expireDate = '0' , dailyentryId = '285',isService = '0',isOptic = '0',lastbuyprice = '26.25',lastbuyprice_withDiscount = '26.25',meanbuyprice = '26.25',meanbuyprice_withDiscount = '26.25' , productbuypricereal = '26.25' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '2.86' , buypart_precentage = '6.67',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26.25',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='26.25',meanbuyprice_withTax='26.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='26.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 = '240';
UPDATE buybilldetail SET  lastbuyprice = 26.25 , meanbuyprice = 26.25, lastbuyprice_withDiscount = 26.25, meanbuyprice_withDiscount = 26.25
        , lastbuyprice_withTax = 26.25, meanbuyprice_withTax = 26.25, lastbuyprice_withDiscountAndTax = 26.25
                where buybilldetailid = 196;
UPDATE productunit SET proUnitBuyPrice  = 26.25 * productnumber WHERE productid = 240;
UPDATE storedetail SET  productquantity = '340', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '240';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('240', '1', '150', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '190', '340', '1', '2026-10-15 19:53:21','0','0'); -- id=4485
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 ('00387', '55', '7', '387', '50', '80', '4000.00', '0', '', '2026-10-15 20:03:13', '387','','','0','0','0','0','0',null,'80','4000','0','0','0','0','0','0','0','0','1'); -- id=197
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 387, 0, 0
                    , 80, 50, 0, 0, 1, '2026-10-15 20:03:15')
                ON DUPLICATE KEY UPDATE buyprice = 80,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:15' ; -- id=197
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('387', '80', '50', '0', 'buyBillController.php', '197', '', '0', '0'); -- id=197
UPDATE product SET  productBuyPrice = "80" WHERE productId = 387 ;
UPDATE buybilldetail SET  quantitybefore = -4 WHERE buybilldetailid = 197 ;
UPDATE product SET productName = 'عود بروفايل 1.7 اسمر داخل ', productDescription = '', productCatId = '7', productBuyPrice = '80.00', productSellAllPrice = '90.00', productSellUnitPrice = '93.00', productSellHalfPrice = '90.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00387',type ='0', expireDate = '0' , dailyentryId = '495',isService = '0',isOptic = '0',lastbuyprice = '80',lastbuyprice_withDiscount = '80',meanbuyprice = '79.95',meanbuyprice_withDiscount = '79.95' , productbuypricereal = '83.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.43' , buyhalf_precentage = '8.43' , buypart_precentage = '12.05',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='80',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='80',meanbuyprice_withTax='79.95',price4='0',price5='0',price6='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='80',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '387';
UPDATE buybilldetail SET  lastbuyprice = 80 , meanbuyprice = 79.95, lastbuyprice_withDiscount = 80, meanbuyprice_withDiscount = 79.95
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 79.95, lastbuyprice_withDiscountAndTax = 80
                where buybilldetailid = 197;
UPDATE productunit SET proUnitBuyPrice  = 80 * productnumber WHERE productid = 387;
UPDATE storedetail SET  productquantity = '46', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '50', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-4', '46', '1', '2026-10-15 19:53:21','0','0'); -- id=4486
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 ('00318', '55', '7', '318', '50', '69.5', '3475.00', '0', '', '2026-10-15 20:03:13', '318','','','0','0','0','0','0',null,'69.5','3475','0','0','0','0','0','0','0','0','1'); -- id=198
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 318, 0, 0
                    , 69.5, 50, 0, 0, 1, '2026-10-15 20:03:15')
                ON DUPLICATE KEY UPDATE buyprice = 69.5,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:15' ; -- id=198
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('318', '69.5', '50', '0', 'buyBillController.php', '198', '', '0', '0'); -- id=198
UPDATE product SET  productBuyPrice = "69.5" WHERE productId = 318 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 198 ;
UPDATE product SET productName = 'عود بروفايل 1.7 فضي ', productDescription = '', productCatId = '7', productBuyPrice = '69.50', productSellAllPrice = '73.00', productSellUnitPrice = '75.00', productSellHalfPrice = '73.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00318',type ='0', expireDate = '0' , dailyentryId = '384',isService = '0',isOptic = '0',lastbuyprice = '69.5',lastbuyprice_withDiscount = '69.5',meanbuyprice = '69.33',meanbuyprice_withDiscount = '69.33' , productbuypricereal = '67.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.15' , buyhalf_precentage = '8.15' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='69.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='69.5',meanbuyprice_withTax='69.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='69.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 = '318';
UPDATE buybilldetail SET  lastbuyprice = 69.5 , meanbuyprice = 69.33, lastbuyprice_withDiscount = 69.5, meanbuyprice_withDiscount = 69.33
        , lastbuyprice_withTax = 69.5, meanbuyprice_withTax = 69.33, lastbuyprice_withDiscountAndTax = 69.5
                where buybilldetailid = 198;
UPDATE productunit SET proUnitBuyPrice  = 69.5 * productnumber WHERE productid = 318;
UPDATE storedetail SET  productquantity = '66', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '50', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '66', '1', '2026-10-15 19:53:21','0','0'); -- id=4487
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 ('00103', '55', '3', '103', '1000', '4.5', '4500.00', '0', '', '2026-10-15 20:03:13', '103','','','0','0','0','0','0',null,'4.5','4500','0','0','0','0','0','0','0','0','1'); -- id=199
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 103, 0, 0
                    , 4.5, 1000, 0, 0, 1, '2026-10-15 20:03:16')
                ON DUPLICATE KEY UPDATE buyprice = 4.5,
                        buyQuantity =buyQuantity+1000, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:16' ; -- id=199
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('103', '4.5', '1000', '0', 'buyBillController.php', '199', '', '0', '0'); -- id=199
UPDATE product SET  productBuyPrice = "4.5" WHERE productId = 103 ;
UPDATE buybilldetail SET  quantitybefore = 1128 WHERE buybilldetailid = 199 ;
UPDATE product SET productName = 'سداده', productDescription = '', productCatId = '3', productBuyPrice = '4.50', productSellAllPrice = '5.50', productSellUnitPrice = '5.50', productSellHalfPrice = '5.50', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '200', parcode = '00103',type ='0', expireDate = '0' , dailyentryId = '113',isService = '0',isOptic = '0',lastbuyprice = '4.5',lastbuyprice_withDiscount = '4.5',meanbuyprice = '4.5',meanbuyprice_withDiscount = '4.5' , productbuypricereal = '4.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '22.22' , buyhalf_precentage = '22.22' , buypart_precentage = '22.22',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.5',meanbuyprice_withTax='4.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='4.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 = '103';
UPDATE buybilldetail SET  lastbuyprice = 4.5 , meanbuyprice = 4.5, lastbuyprice_withDiscount = 4.5, meanbuyprice_withDiscount = 4.5
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where buybilldetailid = 199;
UPDATE productunit SET proUnitBuyPrice  = 4.5 * productnumber WHERE productid = 103;
UPDATE storedetail SET  productquantity = '2128', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '1000', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1128', '2128', '1', '2026-10-15 19:53:21','0','0'); -- id=4488
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 ('00100', '55', '3', '100', '300', '17.6', '5280.00', '0', '', '2026-10-15 20:03:13', '100','','','0','0','0','0','0',null,'17.6','5280','0','0','0','0','0','0','0','0','1'); -- id=200
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 100, 0, 0
                    , 17.6, 300, 0, 0, 1, '2026-10-15 20:03:17')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:17' ; -- id=200
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('100', '17.6', '300', '0', 'buyBillController.php', '200', '', '0', '0'); -- id=200
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 100 ;
UPDATE buybilldetail SET  quantitybefore = 315 WHERE buybilldetailid = 200 ;
UPDATE product SET productName = 'مفتاح مفرد ', productDescription = '', productCatId = '3', productBuyPrice = '17.60', productSellAllPrice = '17.75', productSellUnitPrice = '17.75', productSellHalfPrice = '17.75', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '100', parcode = '00100',type ='0', expireDate = '0' , dailyentryId = '110',isService = '0',isOptic = '0',lastbuyprice = '17.6',lastbuyprice_withDiscount = '17.6',meanbuyprice = '17.6',meanbuyprice_withDiscount = '17.6' , productbuypricereal = '17.60' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.85' , buyhalf_precentage = '0.85' , buypart_precentage = '0.85',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='17.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='17.6',meanbuyprice_withTax='17.6',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='17.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 = '100';
UPDATE buybilldetail SET  lastbuyprice = 17.6 , meanbuyprice = 17.6, lastbuyprice_withDiscount = 17.6, meanbuyprice_withDiscount = 17.6
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where buybilldetailid = 200;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 100;
UPDATE storedetail SET  productquantity = '615', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '300', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '315', '615', '1', '2026-10-15 19:53:21','0','0'); -- id=4489
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 ('00101', '55', '3', '101', '300', '17.6', '5280.00', '0', '', '2026-10-15 20:03:13', '101','','','0','0','0','0','0',null,'17.6','5280','0','0','0','0','0','0','0','0','1'); -- id=201
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 19:53:21', 1, 101, 0, 0
                    , 17.6, 300, 0, 0, 1, '2026-10-15 20:03:18')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:03:18' ; -- id=201
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('101', '17.6', '300', '0', 'buyBillController.php', '201', '', '0', '0'); -- id=201
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 101 ;
UPDATE buybilldetail SET  quantitybefore = 315 WHERE buybilldetailid = 201 ;
UPDATE product SET productName = 'بريزه مفرد', productDescription = '', productCatId = '3', productBuyPrice = '17.60', productSellAllPrice = '17.75', productSellUnitPrice = '17.75', productSellHalfPrice = '17.75', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '100', parcode = '00101',type ='0', expireDate = '0' , dailyentryId = '111',isService = '0',isOptic = '0',lastbuyprice = '17.6',lastbuyprice_withDiscount = '17.6',meanbuyprice = '17.6',meanbuyprice_withDiscount = '17.6' , productbuypricereal = '17.60' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.85' , buyhalf_precentage = '0.85' , buypart_precentage = '0.85',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='17.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='17.6',meanbuyprice_withTax='17.6',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='17.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 = '101';
UPDATE buybilldetail SET  lastbuyprice = 17.6 , meanbuyprice = 17.6, lastbuyprice_withDiscount = 17.6, meanbuyprice_withDiscount = 17.6
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where buybilldetailid = 201;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 101;
UPDATE storedetail SET  productquantity = '615', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '300', '0', '55', 'اضافة فاتورة مشتريات', 'buyBillController.php', '315', '615', '1', '2026-10-15 19:53:21','0','0'); -- id=4490
UPDATE supplier SET  suppliercurrentDebt = '81528.92',suppliercurrentDebtInCurrency= '81528.92' , userid = '1', supplierdate = '2026-10-15 20:03:13'   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', '81528.92', '0', '0', 'اضافة فاتورة مشتريات', '55', '81528.92', '2026-10-15 19:53:21', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','81528.92','0','81528.92','0',''); -- id=96
UPDATE save SET  savecurrentvalue = '-831459.75',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-804987.25','26472.5', '1', '1', 'اضافة فاتورة مشتريات', '55', '-831459.75', '2026-10-15 19:53:21', '1',  'buyBillController.php','0','','0'); -- id=322
update buybill set dailyentryid='0,0' where buybillid=55;
COMMIT;
UPDATE product SET overAllAveragePrice = 17.6 WHERE productId = 100;UPDATE product SET overAllAveragePrice = 17.6 WHERE productId = 101;UPDATE product SET overAllAveragePrice = 4.5 WHERE productId = 103;UPDATE product SET overAllAveragePrice = 26.25 WHERE productId = 240;UPDATE product SET overAllAveragePrice = 69.5 WHERE productId = 318;UPDATE product SET overAllAveragePrice = 80 WHERE productId = 387;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:33:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:03:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 20:03:19', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=4319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:33:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:03:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 20:03:20', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=55'); -- id=4320
UPDATE productunit SET unitid = '1', productid = '388', productnumber = '1.00', productunitdate = '2026-09-17', userid = '1', conditions = '0',proUnitParcode='0038801',proUnitSellAllPrice='5',proUnitSellHalfPrice='5',proUnitSellUnitPrice ='5.25',proUnitBuyPrice='4.82',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '388';
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.83', productSellAllPrice = '5', productSellUnitPrice = '5.25', productSellHalfPrice = '5', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.82',lastbuyprice_withDiscount = '4.82',meanbuyprice = '4.82',meanbuyprice_withDiscount = '4.82' , productbuypricereal = '4.75' , buypricereal_precentage = '0' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.82',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.82',meanbuyprice_withTax='4.82',price4='0',price5='0',price6='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='4.82',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '388';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:34:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:04:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 20:04:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=4321
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 ('06ad115685e3f9', '2026-10-15 20:03:20', '9', '160952.60', '169058.6', '0', '0', '8106.00',  '8106.00', '0', '8106', '1', '2026-10-15 20:05:00', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=56
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 ('00388', '56', '20', '388', '1680', '4.825', '8106.00', '0', '', '2026-10-15 20:05:00', '388','','','0','0','0','0','0',null,'4.825','8106','0','0','0','0','0','0','0','0','1'); -- id=202
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-15 20:03:20', 1, 388, 0, 0
                    , 4.83, 1680, 0, 0, 1, '2026-10-15 20:05:01')
                ON DUPLICATE KEY UPDATE buyprice = 4.83,
                        buyQuantity =buyQuantity+1680, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-15 20:05:01' ; -- id=202
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('388', '4.825', '1680', '0', 'buyBillController.php', '202', '', '0', '0'); -- id=202
UPDATE product SET  productBuyPrice = "4.825" WHERE productId = 388 ;
UPDATE buybilldetail SET  quantitybefore = 883 WHERE buybilldetailid = 202 ;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.83', productSellAllPrice = '5.00', productSellUnitPrice = '5.25', productSellHalfPrice = '5.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.825',lastbuyprice_withDiscount = '4.83',meanbuyprice = '4.82',meanbuyprice_withDiscount = '4.82' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.82',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.825',meanbuyprice_withTax='4.82',price4='0',price5='0',price6='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='4.83',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '388';
UPDATE buybilldetail SET  lastbuyprice = 4.825 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.83, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.825, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.83
                where buybilldetailid = 202;
UPDATE productunit SET proUnitBuyPrice  = 4.825 * productnumber WHERE productid = 388;
UPDATE storedetail SET  productquantity = '2563', userid = '1', storedetaildate = '2026-10-15' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '1680', '0', '56', 'اضافة فاتورة مشتريات', 'buyBillController.php', '883', '2563', '1', '2026-10-15 20:03:20','0','0'); -- id=4491
UPDATE supplier SET  suppliercurrentDebt = '169058.6',suppliercurrentDebtInCurrency= '169058.6' , userid = '1', supplierdate = '2026-10-15 20:05:00'   WHERE supplierid = '9';
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 ('9', '160952.60', '8106', '0', 'اضافة فاتورة مشتريات', '56', '169058.6', '2026-10-15 20:03:20', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','8106','1','160952.6','8106','169058.6','0',''); -- id=97
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8106', '8106', '2026-10-15', '1', '0', '0', '2026-10-15 20:05:01','اضافة فاتورة مشتريات رقم 56','1','0',null,'0','56','buyBillController.php?do=details&id=56'); -- id=1653
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1653', '382', '8106', '','0'); -- id=1667
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2331877.04', 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 ('1653', '432', '8106', '','0'); -- id=1657
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '169058.6', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
update buybill set dailyentryid='1653,0' where buybillid=56;
COMMIT;
UPDATE product SET overAllAveragePrice = 4.82 WHERE productId = 388;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-15 20:05:02', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=56'); -- id=4322
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=4323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:22', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=4324
BEGIN;
CALL supplierInUse(9,@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 ('9', '169058.60', '12000', '1', 'ايصال دفع لمورد', '1', '157058.6', '2026-10-15 20:05:08', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','12000','1','0','0','0','27',''); -- id=98
UPDATE supplierdebtchange SET supplierid = '9', supplierdebtchangebefore = '169058.60', supplierdebtchangeamount = '12000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '157058.6', supplierdebtchangedate = '2026-10-15 20:05:08', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='12000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='169058.6',debtchangamountInSupplierCurrency='12000',debtchangafterInSupplierCurrency='157058.6', paySerialNo='27',tagids='' WHERE supplierdebtchangeid = '98';
UPDATE supplier SET  suppliercurrentDebt = '157058.6',suppliercurrentDebtInCurrency= '157058.6' , userid = '1', supplierdate = '2026-10-15 20:05:23'   WHERE supplierid = '9';
UPDATE supplier SET  inUse = 0 where supplierid = 9;
UPDATE save SET  savecurrentvalue = '-843459.75',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-831459.75','12000', '1', '1', 'ايصال دفع لمورد', '98', '-843459.75', '2026-10-15 20:05:23', '1',  'supplierPayedDeptController.php','0','','0'); -- id=323
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12000', '12000', '2026-10-15', '1', '0', '0', '2026-10-15 20:05:23','ايصال دفع لمورد ( شركه باندا حساب نشات  ) ','1','0','0','0','98','supplierReportsController.php?do=show&id=98'); -- id=1654
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1654', '432', '12000', '','0'); -- id=1668
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '157058.6', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1654', '383', '12000', '','0'); -- id=1658
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-126.51', 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 = '9', supplierdebtchangebefore = '169058.60', supplierdebtchangeamount = '12000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '157058.60', supplierdebtchangedate = '2026-10-15 20:05:08', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '1654',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='12000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='169058.6',debtchangamountInSupplierCurrency='12000',debtchangafterInSupplierCurrency='157058.6', paySerialNo='27',tagids='' WHERE supplierdebtchangeid = '98';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:24";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:24', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=4325
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:26', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=4326
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:27', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=4327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-15 20:05:28', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=4328
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:36', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=4329
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', '23940.00', '10000', '1', 'ايصال دفع لمورد', '1', '13940', '2026-10-15 20:05:27', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','10000','1','0','0','0','28',''); -- id=99
UPDATE supplierdebtchange SET supplierid = '10', supplierdebtchangebefore = '23940.00', supplierdebtchangeamount = '10000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '13940', supplierdebtchangedate = '2026-10-15 20:05:27', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='23940',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='13940', paySerialNo='28',tagids='' WHERE supplierdebtchangeid = '99';
UPDATE supplier SET  suppliercurrentDebt = '13940',suppliercurrentDebtInCurrency= '13940' , userid = '1', supplierdate = '2026-10-15 20:05:37'   WHERE supplierid = '10';
UPDATE supplier SET  inUse = 0 where supplierid = 10;
UPDATE save SET  savecurrentvalue = '-853459.75',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-843459.75','10000', '1', '1', 'ايصال دفع لمورد', '99', '-853459.75', '2026-10-15 20:05:37', '1',  'supplierPayedDeptController.php','0','','0'); -- id=324
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10000', '10000', '2026-10-15', '1', '0', '0', '2026-10-15 20:05:37','ايصال دفع لمورد ( شركه باندا حساب محمد ) ','1','0','0','0','99','supplierReportsController.php?do=show&id=99'); -- id=1655
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1655', '433', '10000', '','0'); -- id=1669
UPDATE accountstree SET name = 'شركه باندا حساب محمد', customName = 'شركه باندا حساب محمد', customNameEn = 'شركه باندا حساب محمد', nameEn = 'شركه باندا حساب محمد', parent = '81', accountNature = '1', theValue = '13940', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:33' WHERE id = '433';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1655', '383', '10000', '','0'); -- id=1659
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-10126.51', 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 = '23940.00', supplierdebtchangeamount = '10000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '13940.00', supplierdebtchangedate = '2026-10-15 20:05:27', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '1655',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='23940',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='13940', paySerialNo='28',tagids='' WHERE supplierdebtchangeid = '99';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:38', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=4330
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-15 20:05:40', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=4331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:35:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:05:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-15 20:05:41', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=4332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:39:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:09:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:09:41', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4333
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:39:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:10:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 20:10:00', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:40:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:10:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 20:10:08', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4335
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:40:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:10:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-10-15 20:10:48', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=4336
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:40:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:10:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:10:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4337
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:41:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:11:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:11:05', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=4338
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:41:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:11:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:11:30', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=306'); -- id=4339
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:46:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:16:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 20:16:24', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:46:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:16:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 20:16:29', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 16:46:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:16:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:16:36', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=188'); -- id=4342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:03:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:33:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 20:33:50', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=4343
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:04:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:34:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 20:34:06', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=4344

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =523
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(66,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '2731.8' , clientdate = '2026-10-15 20:34:06', userid = '1' WHERE clientid = '66';
UPDATE client SET  inUse = 0 where clientid = 66;
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 ('66','32731.80','30000','1','ايصال تحصيل (( قبض من عميل ))','523', '2731.8', '2026-10-15 20:33:50', '1', 'clientPayedDeptController.php', '   ', '30000', '0', null, '0', null, null,'', '-1','1','1','30000','1','','51','0','','.'); -- id=523
UPDATE save SET  savecurrentvalue = '-823459.75',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-853459.75','30000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '523', '-823459.75', '2026-10-15 20:34:07', '1',  'clientPayedDeptController.php','66','','0'); -- id=325
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-15', '1', '0', '0', '2026-10-15 20:34:07','اضافة ايصال سداد للعميل عبدالله سعد','1','0','0','0','523','clientPayedDeptController.php?do=show&id=523'); -- id=1656
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1656', '383', '30000', '','0'); -- id=1670
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '19873.49', 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 ('1656', '499', '30000', '','0'); -- id=1660
UPDATE accountstree SET name = 'عبدالله سعد', customName = 'عبدالله سعد', customNameEn = 'عبدالله سعد', nameEn = 'عبدالله سعد', parent = '58', accountNature = '0', theValue = '2731.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-15 18:40:59' WHERE id = '499';
UPDATE clientdebtchange SET clientid = '66', clientdebtchangebefore = '32731.800', clientdebtchangeamount = '30000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '523', clientdebtchangeafter = '2731.800', clientdebtchangedate = '2026-10-15 20:33:50', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '30000.000',discount='', reciptid='0', dailyentryid = '1656',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '523';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:04:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:34:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 20:34:08', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=4345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:04:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:34:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-15 20:34:10', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=4346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:05:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:35:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-15 20:35:14', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=4347
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:05:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:35:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-15 20:35:19', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=4348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:05:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 20:35:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-15 20:35:35', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=4349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:37:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 21:07:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 21:07:42', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=4350
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-15 17:37:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-15 21:07:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-15 21:07:51', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=4351
