UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:30:53";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:31:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:01:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-03 10:01:55', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=3273
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-03',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-03 06:32:02";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-03 10:02:02', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=3274
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:32:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:02:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 10:02:10', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3275
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:34:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:04:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 10:04:32', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=3276
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:34:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:04:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 10:04:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=3277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 06:35:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:05:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 10:05:28', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3278
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('422', '1', '14', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '20', '34', '1', '2026-10-03','0','0'); -- id=3212
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '210', '210', '2026-10-03', '1', '0', '0', '2026-10-03 10:05:29','اعادة جرد للمنتج : (وش رصاصي /فينوس) فى مخزن : (المخزن الرئيسي) بالكمية : 34','1','0',null,'0','3212','inventoryController.php?do=details&id=3212'); -- id=1224
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1224', '382', '210', '','0'); -- id=1226
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2606561.02', 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 ('1224', '188', '210', '','0'); -- id=1225
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-49205.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 07:12:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:42:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 10:42:30', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3279

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac0b6866e5df
-- ----------------------------------------------------------------------------------------------------

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-03 10:42:30', '06ac0b6866e5df', '1', '0.00', '0', '0', '1', '2055.00', '2055', '2055', '0', '1', '2026-10-03 10:42:30', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '75' ,'0','','','','','-1','0','0','0','0','0','2055','0','','0','0','2055','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=196
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','اضافة فاتورة مبيعات','196', '0', '2026-10-03 10:42:31', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2055', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 10:42:30','0','0','',''); -- id=332
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15','00422', '196', '3', '422', '30', '15.75', '472.5', '0', '', '1', '2026-10-03 10:42:31', '422', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15.75','472.5','0','','0','0.00','0','0','0','0'); -- id=1652
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1652;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (422, '2026-10-03', 472.5, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+472.5, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 472.5, 450, 450
                    , 450, 450, 450, 450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 450, 450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+472.5, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 10:42:31' WHERE storedetailid = '422';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('422', '1', '30', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34', '4', '1', '2026-10-03 10:42:31','0','0'); -- id=3213
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00104', '196', '3', '104', '10', '15.75', '157.5', '0', '', '1', '2026-10-03 10:42:31', '104', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15.75','157.5','0','','0','0.00','0','0','0','0'); -- id=1653
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1653;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (104, '2026-10-03', 157.5, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+157.5, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 157.5, 150, 150
                    , 150, 150, 150, 150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+157.5, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '287', userid = '1', storedetaildate = '2026-10-03 10:42:32' WHERE storedetailid = '104';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('104', '1', '10', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '297', '287', '1', '2026-10-03 10:42:32','0','0'); -- id=3214
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 11;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.75','00102', '196', '3', '102', '10', '12', '120', '0', '', '1', '2026-10-03 10:42:32', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','11-10,','1','1','0','0','12','120','0','','0','0.00','0','0','0','0'); -- id=1654
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1654;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 120, 117.5, 117.5
                    , 117.5, 117.5, 117.5, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 117.5, 117.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+117.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+117.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+117.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+117.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+117.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+117.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+117.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+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-03', 120, 117.5, 117.5
                    , 117.5, 117.5, 117.5, 117.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 117.5, 117.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+117.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+117.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+117.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+117.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+117.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+117.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+117.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+117.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 = '1241', userid = '1', storedetaildate = '2026-10-03 10:42:32' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '10', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1251', '1241', '1', '2026-10-03 10:42:32','0','0'); -- id=3215
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 96;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00100', '196', '3', '100', '10', '17.75', '177.5', '0', '', '1', '2026-10-03 10:42:32', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','96-10,','1','1','0','0','17.75','177.5','0','','0','0.00','0','0','0','0'); -- id=1655
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1655;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 177.5, 176, 176
                    , 176, 176, 176, 176
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 176, 176, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177.5, sellCostBuyPrice =sellCostBuyPrice+176
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+176, sellCostMeanBuyPrice = sellCostMeanBuyPrice+176
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+176, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+176
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+176
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+176
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+176
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 177.5, 176, 176
                    , 176, 176, 176, 176
                    , 0, 0, 0, 0
                    , 0, 0, 0, 176, 176, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177.5, sellCostBuyPrice =sellCostBuyPrice+176
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+176, sellCostMeanBuyPrice = sellCostMeanBuyPrice+176
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+176, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+176
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+176
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+176
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+176
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '586', userid = '1', storedetaildate = '2026-10-03 10:42:32' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '10', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '596', '586', '1', '2026-10-03 10:42:32','0','0'); -- id=3216
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 97;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00101', '196', '3', '101', '10', '17.75', '177.5', '0', '', '1', '2026-10-03 10:42:32', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','97-10,','1','1','0','0','17.75','177.5','0','','0','0.00','0','0','0','0'); -- id=1656
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1656;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 177.5, 176, 176
                    , 176, 176, 176, 176
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 176, 176, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177.5, sellCostBuyPrice =sellCostBuyPrice+176
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+176, sellCostMeanBuyPrice = sellCostMeanBuyPrice+176
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+176, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+176
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+176
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+176
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+176
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 177.5, 176, 176
                    , 176, 176, 176, 176
                    , 0, 0, 0, 0
                    , 0, 0, 0, 176, 176, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+177.5, sellCostBuyPrice =sellCostBuyPrice+176
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+176, sellCostMeanBuyPrice = sellCostMeanBuyPrice+176
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+176, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+176
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+176
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+176
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+176
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '668', userid = '1', storedetaildate = '2026-10-03 10:42:33' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '10', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '678', '668', '1', '2026-10-03 10:42:33','0','0'); -- id=3217
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', '196', '20', '196', '2', '245', '490', '0', '', '1', '2026-10-03 10:42:33', '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=1657
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 = 1657;
 INSERT INTO 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-03', 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-03', 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 = '210', userid = '1', storedetaildate = '2026-10-03 10:42:33' WHERE storedetailid = '196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '2', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '212', '210', '1', '2026-10-03 10:42:33','0','0'); -- id=3218
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 84;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.5','00119', '196', '3', '119', '2', '55', '110', '0', '', '1', '2026-10-03 10:42:33', '119', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','84-2,','1','1','0','0','55','110','0','','0','0.00','0','0','0','0'); -- id=1658
UPDATE sellbilldetail SET  lastbuyprice = 52.50 , meanbuyprice = 53.18, lastbuyprice_withDiscount = 52.50, meanbuyprice_withDiscount = 53.18
        , lastbuyprice_withTax = 52.5, meanbuyprice_withTax = 53.18, lastbuyprice_withDiscountAndTax = 52.5
                where sellbilldetailid = 1658;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (119, '2026-10-03', 110, 105, 105
                    , 106.36, 105, 106.36, 105
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 105, 106.36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, sellCostBuyPrice =sellCostBuyPrice+105
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+106.36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+106.36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+106.36
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 110, 105, 105
                    , 106.36, 105, 106.36, 105
                    , 0, 0, 0, 0
                    , 0, 0, 0, 105, 106.36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, sellCostBuyPrice =sellCostBuyPrice+105
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105, sellCostMeanBuyPrice = sellCostMeanBuyPrice+106.36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+106.36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+106.36
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 10:42:33' WHERE storedetailid = '119';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('119', '1', '2', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '37', '1', '2026-10-03 10:42:33','0','0'); -- id=3219
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','00200', '196', '20', '200', '1', '350', '350', '0', '', '1', '2026-10-03 10:42:33', '200', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','350','350','0','','0','0.00','0','0','0','0'); -- id=1659
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 1659;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (200, '2026-10-03', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 350, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 10:42:34' WHERE storedetailid = '200';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('200', '1', '1', '1', '196', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '1', '2026-10-03 10:42:34','0','0'); -- id=3220
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-481620.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 ('-483675.25','2055', '0', '1', 'اضافة فاتورة مبيعات', '196', '-481620.25', '2026-10-03 10:42:34', '1',  'sellbillController.php','1','','0'); -- id=195
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2055', '2055', '2026-10-03', '1', '0', '0', '2026-10-03 10:42:34','اضافة فاتورة مبيعات رقم 196','1','0',null,'0','196','sellbillController.php?do=showDetail&sellbillid=196'); -- id=1225
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1225', '383', '2055', '','0'); -- id=1227
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-315488.72', 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 ('1225', '143', '2055', '','0'); -- id=1226
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '752056.52', 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 ( '1940.34', '1940.34', '2026-10-03', '1', '0', '0', '2026-10-03 10:42:34','اضافة فاتورة مبيعات رقم 196 - صرف البضاعة من المخزن','1','0',null,'0','196','sellbillController.php?do=showDetail&sellbillid=196'); -- id=1226
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1226', '402', '1940.34', '','0'); -- id=1228
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '687842.91', 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 ('1226', '382', '1940.34', '','0'); -- id=1227
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2604620.68', 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='1225,0,1226' where sellbillid=196;
 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-03', 2055, 1940.34, 1940.34
                    , 1937.7, 1940.34, 1937.7, 1940.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1940.34, 1937.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2055, sellCostBuyPrice =sellCostBuyPrice+1940.34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1940.34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1937.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1940.34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1937.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1940.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1940.34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1937.7
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 2055, 1940.34, 1940.34
                    , 1937.7, 1940.34, 1937.7, 1940.34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1940.34, 1937.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2055, sellCostBuyPrice =sellCostBuyPrice+1940.34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1940.34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1937.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1940.34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1937.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1940.34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1940.34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1937.7
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2055, 1940.34, 1940.34
                    , 1937.7, 1940.34, 1937.7, 1940.34, 1940.34, 1937.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2055, netSellCostBuyPrice = netSellCostBuyPrice+1940.34
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1940.34
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1937.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1940.34
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1937.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1940.34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1940.34
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1937.7;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac0b6866e5df and sellbillId = 196 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 07:12:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 10:42:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 10:42:35', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3280
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 09:47:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 13:17:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 13:17:39', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3281
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 10:54:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:24:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:24:32', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3282

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac0e45379463
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,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-03 14:24:33', '06ac0e45379463', '3', '3729.00', '33664.8', '0', '1', '29935.80', '29935.8', '0', '29935.8', '1', '2026-10-03 14:24:33', '', '1', '0', 'عبدالحي الشاذلي ', '1', '1', '3', '0', '3 - عبدالحي الشاذلي ', '1059' ,'0','','','','','-1','0','0','0','0','0','29935','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=197
UPDATE client SET  clientdebt = '33664.8', userid = '1' WHERE clientid = '3';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('3','3729.00','29935.8','0','اضافة فاتورة مبيعات','197', '33664.8', '2026-10-03 14:24:34', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '29935.8', '0', null, '0', null, null,'', '0','1','1','29935.8','1','2026-10-03 14:24:33','0','0','',''); -- id=333
UPDATE client SET  inUse = 0 where clientid = 3;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.5','00177', '197', '19', '177', '50', '58', '2900', '0', '', '0', '2026-10-03 14:24:34', '177', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','58','2900','0','','0','','0','0','0','0'); -- id=1660
UPDATE sellbilldetail SET  lastbuyprice = 55.50 , meanbuyprice = 55.50, lastbuyprice_withDiscount = 55.50, meanbuyprice_withDiscount = 55.50
        , lastbuyprice_withTax = 55.5, meanbuyprice_withTax = 55.5, lastbuyprice_withDiscountAndTax = 55.5
                where sellbilldetailid = 1660;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (177, '2026-10-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2026-10-03 14:24:34' WHERE storedetailid = '177';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('177', '1', '50', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '111', '61', '1', '2026-10-03 14:24:34','0','0'); -- id=3221
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00178', '197', '19', '178', '40', '80', '3200', '0', '', '0', '2026-10-03 14:24:34', '178', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','80','3200','0','','0','','0','0','0','0'); -- id=1661
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 = 1661;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (178, '2026-10-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:24:34' WHERE storedetailid = '178';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('178', '1', '40', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '65', '25', '1', '2026-10-03 14:24:34','0','0'); -- id=3222
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('39','00176', '197', '19', '176', '50', '42', '2100', '0', '', '0', '2026-10-03 14:24:34', '176', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','42','2100','0','','0','','0','0','0','0'); -- id=1662
UPDATE sellbilldetail SET  lastbuyprice = 39.00 , meanbuyprice = 39.00, lastbuyprice_withDiscount = 39.00, meanbuyprice_withDiscount = 39.00
        , lastbuyprice_withTax = 39, meanbuyprice_withTax = 39, lastbuyprice_withDiscountAndTax = 39
                where sellbilldetailid = 1662;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (176, '2026-10-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-14', userid = '1', storedetaildate = '2026-10-03 14:24:35' WHERE storedetailid = '176';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('176', '1', '50', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '-14', '1', '2026-10-03 14:24:35','0','0'); -- id=3223
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('78.75','00141', '197', '21', '141', '22', '80', '1760', '0', '', '0', '2026-10-03 14:24:35', '141', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','80','1760','0','','0','0.00','0','0','0','0'); -- id=1663
UPDATE sellbilldetail SET  lastbuyprice = 78.75 , meanbuyprice = 78.75, lastbuyprice_withDiscount = 78.75, meanbuyprice_withDiscount = 78.75
        , lastbuyprice_withTax = 78.75, meanbuyprice_withTax = 78.75, lastbuyprice_withDiscountAndTax = 78.75
                where sellbilldetailid = 1663;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (141, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22, 0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1732.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+22
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1732.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-03 14:24:35' WHERE storedetailid = '141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('141', '1', '22', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '0', '1', '2026-10-03 14:24:35','0','0'); -- id=3224
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('141.75','00142', '197', '21', '142', '6', '141.75', '850.5', '0', '', '0', '2026-10-03 14:24:35', '142', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','141.75','850.5','0','','0','0.00','0','0','0','0'); -- id=1664
UPDATE sellbilldetail SET  lastbuyprice = 141.75 , meanbuyprice = 141.75, lastbuyprice_withDiscount = 141.75, meanbuyprice_withDiscount = 141.75
        , lastbuyprice_withTax = 141.75, meanbuyprice_withTax = 141.75, lastbuyprice_withDiscountAndTax = 141.75
                where sellbilldetailid = 1664;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (142, '2026-10-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850.5, sellCostBuyPrice =sellCostBuyPrice+850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850.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+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-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850.5, sellCostBuyPrice =sellCostBuyPrice+850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850.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 = '4', userid = '1', storedetaildate = '2026-10-03 14:24:35' WHERE storedetailid = '142';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('142', '1', '6', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '4', '1', '2026-10-03 14:24:35','0','0'); -- id=3225
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('25.8','00292', '197', '24', '292', '5', '26.8', '134', '0', '', '0', '2026-10-03 14:24:36', '292', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','26.8','134','0','','0','0.00','0','0','0','0'); -- id=1665
UPDATE sellbilldetail SET  lastbuyprice = 25.80 , meanbuyprice = 25.80, lastbuyprice_withDiscount = 25.80, meanbuyprice_withDiscount = 25.80
        , lastbuyprice_withTax = 25.8, meanbuyprice_withTax = 25.8, lastbuyprice_withDiscountAndTax = 25.8
                where sellbilldetailid = 1665;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (292, '2026-10-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+134, sellCostBuyPrice =sellCostBuyPrice+129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+129, sellCostMeanBuyPrice = sellCostMeanBuyPrice+129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+134, sellCostBuyPrice =sellCostBuyPrice+129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+129, sellCostMeanBuyPrice = sellCostMeanBuyPrice+129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-10-03 14:24:36' WHERE storedetailid = '292';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('292', '1', '5', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '1', '2026-10-03 14:24:36','0','0'); -- id=3226
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('7.5','00296', '197', '6', '296', '30', '8.5', '255', '0', '', '0', '2026-10-03 14:24:36', '296', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','8.5','255','0','','0','0.00','0','0','0','0'); -- id=1666
UPDATE sellbilldetail SET  lastbuyprice = 7.50 , meanbuyprice = 7.50, lastbuyprice_withDiscount = 7.50, meanbuyprice_withDiscount = 7.50
        , lastbuyprice_withTax = 7.5, meanbuyprice_withTax = 7.5, lastbuyprice_withDiscountAndTax = 7.5
                where sellbilldetailid = 1666;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (296, '2026-10-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-03 14:24:36' WHERE storedetailid = '296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('296', '1', '30', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '20', '1', '2026-10-03 14:24:36','0','0'); -- id=3227
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 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', '197', '19', '174', '10', '275', '2750', '0', '', '0', '2026-10-03 14:24:36', '174', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','94-10,','1','1','0','0','275','2750','0','','0','0.00','0','0','0','0'); -- id=1667
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 = 1667;
 INSERT INTO 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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '1', storedetaildate = '2026-10-03 14:24:36' WHERE storedetailid = '174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '67', '57', '1', '2026-10-03 14:24:36','0','0'); -- id=3228
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '197', '19', '175', '6', '330', '1980', '0', '', '0', '2026-10-03 14:24:37', '175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','95-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=1668
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 = 1668;
 INSERT INTO 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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2026-10-03 14:24:37' WHERE storedetailid = '175';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('175', '1', '6', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '74', '68', '1', '2026-10-03 14:24:37','0','0'); -- id=3229
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','00158', '197', '22', '158', '6', '210', '1260', '0', '', '0', '2026-10-03 14:24:37', '158', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','210','1260','0','','0','0.00','0','0','0','0'); -- id=1669
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 1669;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (158, '2026-10-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-03 14:24:37' WHERE storedetailid = '158';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('158', '1', '6', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '20', '1', '2026-10-03 14:24:37','0','0'); -- id=3230
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('144','00157', '197', '22', '157', '5', '150', '750', '0', '', '0', '2026-10-03 14:24:37', '157', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','150','750','0','','0','0.00','0','0','0','0'); -- id=1670
UPDATE sellbilldetail SET  lastbuyprice = 144.00 , meanbuyprice = 144.00, lastbuyprice_withDiscount = 144.00, meanbuyprice_withDiscount = 144.00
        , lastbuyprice_withTax = 144, meanbuyprice_withTax = 144, lastbuyprice_withDiscountAndTax = 144
                where sellbilldetailid = 1670;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (157, '2026-10-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '1', storedetaildate = '2026-10-03 14:24:38' WHERE storedetailid = '157';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('157', '1', '5', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '47', '1', '2026-10-03 14:24:38','0','0'); -- id=3231
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('85.5','00066', '197', '9', '66', '10', '95', '950', '0', '', '0', '2026-10-03 14:24:38', '66', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','95','950','0','','0','0.00','0','0','0','0'); -- id=1671
UPDATE sellbilldetail SET  lastbuyprice = 85.50 , meanbuyprice = 85.50, lastbuyprice_withDiscount = 85.50, meanbuyprice_withDiscount = 85.50
        , lastbuyprice_withTax = 85.5, meanbuyprice_withTax = 85.5, lastbuyprice_withDiscountAndTax = 85.5
                where sellbilldetailid = 1671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (66, '2026-10-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+855, sellCostMeanBuyPrice = sellCostMeanBuyPrice+855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+855
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+855, sellCostMeanBuyPrice = sellCostMeanBuyPrice+855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+855
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '1', storedetaildate = '2026-10-03 14:24:38' WHERE storedetailid = '66';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('66', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '44', '1', '2026-10-03 14:24:38','0','0'); -- id=3232
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00190', '197', '20', '190', '30', '14', '420', '0', '', '0', '2026-10-03 14:24:38', '190', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','14','420','0','','0','0.00','0','0','0','0'); -- id=1672
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1672;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (190, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:24:38' WHERE storedetailid = '190';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('190', '1', '30', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '236', '206', '1', '2026-10-03 14:24:38','0','0'); -- id=3233
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00191', '197', '20', '191', '30', '14', '420', '0', '', '0', '2026-10-03 14:24:38', '191', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','14','420','0','','0','0.00','0','0','0','0'); -- id=1673
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1673;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (191, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '330', userid = '1', storedetaildate = '2026-10-03 14:24:39' WHERE storedetailid = '191';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('191', '1', '30', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '360', '330', '1', '2026-10-03 14:24:39','0','0'); -- id=3234
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 50;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1282','00202', '197', '6', '202', '1', '1700', '1700', '0', '', '0', '2026-10-03 14:24:39', '202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','50-1,','1','1','0','0','1700','1700','0','','0','0.00','0','0','0','0'); -- id=1674
UPDATE sellbilldetail SET  lastbuyprice = 1282.00 , meanbuyprice = 1271.33, lastbuyprice_withDiscount = 1282.00, meanbuyprice_withDiscount = 1271.33
        , lastbuyprice_withTax = 1282, meanbuyprice_withTax = 1271.33, lastbuyprice_withDiscountAndTax = 1282
                where sellbilldetailid = 1674;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (202, '2026-10-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1271.33
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1271.33
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:24:39' WHERE storedetailid = '202';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('202', '1', '1', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '1', '2026-10-03 14:24:39','0','0'); -- id=3235
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 96;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00100', '197', '3', '100', '40', '17.75', '710', '0', '', '0', '2026-10-03 14:24:39', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','96-40,','1','1','0','0','17.75','710','0','','0','0.00','0','0','0','0'); -- id=1675
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1675;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '546', userid = '1', storedetaildate = '2026-10-03 14:24:39' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '40', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '586', '546', '1', '2026-10-03 14:24:39','0','0'); -- id=3236
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 97;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00101', '197', '3', '101', '40', '17.75', '710', '0', '', '0', '2026-10-03 14:24:39', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','97-40,','1','1','0','0','17.75','710','0','','0','0.00','0','0','0','0'); -- id=1676
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1676;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '628', userid = '1', storedetaildate = '2026-10-03 14:24:40' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '40', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '668', '628', '1', '2026-10-03 14:24:40','0','0'); -- id=3237
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+80 where id = 11;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.75','00102', '197', '3', '102', '80', '12', '960', '0', '', '0', '2026-10-03 14:24:40', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','11-80,','1','1','0','0','12','960','0','','0','0.00','0','0','0','0'); -- id=1677
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1677;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+80
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1161', userid = '1', storedetaildate = '2026-10-03 14:24:40' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '80', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1241', '1161', '1', '2026-10-03 14:24:40','0','0'); -- id=3238
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+80 where id = 8;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00103', '197', '3', '103', '80', '5.5', '440', '0', '', '0', '2026-10-03 14:24:40', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','8-80,','1','1','0','0','5.5','440','0','','0','0.00','0','0','0','0'); -- id=1678
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 = 1678;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+80
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1828', userid = '1', storedetaildate = '2026-10-03 14:24:40' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '80', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1908', '1828', '1', '2026-10-03 14:24:40','0','0'); -- id=3239
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00106', '197', '3', '106', '40', '15.75', '630', '0', '', '0', '2026-10-03 14:24:41', '106', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','15.75','630','0','','0','0.00','0','0','0','0'); -- id=1679
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1679;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (106, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '436', userid = '1', storedetaildate = '2026-10-03 14:24:41' WHERE storedetailid = '106';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '1', '40', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '476', '436', '1', '2026-10-03 14:24:41','0','0'); -- id=3240
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 10;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00120', '197', '3', '120', '40', '15.75', '630', '0', '', '0', '2026-10-03 14:24:41', '120', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','10-40,','1','1','0','0','15.75','630','0','','0','0.00','0','0','0','0'); -- id=1680
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1680;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (120, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '229', userid = '1', storedetaildate = '2026-10-03 14:24:41' WHERE storedetailid = '120';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '40', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '269', '229', '1', '2026-10-03 14:24:41','0','0'); -- id=3241
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.5','00369', '197', '4', '369', '60', '11', '660', '0', '', '0', '2026-10-03 14:24:41', '369', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','11','660','0','','0','0.00','0','0','0','0'); -- id=1681
UPDATE sellbilldetail SET  lastbuyprice = 10.00 , meanbuyprice = 10.25, lastbuyprice_withDiscount = 10.00, meanbuyprice_withDiscount = 10.25
        , lastbuyprice_withTax = 10.25, meanbuyprice_withTax = 10.25, lastbuyprice_withDiscountAndTax = 10
                where sellbilldetailid = 1681;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (369, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+660, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+615
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+660, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+615
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-03 14:24:42' WHERE storedetailid = '369';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('369', '1', '60', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '116', '56', '1', '2026-10-03 14:24:42','0','0'); -- id=3242
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+60 where id = 93;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('14','00279', '197', '4', '279', '60', '14.6', '876', '0', '', '0', '2026-10-03 14:24:42', '279', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','93-60,','1','1','0','0','14.6','876','0','','0','0.00','0','0','0','0'); -- id=1682
UPDATE sellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where sellbilldetailid = 1682;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (279, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '147', userid = '1', storedetaildate = '2026-10-03 14:24:42' WHERE storedetailid = '279';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('279', '1', '60', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '207', '147', '1', '2026-10-03 14:24:42','0','0'); -- id=3243
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 92;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13.8','00280', '197', '4', '280', '30', '14.3', '429', '0', '', '0', '2026-10-03 14:24:42', '280', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','92-30,','1','1','0','0','14.3','429','0','','0','0.00','0','0','0','0'); -- id=1683
UPDATE sellbilldetail SET  lastbuyprice = 13.80 , meanbuyprice = 13.80, lastbuyprice_withDiscount = 13.80, meanbuyprice_withDiscount = 13.80
        , lastbuyprice_withTax = 13.8, meanbuyprice_withTax = 13.8, lastbuyprice_withDiscountAndTax = 13.8
                where sellbilldetailid = 1683;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (280, '2026-10-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+414
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+414
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '240', userid = '1', storedetaildate = '2026-10-03 14:24:42' WHERE storedetailid = '280';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '1', '30', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '270', '240', '1', '2026-10-03 14:24:42','0','0'); -- id=3244
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.41','00313', '197', '4', '313', '150', '2.55', '382.5', '0', '', '0', '2026-10-03 14:24:42', '313', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','2.55','382.5','0','','0','0.00','0','0','0','0'); -- id=1684
UPDATE sellbilldetail SET  lastbuyprice = 2.41 , meanbuyprice = 2.41, lastbuyprice_withDiscount = 2.41, meanbuyprice_withDiscount = 2.41
        , lastbuyprice_withTax = 2.41, meanbuyprice_withTax = 2.41, lastbuyprice_withDiscountAndTax = 2.41
                where sellbilldetailid = 1684;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (313, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+382.5, sellCostBuyPrice =sellCostBuyPrice+361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+361.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+150
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+382.5, sellCostBuyPrice =sellCostBuyPrice+361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+361.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 = '462', userid = '1', storedetaildate = '2026-10-03 14:24:43' WHERE storedetailid = '313';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('313', '1', '150', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '612', '462', '1', '2026-10-03 14:24:43','0','0'); -- id=3245
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('7','00368', '197', '4', '368', '30', '7.5', '225', '0', '', '0', '2026-10-03 14:24:43', '368', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','7.5','225','0','','0','0.00','0','0','0','0'); -- id=1685
UPDATE sellbilldetail SET  lastbuyprice = 7.00 , meanbuyprice = 7.00, lastbuyprice_withDiscount = 7.00, meanbuyprice_withDiscount = 7.00
        , lastbuyprice_withTax = 7, meanbuyprice_withTax = 7, lastbuyprice_withDiscountAndTax = 7
                where sellbilldetailid = 1685;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (368, '2026-10-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, 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+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-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, 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 = '237', userid = '1', storedetaildate = '2026-10-03 14:24:43' WHERE storedetailid = '368';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('368', '1', '30', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '267', '237', '1', '2026-10-03 14:24:43','0','0'); -- id=3246
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 4;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.73','00091', '197', '18', '91', '10', '9', '90', '0', '', '0', '2026-10-03 14:24:43', '91', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','4-10,','1','1','0','0','9','90','0','','0','0.00','0','0','0','0'); -- id=1686
UPDATE sellbilldetail SET  lastbuyprice = 8.73 , meanbuyprice = 8.73, lastbuyprice_withDiscount = 8.73, meanbuyprice_withDiscount = 8.73
        , lastbuyprice_withTax = 8.73, meanbuyprice_withTax = 8.73, lastbuyprice_withDiscountAndTax = 8.73
                where sellbilldetailid = 1686;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (91, '2026-10-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+87.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+87.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2026-10-03 14:24:43' WHERE storedetailid = '91';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('91', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '118', '108', '1', '2026-10-03 14:24:43','0','0'); -- id=3247
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('5.82','00095', '197', '18', '95', '10', '6.5', '65', '0', '', '0', '2026-10-03 14:24:43', '95', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','6.5','65','0','','0','0.00','0','0','0','0'); -- id=1687
UPDATE sellbilldetail SET  lastbuyprice = 5.82 , meanbuyprice = 5.82, lastbuyprice_withDiscount = 5.82, meanbuyprice_withDiscount = 5.82
        , lastbuyprice_withTax = 5.82, meanbuyprice_withTax = 5.82, lastbuyprice_withDiscountAndTax = 5.82
                where sellbilldetailid = 1687;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (95, '2026-10-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+65, sellCostBuyPrice =sellCostBuyPrice+58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+58.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+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-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+65, sellCostBuyPrice =sellCostBuyPrice+58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+58.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 = '74', userid = '1', storedetaildate = '2026-10-03 14:24:44' WHERE storedetailid = '95';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('95', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '74', '1', '2026-10-03 14:24:44','0','0'); -- id=3248
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18.43','00094', '197', '18', '94', '10', '19', '190', '0', '', '0', '2026-10-03 14:24:44', '94', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','7-1,','1','1','0','0','19','190','0','','0','0.00','0','0','0','0'); -- id=1688
UPDATE sellbilldetail SET  lastbuyprice = 18.43 , meanbuyprice = 18.43, lastbuyprice_withDiscount = 18.43, meanbuyprice_withDiscount = 18.43
        , lastbuyprice_withTax = 18.43, meanbuyprice_withTax = 18.43, lastbuyprice_withDiscountAndTax = 18.43
                where sellbilldetailid = 1688;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (94, '2026-10-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-03 14:24:44' WHERE storedetailid = '94';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('94', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '32', '1', '2026-10-03 14:24:44','0','0'); -- id=3249
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('25.7','00092', '197', '18', '92', '10', '26', '260', '0', '', '0', '2026-10-03 14:24:44', '92', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5-10,','1','1','0','0','26','260','0','','0','0.00','0','0','0','0'); -- id=1689
UPDATE sellbilldetail SET  lastbuyprice = 25.70 , meanbuyprice = 25.70, lastbuyprice_withDiscount = 25.70, meanbuyprice_withDiscount = 25.70
        , lastbuyprice_withTax = 25.7, meanbuyprice_withTax = 25.7, lastbuyprice_withDiscountAndTax = 25.7
                where sellbilldetailid = 1689;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (92, '2026-10-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+257, sellCostMeanBuyPrice = sellCostMeanBuyPrice+257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+257
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+257, sellCostMeanBuyPrice = sellCostMeanBuyPrice+257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+257
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '1', storedetaildate = '2026-10-03 14:24:44' WHERE storedetailid = '92';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('92', '1', '10', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '41', '1', '2026-10-03 14:24:44','0','0'); -- id=3250
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('5.5','00419', '197', '6', '419', '20', '7', '140', '0', '', '0', '2026-10-03 14:24:44', '419', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','7','140','0','','0','0.00','0','0','0','0'); -- id=1690
UPDATE sellbilldetail SET  lastbuyprice = 5.50 , meanbuyprice = 5.50, lastbuyprice_withDiscount = 5.50, meanbuyprice_withDiscount = 5.50
        , lastbuyprice_withTax = 5.5, meanbuyprice_withTax = 5.5, lastbuyprice_withDiscountAndTax = 5.5
                where sellbilldetailid = 1690;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (419, '2026-10-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, 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+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-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, 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 = '40', userid = '1', storedetaildate = '2026-10-03 14:24:45' WHERE storedetailid = '419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('419', '1', '20', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '40', '1', '2026-10-03 14:24:45','0','0'); -- id=3251
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.1','00133', '197', '21', '133', '48', '23.1', '1108.8000000000002', '0', '', '0', '2026-10-03 14:24:45', '133', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','23.1','1108.8','0','','0','0.00','0','0','0','0'); -- id=1691
UPDATE sellbilldetail SET  lastbuyprice = 23.10 , meanbuyprice = 23.10, lastbuyprice_withDiscount = 23.10, meanbuyprice_withDiscount = 23.10
        , lastbuyprice_withTax = 23.1, meanbuyprice_withTax = 23.1, lastbuyprice_withDiscountAndTax = 23.1
                where sellbilldetailid = 1691;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (133, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 48, 0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.8, sellCostBuyPrice =sellCostBuyPrice+1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1108.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+48
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.8, sellCostBuyPrice =sellCostBuyPrice+1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1108.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '180', userid = '1', storedetaildate = '2026-10-03 14:24:45' WHERE storedetailid = '133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('133', '1', '48', '1', '197', 'اضافة فاتورة مبيعات', 'sellbillController.php', '228', '180', '1', '2026-10-03 14:24:45','0','0'); -- id=3252
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29935.8', '29935.8', '2026-10-03', '1', '0', '0', '2026-10-03 14:24:45','اضافة فاتورة مبيعات رقم 197','1','0',null,'0','197','sellbillController.php?do=showDetail&sellbillid=197'); -- id=1227
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1227', '427', '29935.8', '','0'); -- id=1229
UPDATE accountstree SET name = 'عبدالحي الشاذلي ', customName = 'عبدالحي الشاذلي ', customNameEn = 'عبدالحي الشاذلي ', nameEn = 'عبدالحي الشاذلي ', parent = '58', accountNature = '0', theValue = '33664.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-14 13:19:31' WHERE id = '427';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1227', '143', '29935.8', '','0'); -- id=1228
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '781992.32', 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 ( '28368.1', '28368.1', '2026-10-03', '1', '0', '0', '2026-10-03 14:24:45','اضافة فاتورة مبيعات رقم 197 - صرف البضاعة من المخزن','1','0',null,'0','197','sellbillController.php?do=showDetail&sellbillid=197'); -- id=1228
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1228', '402', '28368.1', '','0'); -- id=1230
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '716211.01', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1228', '382', '28368.1', '','0'); -- id=1229
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2576252.58', 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='1227,0,1228' where sellbillid=197;
 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-03', 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28383.1, 28372.43, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29935.8, sellCostBuyPrice =sellCostBuyPrice+28398.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28368.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28372.43
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28368.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28372.43
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28368.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28383.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28372.43
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-03', 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28383.1, 28372.43, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29935.8, sellCostBuyPrice =sellCostBuyPrice+28398.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28368.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28372.43
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28368.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28372.43
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28368.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28383.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28372.43
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1, 28383.1, 28372.43)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+29935.8, netSellCostBuyPrice = netSellCostBuyPrice+28398.1
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+28368.1
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+28372.43
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+28368.1
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+28372.43
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+28368.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+28383.1
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28372.43;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac0e45379463 and sellbillId = 197 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 10:54:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:24:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:24:47', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:22:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:52:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:52:26', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=3284
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:22:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:52:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:52:36', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=3285
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:22:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:52:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:52:50', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=197'); -- id=3286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:23:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:53:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 14:53:27', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=3287
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:23:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:53:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 14:53:48', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3288
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '188';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('188', '1', '2', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '29', '31', '1', '2026-10-03','0','0'); -- id=3253
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '41', '41', '2026-10-03', '1', '0', '0', '2026-10-03 14:53:48','اعادة جرد للمنتج : (لمبه كاسه 5 وات 3 تكه /باندا) فى مخزن : (المخزن الرئيسي) بالكمية : 31','1','0',null,'0','3253','inventoryController.php?do=details&id=3253'); -- id=1229
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1229', '382', '41', '','0'); -- id=1231
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2576293.58', 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 ('1229', '188', '41', '','0'); -- id=1230
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-49246.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:24:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:54:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:54:11', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3289
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:24:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:54:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:54:29', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=3290
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 197;
UPDATE sellbill SET  sellbillsysdate = '2026-10-03 14:54:30', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '197';
UPDATE sellbilldetail SET  lastbuyprice = 55.50 , meanbuyprice = 55.50, lastbuyprice_withDiscount = 55.50, meanbuyprice_withDiscount = 55.50
        , lastbuyprice_withTax = 55.5, meanbuyprice_withTax = 55.5, lastbuyprice_withDiscountAndTax = 55.5
                where sellbilldetailid = 1660;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (177, '2026-10-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0,50,0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2900, sellCostBuyPrice =sellCostBuyPrice-2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2775
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2900, sellCostBuyPrice =sellCostBuyPrice-2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2775
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-03 14:54:30' WHERE storedetailid = '177';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('177', '1', '50', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '61', '111', '1', '2026-10-03 14:24:33','0','0'); -- id=3254
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 = 1661;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (178, '2026-10-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3200, sellCostBuyPrice =sellCostBuyPrice-3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3080
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3200, sellCostBuyPrice =sellCostBuyPrice-3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3080
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-03 14:54:30' WHERE storedetailid = '178';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('178', '1', '40', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '65', '1', '2026-10-03 14:24:33','0','0'); -- id=3255
UPDATE sellbilldetail SET  lastbuyprice = 39.00 , meanbuyprice = 39.00, lastbuyprice_withDiscount = 39.00, meanbuyprice_withDiscount = 39.00
        , lastbuyprice_withTax = 39, meanbuyprice_withTax = 39, lastbuyprice_withDiscountAndTax = 39
                where sellbilldetailid = 1662;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (176, '2026-10-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0,50,0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '176';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('176', '1', '50', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '-14', '36', '1', '2026-10-03 14:24:33','0','0'); -- id=3256
UPDATE sellbilldetail SET  lastbuyprice = 78.75 , meanbuyprice = 78.75, lastbuyprice_withDiscount = 78.75, meanbuyprice_withDiscount = 78.75
        , lastbuyprice_withTax = 78.75, meanbuyprice_withTax = 78.75, lastbuyprice_withDiscountAndTax = 78.75
                where sellbilldetailid = 1663;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (141, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,22,0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1732.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-22
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1732.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 = '22', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('141', '1', '22', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '22', '1', '2026-10-03 14:24:33','0','0'); -- id=3257
UPDATE sellbilldetail SET  lastbuyprice = 141.75 , meanbuyprice = 141.75, lastbuyprice_withDiscount = 141.75, meanbuyprice_withDiscount = 141.75
        , lastbuyprice_withTax = 141.75, meanbuyprice_withTax = 141.75, lastbuyprice_withDiscountAndTax = 141.75
                where sellbilldetailid = 1664;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (142, '2026-10-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-850.5, sellCostBuyPrice =sellCostBuyPrice-850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-850.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-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-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-850.5, sellCostBuyPrice =sellCostBuyPrice-850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-850.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 = '10', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '142';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('142', '1', '6', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '10', '1', '2026-10-03 14:24:33','0','0'); -- id=3258
UPDATE sellbilldetail SET  lastbuyprice = 25.80 , meanbuyprice = 25.80, lastbuyprice_withDiscount = 25.80, meanbuyprice_withDiscount = 25.80
        , lastbuyprice_withTax = 25.8, meanbuyprice_withTax = 25.8, lastbuyprice_withDiscountAndTax = 25.8
                where sellbilldetailid = 1665;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (292, '2026-10-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-134, sellCostBuyPrice =sellCostBuyPrice-129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-129, sellCostMeanBuyPrice = sellCostMeanBuyPrice-129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-129
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-134, sellCostBuyPrice =sellCostBuyPrice-129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-129, sellCostMeanBuyPrice = sellCostMeanBuyPrice-129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-129
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '292';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('292', '1', '5', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-10-03 14:24:33','0','0'); -- id=3259
UPDATE sellbilldetail SET  lastbuyprice = 7.50 , meanbuyprice = 7.50, lastbuyprice_withDiscount = 7.50, meanbuyprice_withDiscount = 7.50
        , lastbuyprice_withTax = 7.5, meanbuyprice_withTax = 7.5, lastbuyprice_withDiscountAndTax = 7.5
                where sellbilldetailid = 1666;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (296, '2026-10-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-255, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-225
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-255, sellCostBuyPrice =sellCostBuyPrice-225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-225
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('296', '1', '30', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '50', '1', '2026-10-03 14:24:33','0','0'); -- id=3260
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 94;
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 = 1667;
 INSERT INTO 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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2750, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2750, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '67', userid = '1', storedetaildate = '2026-10-03 14:54:30' WHERE storedetailid = '174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '57', '67', '1', '2026-10-03 14:24:33','0','0'); -- id=3261
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 95;
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 = 1668;
 INSERT INTO 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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1980, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1980, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '74', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '175';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('175', '1', '6', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '68', '74', '1', '2026-10-03 14:24:33','0','0'); -- id=3262
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 1669;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (158, '2026-10-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1260, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1260, sellCostBuyPrice =sellCostBuyPrice-1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '158';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('158', '1', '6', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '26', '1', '2026-10-03 14:24:33','0','0'); -- id=3263
UPDATE sellbilldetail SET  lastbuyprice = 144.00 , meanbuyprice = 144.00, lastbuyprice_withDiscount = 144.00, meanbuyprice_withDiscount = 144.00
        , lastbuyprice_withTax = 144, meanbuyprice_withTax = 144, lastbuyprice_withDiscountAndTax = 144
                where sellbilldetailid = 1670;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (157, '2026-10-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-750, sellCostBuyPrice =sellCostBuyPrice-720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-720, sellCostMeanBuyPrice = sellCostMeanBuyPrice-720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-720
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-750, sellCostBuyPrice =sellCostBuyPrice-720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-720, sellCostMeanBuyPrice = sellCostMeanBuyPrice-720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-720
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '157';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('157', '1', '5', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '47', '52', '1', '2026-10-03 14:24:33','0','0'); -- id=3264
UPDATE sellbilldetail SET  lastbuyprice = 85.50 , meanbuyprice = 85.50, lastbuyprice_withDiscount = 85.50, meanbuyprice_withDiscount = 85.50
        , lastbuyprice_withTax = 85.5, meanbuyprice_withTax = 85.5, lastbuyprice_withDiscountAndTax = 85.5
                where sellbilldetailid = 1671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (66, '2026-10-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-950, sellCostBuyPrice =sellCostBuyPrice-855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-855, sellCostMeanBuyPrice = sellCostMeanBuyPrice-855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-855
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-950, sellCostBuyPrice =sellCostBuyPrice-855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-855, sellCostMeanBuyPrice = sellCostMeanBuyPrice-855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-855
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '66';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('66', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '44', '54', '1', '2026-10-03 14:24:33','0','0'); -- id=3265
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1672;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (190, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-390, sellCostMeanBuyPrice = sellCostMeanBuyPrice-390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-390
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-390, sellCostMeanBuyPrice = sellCostMeanBuyPrice-390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-390
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '236', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '190';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('190', '1', '30', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '206', '236', '1', '2026-10-03 14:24:33','0','0'); -- id=3266
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1673;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (191, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-390, sellCostMeanBuyPrice = sellCostMeanBuyPrice-390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-390
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-420, sellCostBuyPrice =sellCostBuyPrice-390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-390, sellCostMeanBuyPrice = sellCostMeanBuyPrice-390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-390
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '360', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '191';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('191', '1', '30', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '330', '360', '1', '2026-10-03 14:24:33','0','0'); -- id=3267
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 50;
UPDATE sellbilldetail SET  lastbuyprice = 1282.00 , meanbuyprice = 1271.33, lastbuyprice_withDiscount = 1282.00, meanbuyprice_withDiscount = 1271.33
        , lastbuyprice_withTax = 1282, meanbuyprice_withTax = 1271.33, lastbuyprice_withDiscountAndTax = 1282
                where sellbilldetailid = 1674;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (202, '2026-10-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1700, sellCostBuyPrice =sellCostBuyPrice-1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1271.33
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1700, sellCostBuyPrice =sellCostBuyPrice-1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1271.33
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-03 14:54:31' WHERE storedetailid = '202';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('202', '1', '1', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '6', '1', '2026-10-03 14:24:33','0','0'); -- id=3268
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-40 where id = 96;
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1675;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-704, sellCostMeanBuyPrice = sellCostMeanBuyPrice-704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-704
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-704, sellCostMeanBuyPrice = sellCostMeanBuyPrice-704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-704
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '586', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '40', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '546', '586', '1', '2026-10-03 14:24:33','0','0'); -- id=3269
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-40 where id = 97;
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1676;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-704, sellCostMeanBuyPrice = sellCostMeanBuyPrice-704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-704
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-710, sellCostBuyPrice =sellCostBuyPrice-704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-704, sellCostMeanBuyPrice = sellCostMeanBuyPrice-704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-704
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '668', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '40', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '628', '668', '1', '2026-10-03 14:24:33','0','0'); -- id=3270
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-80 where id = 11;
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1677;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0,80,0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-960, sellCostBuyPrice =sellCostBuyPrice-940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-940
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-80
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-960, sellCostBuyPrice =sellCostBuyPrice-940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-940, sellCostMeanBuyPrice = sellCostMeanBuyPrice-940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-940
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1241', userid = '1', storedetaildate = '2026-10-03 14:54:31' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '80', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1161', '1241', '1', '2026-10-03 14:24:33','0','0'); -- id=3271
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-80 where id = 8;
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 = 1678;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0,80,0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, sellCostBuyPrice =sellCostBuyPrice-360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-80
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, sellCostBuyPrice =sellCostBuyPrice-360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1908', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '80', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1828', '1908', '1', '2026-10-03 14:24:33','0','0'); -- id=3272
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1679;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (106, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-630, sellCostBuyPrice =sellCostBuyPrice-600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-630, sellCostBuyPrice =sellCostBuyPrice-600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '476', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '106';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '1', '40', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '436', '476', '1', '2026-10-03 14:24:33','0','0'); -- id=3273
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-40 where id = 10;
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1680;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (120, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-630, sellCostBuyPrice =sellCostBuyPrice-600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-630, sellCostBuyPrice =sellCostBuyPrice-600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '269', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '120';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '40', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '229', '269', '1', '2026-10-03 14:24:33','0','0'); -- id=3274
UPDATE sellbilldetail SET  lastbuyprice = 10.00 , meanbuyprice = 10.25, lastbuyprice_withDiscount = 10.00, meanbuyprice_withDiscount = 10.25
        , lastbuyprice_withTax = 10.25, meanbuyprice_withTax = 10.25, lastbuyprice_withDiscountAndTax = 10
                where sellbilldetailid = 1681;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (369, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0,60,0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-660, sellCostBuyPrice =sellCostBuyPrice-630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-615
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-60
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-660, sellCostBuyPrice =sellCostBuyPrice-630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-615
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '116', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '369';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('369', '1', '60', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '56', '116', '1', '2026-10-03 14:24:33','0','0'); -- id=3275
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-60 where id = 93;
UPDATE sellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where sellbilldetailid = 1682;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (279, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0,60,0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-876, sellCostBuyPrice =sellCostBuyPrice-840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-840, sellCostMeanBuyPrice = sellCostMeanBuyPrice-840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-840
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-60
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-876, sellCostBuyPrice =sellCostBuyPrice-840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-840, sellCostMeanBuyPrice = sellCostMeanBuyPrice-840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-840
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '207', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '279';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('279', '1', '60', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '147', '207', '1', '2026-10-03 14:24:33','0','0'); -- id=3276
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 92;
UPDATE sellbilldetail SET  lastbuyprice = 13.80 , meanbuyprice = 13.80, lastbuyprice_withDiscount = 13.80, meanbuyprice_withDiscount = 13.80
        , lastbuyprice_withTax = 13.8, meanbuyprice_withTax = 13.8, lastbuyprice_withDiscountAndTax = 13.8
                where sellbilldetailid = 1683;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (280, '2026-10-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-429, sellCostBuyPrice =sellCostBuyPrice-414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-414, sellCostMeanBuyPrice = sellCostMeanBuyPrice-414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-414
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-429, sellCostBuyPrice =sellCostBuyPrice-414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-414, sellCostMeanBuyPrice = sellCostMeanBuyPrice-414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-414
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-03 14:54:32' WHERE storedetailid = '280';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '1', '30', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '240', '270', '1', '2026-10-03 14:24:33','0','0'); -- id=3277
UPDATE sellbilldetail SET  lastbuyprice = 2.41 , meanbuyprice = 2.41, lastbuyprice_withDiscount = 2.41, meanbuyprice_withDiscount = 2.41
        , lastbuyprice_withTax = 2.41, meanbuyprice_withTax = 2.41, lastbuyprice_withDiscountAndTax = 2.41
                where sellbilldetailid = 1684;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (313, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,150,0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-382.5, sellCostBuyPrice =sellCostBuyPrice-361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-361.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-150
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-382.5, sellCostBuyPrice =sellCostBuyPrice-361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-361.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 = '612', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '313';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('313', '1', '150', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '462', '612', '1', '2026-10-03 14:24:33','0','0'); -- id=3278
UPDATE sellbilldetail SET  lastbuyprice = 7.00 , meanbuyprice = 7.00, lastbuyprice_withDiscount = 7.00, meanbuyprice_withDiscount = 7.00
        , lastbuyprice_withTax = 7, meanbuyprice_withTax = 7, lastbuyprice_withDiscountAndTax = 7
                where sellbilldetailid = 1685;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (368, '2026-10-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-225, 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-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-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-225, 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 = '267', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '368';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('368', '1', '30', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '237', '267', '1', '2026-10-03 14:24:33','0','0'); -- id=3279
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 4;
UPDATE sellbilldetail SET  lastbuyprice = 8.73 , meanbuyprice = 8.73, lastbuyprice_withDiscount = 8.73, meanbuyprice_withDiscount = 8.73
        , lastbuyprice_withTax = 8.73, meanbuyprice_withTax = 8.73, lastbuyprice_withDiscountAndTax = 8.73
                where sellbilldetailid = 1686;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (91, '2026-10-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice-87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-87.3
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , 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-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-90, sellCostBuyPrice =sellCostBuyPrice-87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice-87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-87.3
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '118', userid = '1', storedetaildate = '2026-10-03 14:54:32' WHERE storedetailid = '91';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('91', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '108', '118', '1', '2026-10-03 14:24:33','0','0'); -- id=3280
UPDATE sellbilldetail SET  lastbuyprice = 5.82 , meanbuyprice = 5.82, lastbuyprice_withDiscount = 5.82, meanbuyprice_withDiscount = 5.82
        , lastbuyprice_withTax = 5.82, meanbuyprice_withTax = 5.82, lastbuyprice_withDiscountAndTax = 5.82
                where sellbilldetailid = 1687;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (95, '2026-10-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-65, sellCostBuyPrice =sellCostBuyPrice-58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-58.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-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-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-65, sellCostBuyPrice =sellCostBuyPrice-58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-58.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 = '84', userid = '1', storedetaildate = '2026-10-03 14:54:33' WHERE storedetailid = '95';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('95', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '74', '84', '1', '2026-10-03 14:24:33','0','0'); -- id=3281
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 7;
UPDATE sellbilldetail SET  lastbuyprice = 18.43 , meanbuyprice = 18.43, lastbuyprice_withDiscount = 18.43, meanbuyprice_withDiscount = 18.43
        , lastbuyprice_withTax = 18.43, meanbuyprice_withTax = 18.43, lastbuyprice_withDiscountAndTax = 18.43
                where sellbilldetailid = 1688;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (94, '2026-10-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice-184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-184.3
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , 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-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-190, sellCostBuyPrice =sellCostBuyPrice-184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice-184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-184.3
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2026-10-03 14:54:33' WHERE storedetailid = '94';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('94', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '32', '42', '1', '2026-10-03 14:24:33','0','0'); -- id=3282
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 5;
UPDATE sellbilldetail SET  lastbuyprice = 25.70 , meanbuyprice = 25.70, lastbuyprice_withDiscount = 25.70, meanbuyprice_withDiscount = 25.70
        , lastbuyprice_withTax = 25.7, meanbuyprice_withTax = 25.7, lastbuyprice_withDiscountAndTax = 25.7
                where sellbilldetailid = 1689;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (92, '2026-10-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-260, sellCostBuyPrice =sellCostBuyPrice-257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-257, sellCostMeanBuyPrice = sellCostMeanBuyPrice-257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-257
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-260, sellCostBuyPrice =sellCostBuyPrice-257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-257, sellCostMeanBuyPrice = sellCostMeanBuyPrice-257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-257
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-03 14:54:33' WHERE storedetailid = '92';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('92', '1', '10', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '41', '51', '1', '2026-10-03 14:24:33','0','0'); -- id=3283
UPDATE sellbilldetail SET  lastbuyprice = 5.50 , meanbuyprice = 5.50, lastbuyprice_withDiscount = 5.50, meanbuyprice_withDiscount = 5.50
        , lastbuyprice_withTax = 5.5, meanbuyprice_withTax = 5.5, lastbuyprice_withDiscountAndTax = 5.5
                where sellbilldetailid = 1690;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (419, '2026-10-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-140, 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-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-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-140, 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 = '60', userid = '1', storedetaildate = '2026-10-03 14:54:33' WHERE storedetailid = '419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('419', '1', '20', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '40', '60', '1', '2026-10-03 14:24:33','0','0'); -- id=3284
UPDATE sellbilldetail SET  lastbuyprice = 23.10 , meanbuyprice = 23.10, lastbuyprice_withDiscount = 23.10, meanbuyprice_withDiscount = 23.10
        , lastbuyprice_withTax = 23.1, meanbuyprice_withTax = 23.1, lastbuyprice_withDiscountAndTax = 23.1
                where sellbilldetailid = 1691;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (133, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0,48,0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1108.8, sellCostBuyPrice =sellCostBuyPrice-1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1108.8
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-48
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1108.8, sellCostBuyPrice =sellCostBuyPrice-1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1108.8
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '228', userid = '1', storedetaildate = '2026-10-03 14:54:33' WHERE storedetailid = '133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('133', '1', '48', '0', '197', 'تعديل فاتورة مبيعات', 'sellbillController.php', '180', '228', '1', '2026-10-03 14:24:33','0','0'); -- id=3285
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '3729', userid = '1' WHERE clientid = '3';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('3','33664.80','29935.80','1','تعديل فاتورة مبيعات','197', '3729', '2026-10-03 14:24:33', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '29935.8', '0', null, '0', null, null,'', '0','1','1','29935.8','1','2026-10-03 14:24:33','0','0','',''); -- id=334
UPDATE client SET  inUse = 0 where clientid = 3;
 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-03', 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28383.1, 28372.43, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-29935.8, sellCostBuyPrice =sellCostBuyPrice-28398.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28368.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28372.43
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28368.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28372.43
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28368.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28383.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28372.43
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-03', 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28383.1, 28372.43, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-29935.8, sellCostBuyPrice =sellCostBuyPrice-28398.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28368.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28372.43
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28368.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28372.43
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28368.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28383.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28372.43
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 29935.8, 28398.1, 28368.1
                    , 28372.43, 28368.1, 28372.43, 28368.1, 28383.1, 28372.43)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-29935.8, netSellCostBuyPrice = netSellCostBuyPrice-28398.1
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-28368.1
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-28372.43
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-28368.1
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-28372.43
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-28368.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-28383.1
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-28372.43;

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


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

COMMIT;
BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-03 14:24:33', '06ac0e45379463', '3', '3729.00', '34377.8', '0', '1', '30648.8', '30648.8', '0', '30648.8', '1', '2026-10-03 14:24:33', '', '1', '0', 'عبدالحي الشاذلي ', '1', '1', '3', '0', '3 - عبدالحي الشاذلي ', '1090', '197', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-03','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=198
UPDATE client SET  clientdebt = '34377.8', userid = '1' WHERE clientid = '3';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('3','3729.00','30648.8','0','اضافة فاتورة مبيعات (معدله)','198', '34377.8', '2026-10-03 14:54:34', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '30648.8', '0', null, '0', null, null,'', '0','1','1','29935.8','1','2026-10-03 14:24:33','0','0','',''); -- id=335
UPDATE client SET  inUse = 0 where clientid = 3;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.5','00177', '198', '19', '177', '50.00', '58', '2900', '0', '', '0', '2026-10-03 14:54:34', '177', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','58','2900','0','','0','0.00','0','0','0','0'); -- id=1692
UPDATE sellbilldetail SET  lastbuyprice = 55.50 , meanbuyprice = 55.50, lastbuyprice_withDiscount = 55.50, meanbuyprice_withDiscount = 55.50
        , lastbuyprice_withTax = 55.5, meanbuyprice_withTax = 55.5, lastbuyprice_withDiscountAndTax = 55.5
                where sellbilldetailid = 1692;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (177, '2026-10-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 2900, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2026-10-03 14:54:34' WHERE storedetailid = '177';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('177', '1', '50', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '111', '61', '1', '2026-10-03 14:54:34','0','0'); -- id=3286
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00178', '198', '19', '178', '40.00', '80', '3200', '0', '', '0', '2026-10-03 14:54:34', '178', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','80','3200','0','','0','0.00','0','0','0','0'); -- id=1693
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 = 1693;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (178, '2026-10-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3080, 3080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:54:35' WHERE storedetailid = '178';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('178', '1', '40', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '65', '25', '1', '2026-10-03 14:54:35','0','0'); -- id=3287
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('39','00176', '198', '19', '176', '50.00', '42', '2100', '0', '', '0', '2026-10-03 14:54:35', '176', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','42','2100','0','','0','0.00','0','0','0','0'); -- id=1694
UPDATE sellbilldetail SET  lastbuyprice = 39.00 , meanbuyprice = 39.00, lastbuyprice_withDiscount = 39.00, meanbuyprice_withDiscount = 39.00
        , lastbuyprice_withTax = 39, meanbuyprice_withTax = 39, lastbuyprice_withDiscountAndTax = 39
                where sellbilldetailid = 1694;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (176, '2026-10-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 2100, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-14', userid = '1', storedetaildate = '2026-10-03 14:54:35' WHERE storedetailid = '176';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('176', '1', '50', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '-14', '1', '2026-10-03 14:54:35','0','0'); -- id=3288
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('78.75','00141', '198', '21', '141', '22.00', '80', '1760', '0', '', '0', '2026-10-03 14:54:35', '141', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','80','1760','0','','0','0.00','0','0','0','0'); -- id=1695
UPDATE sellbilldetail SET  lastbuyprice = 78.75 , meanbuyprice = 78.75, lastbuyprice_withDiscount = 78.75, meanbuyprice_withDiscount = 78.75
        , lastbuyprice_withTax = 78.75, meanbuyprice_withTax = 78.75, lastbuyprice_withDiscountAndTax = 78.75
                where sellbilldetailid = 1695;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (141, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22, 0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1732.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+22
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1760, 1732.5, 1732.5
                    , 1732.5, 1732.5, 1732.5, 1732.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1732.5, 1732.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1732.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1732.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1732.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1732.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1732.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1732.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1732.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1732.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-03 14:54:35' WHERE storedetailid = '141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('141', '1', '22', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '22', '0', '1', '2026-10-03 14:54:35','0','0'); -- id=3289
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('141.75','00142', '198', '21', '142', '6.00', '141.75', '850.5', '0', '', '0', '2026-10-03 14:54:35', '142', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','141.75','850.5','0','','0','0.00','0','0','0','0'); -- id=1696
UPDATE sellbilldetail SET  lastbuyprice = 141.75 , meanbuyprice = 141.75, lastbuyprice_withDiscount = 141.75, meanbuyprice_withDiscount = 141.75
        , lastbuyprice_withTax = 141.75, meanbuyprice_withTax = 141.75, lastbuyprice_withDiscountAndTax = 141.75
                where sellbilldetailid = 1696;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (142, '2026-10-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850.5, sellCostBuyPrice =sellCostBuyPrice+850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850.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+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-03', 850.5, 850.5, 850.5
                    , 850.5, 850.5, 850.5, 850.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 850.5, 850.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+850.5, sellCostBuyPrice =sellCostBuyPrice+850.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850.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 = '4', userid = '1', storedetaildate = '2026-10-03 14:54:36' WHERE storedetailid = '142';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('142', '1', '6', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '4', '1', '2026-10-03 14:54:36','0','0'); -- id=3290
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('25.8','00292', '198', '24', '292', '5.00', '26.8', '134', '0', '', '0', '2026-10-03 14:54:36', '292', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','26.8','134','0','','0','0.00','0','0','0','0'); -- id=1697
UPDATE sellbilldetail SET  lastbuyprice = 25.80 , meanbuyprice = 25.80, lastbuyprice_withDiscount = 25.80, meanbuyprice_withDiscount = 25.80
        , lastbuyprice_withTax = 25.8, meanbuyprice_withTax = 25.8, lastbuyprice_withDiscountAndTax = 25.8
                where sellbilldetailid = 1697;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (292, '2026-10-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+134, sellCostBuyPrice =sellCostBuyPrice+129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+129, sellCostMeanBuyPrice = sellCostMeanBuyPrice+129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 134, 129, 129
                    , 129, 129, 129, 129
                    , 0, 0, 0, 0
                    , 0, 0, 0, 129, 129, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+134, sellCostBuyPrice =sellCostBuyPrice+129
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+129, sellCostMeanBuyPrice = sellCostMeanBuyPrice+129
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+129, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+129
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+129
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+129
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+129
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-10-03 14:54:36' WHERE storedetailid = '292';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('292', '1', '5', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-10-03 14:54:36','0','0'); -- id=3291
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('7.5','00296', '198', '6', '296', '30.00', '8.5', '255', '0', '', '0', '2026-10-03 14:54:36', '296', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','8.5','255','0','','0','0.00','0','0','0','0'); -- id=1698
UPDATE sellbilldetail SET  lastbuyprice = 7.50 , meanbuyprice = 7.50, lastbuyprice_withDiscount = 7.50, meanbuyprice_withDiscount = 7.50
        , lastbuyprice_withTax = 7.5, meanbuyprice_withTax = 7.5, lastbuyprice_withDiscountAndTax = 7.5
                where sellbilldetailid = 1698;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (296, '2026-10-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 255, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+255, sellCostBuyPrice =sellCostBuyPrice+225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-03 14:54:36' WHERE storedetailid = '296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('296', '1', '30', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '50', '20', '1', '2026-10-03 14:54:36','0','0'); -- id=3292
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 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', '198', '19', '174', '10.00', '275', '2750', '0', '', '0', '2026-10-03 14:54:37', '174', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','94-10,','1','1','0','0','275','2750','0','','0','0.00','0','0','0','0'); -- id=1699
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 = 1699;
 INSERT INTO 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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 2750, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '1', storedetaildate = '2026-10-03 14:54:37' WHERE storedetailid = '174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '67', '57', '1', '2026-10-03 14:54:37','0','0'); -- id=3293
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '198', '19', '175', '6.00', '330', '1980', '0', '', '0', '2026-10-03 14:54:37', '175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','95-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=1700
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 = 1700;
 INSERT INTO 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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 1980, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2026-10-03 14:54:37' WHERE storedetailid = '175';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('175', '1', '6', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '74', '68', '1', '2026-10-03 14:54:37','0','0'); -- id=3294
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','00158', '198', '22', '158', '6.00', '210', '1260', '0', '', '0', '2026-10-03 14:54:37', '158', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','210','1260','0','','0','0.00','0','0','0','0'); -- id=1701
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 1701;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (158, '2026-10-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 1260, 1200, 1200
                    , 1200, 1200, 1200, 1200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-03 14:54:37' WHERE storedetailid = '158';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('158', '1', '6', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '26', '20', '1', '2026-10-03 14:54:37','0','0'); -- id=3295
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('144','00157', '198', '22', '157', '5.00', '150', '750', '0', '', '0', '2026-10-03 14:54:38', '157', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','150','750','0','','0','0.00','0','0','0','0'); -- id=1702
UPDATE sellbilldetail SET  lastbuyprice = 144.00 , meanbuyprice = 144.00, lastbuyprice_withDiscount = 144.00, meanbuyprice_withDiscount = 144.00
        , lastbuyprice_withTax = 144, meanbuyprice_withTax = 144, lastbuyprice_withDiscountAndTax = 144
                where sellbilldetailid = 1702;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (157, '2026-10-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 750, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '1', storedetaildate = '2026-10-03 14:54:38' WHERE storedetailid = '157';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('157', '1', '5', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '52', '47', '1', '2026-10-03 14:54:38','0','0'); -- id=3296
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('85.5','00066', '198', '9', '66', '10.00', '95', '950', '0', '', '0', '2026-10-03 14:54:38', '66', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','95','950','0','','0','0.00','0','0','0','0'); -- id=1703
UPDATE sellbilldetail SET  lastbuyprice = 85.50 , meanbuyprice = 85.50, lastbuyprice_withDiscount = 85.50, meanbuyprice_withDiscount = 85.50
        , lastbuyprice_withTax = 85.5, meanbuyprice_withTax = 85.5, lastbuyprice_withDiscountAndTax = 85.5
                where sellbilldetailid = 1703;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (66, '2026-10-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+855, sellCostMeanBuyPrice = sellCostMeanBuyPrice+855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+855
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 950, 855, 855
                    , 855, 855, 855, 855
                    , 0, 0, 0, 0
                    , 0, 0, 0, 855, 855, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+950, sellCostBuyPrice =sellCostBuyPrice+855
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+855, sellCostMeanBuyPrice = sellCostMeanBuyPrice+855
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+855, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+855
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+855
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+855
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+855
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '1', storedetaildate = '2026-10-03 14:54:38' WHERE storedetailid = '66';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('66', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '54', '44', '1', '2026-10-03 14:54:38','0','0'); -- id=3297
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00190', '198', '20', '190', '30.00', '14', '420', '0', '', '0', '2026-10-03 14:54:38', '190', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','14','420','0','','0','0.00','0','0','0','0'); -- id=1704
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1704;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (190, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:54:39' WHERE storedetailid = '190';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('190', '1', '30', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '236', '206', '1', '2026-10-03 14:54:39','0','0'); -- id=3298
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00191', '198', '20', '191', '30.00', '14', '420', '0', '', '0', '2026-10-03 14:54:39', '191', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','14','420','0','','0','0.00','0','0','0','0'); -- id=1705
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 1705;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (191, '2026-10-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 420, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+390
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+390
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+390
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+390
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '330', userid = '1', storedetaildate = '2026-10-03 14:54:39' WHERE storedetailid = '191';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('191', '1', '30', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '360', '330', '1', '2026-10-03 14:54:39','0','0'); -- id=3299
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 50;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1282','00202', '198', '6', '202', '1.00', '1700', '1700', '0', '', '0', '2026-10-03 14:54:39', '202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','50-1,','1','1','0','0','1700','1700','0','','0','0.00','0','0','0','0'); -- id=1706
UPDATE sellbilldetail SET  lastbuyprice = 1282.00 , meanbuyprice = 1271.33, lastbuyprice_withDiscount = 1282.00, meanbuyprice_withDiscount = 1271.33
        , lastbuyprice_withTax = 1282, meanbuyprice_withTax = 1271.33, lastbuyprice_withDiscountAndTax = 1282
                where sellbilldetailid = 1706;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (202, '2026-10-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1271.33
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1700, 1282, 1282
                    , 1271.33, 1282, 1271.33, 1282
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1282, 1271.33, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1700, sellCostBuyPrice =sellCostBuyPrice+1282
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1282, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1271.33
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1282, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1271.33
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1282
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1282
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1271.33
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 14:54:39' WHERE storedetailid = '202';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('202', '1', '1', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '5', '1', '2026-10-03 14:54:39','0','0'); -- id=3300
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 96;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00100', '198', '3', '100', '40.00', '17.75', '710', '0', '', '0', '2026-10-03 14:54:39', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','96-40,','1','1','0','0','17.75','710','0','','0','0.00','0','0','0','0'); -- id=1707
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1707;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '546', userid = '1', storedetaildate = '2026-10-03 14:54:40' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '40', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '586', '546', '1', '2026-10-03 14:54:40','0','0'); -- id=3301
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 97;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00101', '198', '3', '101', '40.00', '17.75', '710', '0', '', '0', '2026-10-03 14:54:40', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','97-40,','1','1','0','0','17.75','710','0','','0','0.00','0','0','0','0'); -- id=1708
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1708;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 710, 704, 704
                    , 704, 704, 704, 704
                    , 0, 0, 0, 0
                    , 0, 0, 0, 704, 704, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+710, sellCostBuyPrice =sellCostBuyPrice+704
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+704, sellCostMeanBuyPrice = sellCostMeanBuyPrice+704
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+704, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+704
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+704
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+704
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+704
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '628', userid = '1', storedetaildate = '2026-10-03 14:54:40' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '40', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '668', '628', '1', '2026-10-03 14:54:40','0','0'); -- id=3302
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+80 where id = 11;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.75','00102', '198', '3', '102', '80.00', '12', '960', '0', '', '0', '2026-10-03 14:54:40', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','11-80,','1','1','0','0','12','960','0','','0','0.00','0','0','0','0'); -- id=1709
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1709;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+80
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 960, 940, 940
                    , 940, 940, 940, 940
                    , 0, 0, 0, 0
                    , 0, 0, 0, 940, 940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+960, sellCostBuyPrice =sellCostBuyPrice+940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1161', userid = '1', storedetaildate = '2026-10-03 14:54:40' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '80', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1241', '1161', '1', '2026-10-03 14:54:40','0','0'); -- id=3303
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+80 where id = 8;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00103', '198', '3', '103', '80.00', '5.5', '440', '0', '', '0', '2026-10-03 14:54:40', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','8-80,','1','1','0','0','5.5','440','0','','0','0.00','0','0','0','0'); -- id=1710
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 = 1710;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 80, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+80
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 440, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1828', userid = '1', storedetaildate = '2026-10-03 14:54:41' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '80', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1908', '1828', '1', '2026-10-03 14:54:41','0','0'); -- id=3304
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00106', '198', '3', '106', '40.00', '15.75', '630', '0', '', '0', '2026-10-03 14:54:41', '106', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','15.75','630','0','','0','0.00','0','0','0','0'); -- id=1711
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1711;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (106, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '436', userid = '1', storedetaildate = '2026-10-03 14:54:41' WHERE storedetailid = '106';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '1', '40', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '476', '436', '1', '2026-10-03 14:54:41','0','0'); -- id=3305
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 10;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00120', '198', '3', '120', '40.00', '15.75', '630', '0', '', '0', '2026-10-03 14:54:41', '120', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','10-40,','1','1','0','0','15.75','630','0','','0','0.00','0','0','0','0'); -- id=1712
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1712;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (120, '2026-10-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 630, 600, 600
                    , 600, 600, 600, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+630, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '229', userid = '1', storedetaildate = '2026-10-03 14:54:41' WHERE storedetailid = '120';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '40', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '269', '229', '1', '2026-10-03 14:54:41','0','0'); -- id=3306
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.5','00369', '198', '4', '369', '60.00', '11', '660', '0', '', '0', '2026-10-03 14:54:41', '369', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','11','660','0','','0','0.00','0','0','0','0'); -- id=1713
UPDATE sellbilldetail SET  lastbuyprice = 10.00 , meanbuyprice = 10.25, lastbuyprice_withDiscount = 10.00, meanbuyprice_withDiscount = 10.25
        , lastbuyprice_withTax = 10.25, meanbuyprice_withTax = 10.25, lastbuyprice_withDiscountAndTax = 10
                where sellbilldetailid = 1713;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (369, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+660, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+615
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 660, 630, 600
                    , 615, 600, 615, 600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 615, 615, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+660, sellCostBuyPrice =sellCostBuyPrice+630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+615
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+615
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+615
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+615
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-03 14:54:42' WHERE storedetailid = '369';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('369', '1', '60', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '116', '56', '1', '2026-10-03 14:54:42','0','0'); -- id=3307
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+60 where id = 93;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('14','00279', '198', '4', '279', '60.00', '14.6', '876', '0', '', '0', '2026-10-03 14:54:42', '279', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','93-60,','1','1','0','0','14.6','876','0','','0','0.00','0','0','0','0'); -- id=1714
UPDATE sellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where sellbilldetailid = 1714;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (279, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 60, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+60
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 876, 840, 840
                    , 840, 840, 840, 840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 840, 840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876, sellCostBuyPrice =sellCostBuyPrice+840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '147', userid = '1', storedetaildate = '2026-10-03 14:54:42' WHERE storedetailid = '279';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('279', '1', '60', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '207', '147', '1', '2026-10-03 14:54:42','0','0'); -- id=3308
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 92;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13.8','00280', '198', '4', '280', '30.00', '14.3', '429', '0', '', '0', '2026-10-03 14:54:42', '280', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','92-30,','1','1','0','0','14.3','429','0','','0','0.00','0','0','0','0'); -- id=1715
UPDATE sellbilldetail SET  lastbuyprice = 13.80 , meanbuyprice = 13.80, lastbuyprice_withDiscount = 13.80, meanbuyprice_withDiscount = 13.80
        , lastbuyprice_withTax = 13.8, meanbuyprice_withTax = 13.8, lastbuyprice_withDiscountAndTax = 13.8
                where sellbilldetailid = 1715;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (280, '2026-10-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+414
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 429, 414, 414
                    , 414, 414, 414, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0, 414, 414, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+429, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+414
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+414
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '240', userid = '1', storedetaildate = '2026-10-03 14:54:42' WHERE storedetailid = '280';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '1', '30', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '270', '240', '1', '2026-10-03 14:54:42','0','0'); -- id=3309
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.41','00313', '198', '4', '313', '150.00', '2.55', '382.5', '0', '', '0', '2026-10-03 14:54:42', '313', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','2.55','382.5','0','','0','0.00','0','0','0','0'); -- id=1716
UPDATE sellbilldetail SET  lastbuyprice = 2.41 , meanbuyprice = 2.41, lastbuyprice_withDiscount = 2.41, meanbuyprice_withDiscount = 2.41
        , lastbuyprice_withTax = 2.41, meanbuyprice_withTax = 2.41, lastbuyprice_withDiscountAndTax = 2.41
                where sellbilldetailid = 1716;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (313, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+382.5, sellCostBuyPrice =sellCostBuyPrice+361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+361.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+150
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 382.5, 361.5, 361.5
                    , 361.5, 361.5, 361.5, 361.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 361.5, 361.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+382.5, sellCostBuyPrice =sellCostBuyPrice+361.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+361.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+361.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+361.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+361.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+361.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+361.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+361.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 = '462', userid = '1', storedetaildate = '2026-10-03 14:54:43' WHERE storedetailid = '313';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('313', '1', '150', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '612', '462', '1', '2026-10-03 14:54:43','0','0'); -- id=3310
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('7','00368', '198', '4', '368', '30.00', '7.5', '225', '0', '', '0', '2026-10-03 14:54:43', '368', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','7.5','225','0','','0','0.00','0','0','0','0'); -- id=1717
UPDATE sellbilldetail SET  lastbuyprice = 7.00 , meanbuyprice = 7.00, lastbuyprice_withDiscount = 7.00, meanbuyprice_withDiscount = 7.00
        , lastbuyprice_withTax = 7, meanbuyprice_withTax = 7, lastbuyprice_withDiscountAndTax = 7
                where sellbilldetailid = 1717;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (368, '2026-10-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, 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+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-03', 225, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, 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 = '237', userid = '1', storedetaildate = '2026-10-03 14:54:43' WHERE storedetailid = '368';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('368', '1', '30', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '267', '237', '1', '2026-10-03 14:54:43','0','0'); -- id=3311
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 4;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.73','00091', '198', '18', '91', '10.00', '9', '90', '0', '', '0', '2026-10-03 14:54:43', '91', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','4-10,','1','1','0','0','9','90','0','','0','0.00','0','0','0','0'); -- id=1718
UPDATE sellbilldetail SET  lastbuyprice = 8.73 , meanbuyprice = 8.73, lastbuyprice_withDiscount = 8.73, meanbuyprice_withDiscount = 8.73
        , lastbuyprice_withTax = 8.73, meanbuyprice_withTax = 8.73, lastbuyprice_withDiscountAndTax = 8.73
                where sellbilldetailid = 1718;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (91, '2026-10-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+87.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-03', 90, 87.3, 87.3
                    , 87.3, 87.3, 87.3, 87.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 87.3, 87.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+90, sellCostBuyPrice =sellCostBuyPrice+87.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+87.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+87.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+87.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+87.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+87.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+87.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+87.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2026-10-03 14:54:43' WHERE storedetailid = '91';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('91', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '118', '108', '1', '2026-10-03 14:54:43','0','0'); -- id=3312
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('5.82','00095', '198', '18', '95', '10.00', '6.5', '65', '0', '', '0', '2026-10-03 14:54:44', '95', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','6.5','65','0','','0','0.00','0','0','0','0'); -- id=1719
UPDATE sellbilldetail SET  lastbuyprice = 5.82 , meanbuyprice = 5.82, lastbuyprice_withDiscount = 5.82, meanbuyprice_withDiscount = 5.82
        , lastbuyprice_withTax = 5.82, meanbuyprice_withTax = 5.82, lastbuyprice_withDiscountAndTax = 5.82
                where sellbilldetailid = 1719;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (95, '2026-10-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+65, sellCostBuyPrice =sellCostBuyPrice+58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+58.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+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-03', 65, 58.2, 58.2
                    , 58.2, 58.2, 58.2, 58.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 58.2, 58.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+65, sellCostBuyPrice =sellCostBuyPrice+58.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+58.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+58.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+58.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+58.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+58.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+58.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+58.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 = '74', userid = '1', storedetaildate = '2026-10-03 14:54:44' WHERE storedetailid = '95';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('95', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '84', '74', '1', '2026-10-03 14:54:44','0','0'); -- id=3313
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18.43','00094', '198', '18', '94', '10.00', '19', '190', '0', '', '0', '2026-10-03 14:54:44', '94', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','7-1,','1','1','0','0','19','190','0','','0','0.00','0','0','0','0'); -- id=1720
UPDATE sellbilldetail SET  lastbuyprice = 18.43 , meanbuyprice = 18.43, lastbuyprice_withDiscount = 18.43, meanbuyprice_withDiscount = 18.43
        , lastbuyprice_withTax = 18.43, meanbuyprice_withTax = 18.43, lastbuyprice_withDiscountAndTax = 18.43
                where sellbilldetailid = 1720;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (94, '2026-10-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-03', 190, 184.3, 184.3
                    , 184.3, 184.3, 184.3, 184.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 184.3, 184.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+190, sellCostBuyPrice =sellCostBuyPrice+184.3
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+184.3, sellCostMeanBuyPrice = sellCostMeanBuyPrice+184.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+184.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+184.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+184.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+184.3
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+184.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-03 14:54:44' WHERE storedetailid = '94';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('94', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '42', '32', '1', '2026-10-03 14:54:44','0','0'); -- id=3314
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('25.7','00092', '198', '18', '92', '10.00', '26', '260', '0', '', '0', '2026-10-03 14:54:44', '92', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5-10,','1','1','0','0','26','260','0','','0','0.00','0','0','0','0'); -- id=1721
UPDATE sellbilldetail SET  lastbuyprice = 25.70 , meanbuyprice = 25.70, lastbuyprice_withDiscount = 25.70, meanbuyprice_withDiscount = 25.70
        , lastbuyprice_withTax = 25.7, meanbuyprice_withTax = 25.7, lastbuyprice_withDiscountAndTax = 25.7
                where sellbilldetailid = 1721;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (92, '2026-10-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+257, sellCostMeanBuyPrice = sellCostMeanBuyPrice+257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+257
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 260, 257, 257
                    , 257, 257, 257, 257
                    , 0, 0, 0, 0
                    , 0, 0, 0, 257, 257, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+257
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+257, sellCostMeanBuyPrice = sellCostMeanBuyPrice+257
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+257, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+257
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+257
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+257
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+257
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '1', storedetaildate = '2026-10-03 14:54:45' WHERE storedetailid = '92';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('92', '1', '10', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '51', '41', '1', '2026-10-03 14:54:45','0','0'); -- id=3315
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('5.5','00419', '198', '6', '419', '20.00', '7', '140', '0', '', '0', '2026-10-03 14:54:45', '419', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','7','140','0','','0','0.00','0','0','0','0'); -- id=1722
UPDATE sellbilldetail SET  lastbuyprice = 5.50 , meanbuyprice = 5.50, lastbuyprice_withDiscount = 5.50, meanbuyprice_withDiscount = 5.50
        , lastbuyprice_withTax = 5.5, meanbuyprice_withTax = 5.5, lastbuyprice_withDiscountAndTax = 5.5
                where sellbilldetailid = 1722;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (419, '2026-10-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, 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+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-03', 140, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, 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 = '40', userid = '1', storedetaildate = '2026-10-03 14:54:45' WHERE storedetailid = '419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('419', '1', '20', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '60', '40', '1', '2026-10-03 14:54:45','0','0'); -- id=3316
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.1','00133', '198', '21', '133', '48.00', '23.1', '1108.8000000000002', '0', '', '0', '2026-10-03 14:54:45', '133', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','23.1','1108.8','0','','0','0.00','0','0','0','0'); -- id=1723
UPDATE sellbilldetail SET  lastbuyprice = 23.10 , meanbuyprice = 23.10, lastbuyprice_withDiscount = 23.10, meanbuyprice_withDiscount = 23.10
        , lastbuyprice_withTax = 23.1, meanbuyprice_withTax = 23.1, lastbuyprice_withDiscountAndTax = 23.1
                where sellbilldetailid = 1723;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (133, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 48, 0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.8, sellCostBuyPrice =sellCostBuyPrice+1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1108.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+48
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1108.8, 1108.8, 1108.8
                    , 1108.8, 1108.8, 1108.8, 1108.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1108.8, 1108.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.8, sellCostBuyPrice =sellCostBuyPrice+1108.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1108.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1108.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1108.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1108.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1108.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1108.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1108.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '180', userid = '1', storedetaildate = '2026-10-03 14:54:45' WHERE storedetailid = '133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('133', '1', '48', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '228', '180', '1', '2026-10-03 14:54:45','0','0'); -- id=3317
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20.5','00188', '198', '20', '188', '31', '23', '713', '0', '', '0', '2026-10-03 14:54:45', '188', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','23','713','0','','0','0.00','0','0','0','0'); -- id=1724
UPDATE sellbilldetail SET  lastbuyprice = 20.50 , meanbuyprice = 20.50, lastbuyprice_withDiscount = 20.50, meanbuyprice_withDiscount = 20.50
        , lastbuyprice_withTax = 20.5, meanbuyprice_withTax = 20.5, lastbuyprice_withDiscountAndTax = 20.5
                where sellbilldetailid = 1724;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (188, '2026-10-03', 713, 635.5, 635.5
                    , 635.5, 635.5, 635.5, 635.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 31, 0, 635.5, 635.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+713, sellCostBuyPrice =sellCostBuyPrice+635.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+635.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+635.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+635.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+635.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+635.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+635.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+635.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+31
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 713, 635.5, 635.5
                    , 635.5, 635.5, 635.5, 635.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 635.5, 635.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+713, sellCostBuyPrice =sellCostBuyPrice+635.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+635.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+635.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+635.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+635.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+635.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+635.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+635.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-03 14:54:46' WHERE storedetailid = '188';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('188', '1', '31', '1', '198', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '31', '0', '1', '2026-10-03 14:54:46','0','0'); -- id=3318
UPDATE dailyentry SET totalcreditor = '29935.80', totaldebtor = '29935.80', thedate = '2026-10-03', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-03 14:24:45', entryComment = 'اضافة فاتورة مبيعات رقم 197', fromFlag = '1',related='0',isopeningentry='0',operationId='197',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=197' WHERE id = '1227';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29935.80', '29935.80', '2026-10-03', '1', '0', '1227', '2026-10-03 14:54:46','تم عكس القيد رقم 1227 ','1','0','0','0','0',''); -- id=1230
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1230', '427', '29935.80', '','0'); -- id=1231
UPDATE accountstree SET name = 'عبدالحي الشاذلي ', customName = 'عبدالحي الشاذلي ', customNameEn = 'عبدالحي الشاذلي ', nameEn = 'عبدالحي الشاذلي ', parent = '58', accountNature = '0', theValue = '3729', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-14 13:19:31' WHERE id = '427';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1230', '143', '29935.80', '','0'); -- id=1232
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '752056.52', 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 = '28368.10', totaldebtor = '28368.10', thedate = '2026-10-03', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-03 14:24:45', entryComment = 'اضافة فاتورة مبيعات رقم 197 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='197',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=197' WHERE id = '1228';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28368.10', '28368.10', '2026-10-03', '1', '0', '1228', '2026-10-03 14:54:46','تم عكس القيد رقم 1228 ','1','0','0','0','0',''); -- id=1231
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1231', '402', '28368.10', '','0'); -- id=1232
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '687842.91', 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 ('1231', '382', '28368.10', '','0'); -- id=1233
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2604661.68', 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 ( '30648.8', '30648.8', '2026-10-03', '1', '0', '0', '2026-10-03 14:54:47','اضافة فاتورة مبيعات رقم 198','1','0',null,'0','198','sellbillController.php?do=showDetail&sellbillid=198'); -- id=1232
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1232', '427', '30648.8', '','0'); -- id=1234
UPDATE accountstree SET name = 'عبدالحي الشاذلي ', customName = 'عبدالحي الشاذلي ', customNameEn = 'عبدالحي الشاذلي ', nameEn = 'عبدالحي الشاذلي ', parent = '58', accountNature = '0', theValue = '34377.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-14 13:19:31' WHERE id = '427';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1232', '143', '30648.8', '','0'); -- id=1233
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '782705.32', 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 ( '29003.6', '29003.6', '2026-10-03', '1', '0', '0', '2026-10-03 14:54:47','اضافة فاتورة مبيعات رقم 198 - صرف البضاعة من المخزن','1','0',null,'0','198','sellbillController.php?do=showDetail&sellbillid=198'); -- id=1233
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1233', '402', '29003.6', '','0'); -- id=1235
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '716846.51', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1233', '382', '29003.6', '','0'); -- id=1234
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2575658.08', 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='1232,0,1233' where sellbillid=198;
 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-03', 30648.8, 29033.6, 29003.6
                    , 29007.93, 29003.6, 29007.93, 29003.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,29018.6, 29007.93, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30648.8, sellCostBuyPrice =sellCostBuyPrice+29033.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+29003.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29007.93
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+29003.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29007.93
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+29003.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+29018.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29007.93
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-10-03', 30648.8, 29033.6, 29003.6
                    , 29007.93, 29003.6, 29007.93, 29003.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,29018.6, 29007.93, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30648.8, sellCostBuyPrice =sellCostBuyPrice+29033.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+29003.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+29007.93
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+29003.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+29007.93
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+29003.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+29018.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29007.93
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 30648.8, 29033.6, 29003.6
                    , 29007.93, 29003.6, 29007.93, 29003.6, 29018.6, 29007.93)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+30648.8, netSellCostBuyPrice = netSellCostBuyPrice+29033.6
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+29003.6
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+29007.93
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+29003.6
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+29007.93
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+29003.6
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+29018.6
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+29007.93;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 197 and newid=198 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:24:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 14:54:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 14:54:48', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=198'); -- id=3291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:32:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 15:02:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 15:02:57', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:33:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 15:03:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 15:03:18', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3293

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =336
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '3377.8' , clientdate = '2026-10-03 15:03:18', userid = '1' WHERE clientid = '3';
UPDATE client SET  inUse = 0 where clientid = 3;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('3','34377.80','31000','1','ايصال تحصيل (( قبض من عميل ))','336', '3377.8', '2026-10-03 15:02:58', '1', 'clientPayedDeptController.php', '   ', '31000', '0', null, '0', null, null,'', '-1','1','1','31000','1','','26','0','','.'); -- id=336
UPDATE save SET  savecurrentvalue = '-450620.25',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-481620.25','31000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '336', '-450620.25', '2026-10-03 15:03:19', '1',  'clientPayedDeptController.php','3','','0'); -- id=196
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '31000', '31000', '2026-10-03', '1', '0', '0', '2026-10-03 15:03:19','اضافة ايصال سداد للعميل عبدالحي الشاذلي ','1','0','0','0','336','clientPayedDeptController.php?do=show&id=336'); -- id=1234
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1234', '383', '31000', '','0'); -- id=1236
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-284488.72', 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 ('1234', '427', '31000', '','0'); -- id=1235
UPDATE accountstree SET name = 'عبدالحي الشاذلي ', customName = 'عبدالحي الشاذلي ', customNameEn = 'عبدالحي الشاذلي ', nameEn = 'عبدالحي الشاذلي ', parent = '58', accountNature = '0', theValue = '3377.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-14 13:19:31' WHERE id = '427';
UPDATE clientdebtchange SET clientid = '3', clientdebtchangebefore = '34377.800', clientdebtchangeamount = '31000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '336', clientdebtchangeafter = '3377.800', clientdebtchangedate = '2026-10-03 15:02:58', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '31000.000',discount='', reciptid='0', dailyentryid = '1234',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='31000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '336';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:33:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 15:03:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 15:03:20', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3294
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:33:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 15:03:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 15:03:22', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3295
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 11:35:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 15:05:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 15:05:31', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:18:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:48:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 16:48:14', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3297
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:19:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:49:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 16:49:27', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3298
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 ('06ac115b3afd84', '2026-10-03 16:48:19', '1', '42113.50', '42113.5', '0', '0', '13345.00',  '13345.00', '13345', '0', '1', '2026-10-03 16:49:27', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=37
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00102', '37', '3', '102', '300', '11.75', '3525.00', '0', '', '2026-10-03 16:49:27', '102','','','0','0','0','0','0',null,'11.75','3525','0','0','0','0','0','0','0','0','1'); -- id=133
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 16:48:19', 1, 102, 0, 0
                    , 11.75, 300, 0, 0, 1, '2026-10-03 16:49:28')
                ON DUPLICATE KEY UPDATE buyprice = 11.75,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 16:49:28' ; -- id=133
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('102', '11.75', '300', '0', 'buyBillController.php', '133', '', '0', '0'); -- id=133
UPDATE product SET  productBuyPrice = "11.75" WHERE productId = 102 ;
UPDATE buybilldetail SET  quantitybefore = 1161 WHERE buybilldetailid = 133 ;
UPDATE product SET productName = 'شاسيه ', productDescription = '', productCatId = '3', productBuyPrice = '11.75', productSellAllPrice = '12.00', productSellUnitPrice = '12.00', productSellHalfPrice = '12.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '300', parcode = '00102',type ='0', expireDate = '0' , dailyentryId = '112',isService = '0',isOptic = '0',lastbuyprice = '11.75',lastbuyprice_withDiscount = '11.75',meanbuyprice = '11.75',meanbuyprice_withDiscount = '11.75' , productbuypricereal = '11.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.13' , buyhalf_precentage = '2.13' , buypart_precentage = '2.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='11.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='11.75',meanbuyprice_withTax='11.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='11.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '102';
UPDATE buybilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where buybilldetailid = 133;
UPDATE productunit SET proUnitBuyPrice  = 11.75 * productnumber WHERE productid = 102;
UPDATE storedetail SET  productquantity = '1461', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '300', '0', '37', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1161', '1461', '1', '2026-10-03 16:48:19','0','0'); -- id=3319
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00105', '37', '3', '105', '420', '15', '6300.00', '0', '', '2026-10-03 16:49:27', '105','','','0','0','0','0','0',null,'15','6300','0','0','0','0','0','0','0','0','1'); -- id=134
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 16:48:19', 1, 105, 0, 0
                    , 15, 420, 0, 0, 1, '2026-10-03 16:49:29')
                ON DUPLICATE KEY UPDATE buyprice = 15,
                        buyQuantity =buyQuantity+420, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 16:49:29' ; -- id=134
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('105', '15', '420', '0', 'buyBillController.php', '134', '', '0', '0'); -- id=134
UPDATE product SET  productBuyPrice = "15" WHERE productId = 105 ;
UPDATE buybilldetail SET  quantitybefore = 242 WHERE buybilldetailid = 134 ;
UPDATE product SET productName = 'وش ابيض ', productDescription = '', productCatId = '3', productBuyPrice = '15.00', productSellAllPrice = '15.00', productSellUnitPrice = '15.00', productSellHalfPrice = '15.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00105',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '15',lastbuyprice_withDiscount = '15',meanbuyprice = '15',meanbuyprice_withDiscount = '15' , productbuypricereal = '15.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='15',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '105';
UPDATE buybilldetail SET  lastbuyprice = 15 , meanbuyprice = 15, lastbuyprice_withDiscount = 15, meanbuyprice_withDiscount = 15
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where buybilldetailid = 134;
UPDATE productunit SET proUnitBuyPrice  = 15 * productnumber WHERE productid = 105;
UPDATE storedetail SET  productquantity = '662', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '420', '0', '37', 'اضافة فاتورة مشتريات', 'buyBillController.php', '242', '662', '1', '2026-10-03 16:48:19','0','0'); -- id=3320
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '37', '3', '100', '100', '17.6', '1760.00', '0', '', '2026-10-03 16:49:27', '100','','','0','0','0','0','0',null,'17.6','1760','0','0','0','0','0','0','0','0','1'); -- id=135
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 16:48:19', 1, 100, 0, 0
                    , 17.6, 100, 0, 0, 1, '2026-10-03 16:49:30')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 16:49:30' ; -- id=135
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('100', '17.6', '100', '0', 'buyBillController.php', '135', '', '0', '0'); -- id=135
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 100 ;
UPDATE buybilldetail SET  quantitybefore = 546 WHERE buybilldetailid = 135 ;
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 = 135;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 100;
UPDATE storedetail SET  productquantity = '646', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '100', '0', '37', 'اضافة فاتورة مشتريات', 'buyBillController.php', '546', '646', '1', '2026-10-03 16:48:19','0','0'); -- id=3321
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '37', '3', '101', '100', '17.6', '1760.00', '0', '', '2026-10-03 16:49:27', '101','','','0','0','0','0','0',null,'17.6','1760','0','0','0','0','0','0','0','0','1'); -- id=136
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 16:48:19', 1, 101, 0, 0
                    , 17.6, 100, 0, 0, 1, '2026-10-03 16:49:30')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 16:49:30' ; -- id=136
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('101', '17.6', '100', '0', 'buyBillController.php', '136', '', '0', '0'); -- id=136
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 101 ;
UPDATE buybilldetail SET  quantitybefore = 628 WHERE buybilldetailid = 136 ;
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 = 136;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 101;
UPDATE storedetail SET  productquantity = '728', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '100', '0', '37', 'اضافة فاتورة مشتريات', 'buyBillController.php', '628', '728', '1', '2026-10-03 16:48:19','0','0'); -- id=3322
UPDATE supplier SET  suppliercurrentDebt = '42113.5',suppliercurrentDebtInCurrency= '42113.5' , userid = '1', supplierdate = '2026-10-03 16:49:27'   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', '42113.50', '0', '0', 'اضافة فاتورة مشتريات', '37', '42113.5', '2026-10-03 16:48:19', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','42113.5','0','42113.5','0',''); -- id=69
UPDATE save SET  savecurrentvalue = '-463965.25',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-450620.25','13345', '1', '1', 'اضافة فاتورة مشتريات', '37', '-463965.25', '2026-10-03 16:48:19', '1',  'buyBillController.php','0','','0'); -- id=197
update buybill set dailyentryid='0,0' where buybillid=37;
COMMIT;
UPDATE product SET overAllAveragePrice = 17.6 WHERE productId = 100;UPDATE product SET overAllAveragePrice = 17.6 WHERE productId = 101;UPDATE product SET overAllAveragePrice = 11.75 WHERE productId = 102;UPDATE product SET overAllAveragePrice = 15 WHERE productId = 105;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:19:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:49:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 16:49:32', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=37'); -- id=3299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:20:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:50:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 16:50:14', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3300

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac0fd9c4cdbf
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(12,@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-03 16:50:17', '06ac0fd9c4cdbf', '12', '1960.00', '25040', '0', '1', '23080.00', '23080', '0', '23080', '1', '2026-10-03 16:50:17', '', '1', '0', 'بيتر', '1', '1', '3', '0', '12 - بيتر', '1820' ,'0','','','','','-1','0','0','0','0','0','23080','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=199
UPDATE client SET  clientdebt = '25040', userid = '1' WHERE clientid = '12';
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 ('12','1960.00','23080','0','اضافة فاتورة مبيعات','199', '25040', '2026-10-03 16:50:17', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '23080', '0', null, '0', null, null,'', '0','1','1','23080','1','2026-10-03 16:50:17','0','0','',''); -- id=337
UPDATE client SET  inUse = 0 where clientid = 12;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+200 where id = 96;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00100', '199', '3', '100', '200', '17.75', '3550', '0', '', '1', '2026-10-03 16:50:17', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','96-200,','1','1','0','0','17.75','3550','0','','0','0.00','0','0','0','0'); -- id=1725
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1725;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 3550, 3520, 3520
                    , 3520, 3520, 3520, 3520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 0, 3520, 3520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3550, sellCostBuyPrice =sellCostBuyPrice+3520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+200
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 3550, 3520, 3520
                    , 3520, 3520, 3520, 3520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3520, 3520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3550, sellCostBuyPrice =sellCostBuyPrice+3520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '446', userid = '1', storedetaildate = '2026-10-03 16:50:18' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '200', '1', '199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '646', '446', '1', '2026-10-03 16:50:18','0','0'); -- id=3323
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+240 where id = 97;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00101', '199', '3', '101', '240', '17.75', '4260', '0', '', '1', '2026-10-03 16:50:18', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','97-240,','1','1','0','0','17.75','4260','0','','0','0.00','0','0','0','0'); -- id=1726
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1726;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 4260, 4224, 4224
                    , 4224, 4224, 4224, 4224
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 0, 4224, 4224, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4260, sellCostBuyPrice =sellCostBuyPrice+4224
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4224, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4224
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4224, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4224
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4224
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4224
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4224
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+240
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 4260, 4224, 4224
                    , 4224, 4224, 4224, 4224
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4224, 4224, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4260, sellCostBuyPrice =sellCostBuyPrice+4224
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4224, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4224
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4224, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4224
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4224
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4224
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4224
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '488', userid = '1', storedetaildate = '2026-10-03 16:50:18' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '240', '1', '199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '728', '488', '1', '2026-10-03 16:50:18','0','0'); -- id=3324
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+102 where id = 11;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+300 where id = 133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11.75','00102', '199', '3', '102', '500', '12.5', '6250', '0', '', '1', '2026-10-03 16:50:18', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','11-102,133-300,','1','1','0','0','12.5','6250','0','','0','0.00','0','0','0','0'); -- id=1727
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1727;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 6250, 5875, 5875
                    , 5875, 5875, 5875, 5875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 0, 5875, 5875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6250, sellCostBuyPrice =sellCostBuyPrice+5875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+500
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 6250, 5875, 5875
                    , 5875, 5875, 5875, 5875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5875, 5875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6250, sellCostBuyPrice =sellCostBuyPrice+5875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '961', userid = '1', storedetaildate = '2026-10-03 16:50:18' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '500', '1', '199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1461', '961', '1', '2026-10-03 16:50:18','0','0'); -- id=3325
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+420 where id = 134;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15','00105', '199', '3', '105', '440', '15', '6600', '0', '', '1', '2026-10-03 16:50:18', '105', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','134-420,','1','1','0','0','15','6600','0','','0','0.00','0','0','0','0'); -- id=1728
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1728;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (105, '2026-10-03', 6600, 6600, 6600
                    , 6600, 6600, 6600, 6600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 440, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+440
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 6600, 6600, 6600
                    , 6600, 6600, 6600, 6600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '222', userid = '1', storedetaildate = '2026-10-03 16:50:19' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '440', '1', '199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '662', '222', '1', '2026-10-03 16:50:19','0','0'); -- id=3326
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+440 where id = 8;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00103', '199', '3', '103', '440', '5.5', '2420', '0', '', '1', '2026-10-03 16:50:19', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-440,','1','1','0','0','5.5','2420','0','','0','0.00','0','0','0','0'); -- id=1729
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 = 1729;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-10-03', 2420, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0, 440, 0, 1980, 1980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2420, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+440
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2420, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1980, 1980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2420, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1388', userid = '1', storedetaildate = '2026-10-03 16:50:19' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '440', '1', '199', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1828', '1388', '1', '2026-10-03 16:50:19','0','0'); -- id=3327
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23080', '23080', '2026-10-03', '1', '0', '0', '2026-10-03 16:50:19','اضافة فاتورة مبيعات رقم 199','1','0',null,'0','199','sellbillController.php?do=showDetail&sellbillid=199'); -- id=1235
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1235', '439', '23080', '','0'); -- id=1237
UPDATE accountstree SET name = 'بيتر', customName = 'بيتر', customNameEn = 'بيتر', nameEn = 'بيتر', parent = '58', accountNature = '0', theValue = '25040', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 09:25:00' WHERE id = '439';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1235', '143', '23080', '','0'); -- id=1236
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '805785.32', 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 ( '22199', '22199', '2026-10-03', '1', '0', '0', '2026-10-03 16:50:19','اضافة فاتورة مبيعات رقم 199 - صرف البضاعة من المخزن','1','0',null,'0','199','sellbillController.php?do=showDetail&sellbillid=199'); -- id=1236
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1236', '402', '22199', '','0'); -- id=1238
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '739045.51', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1236', '382', '22199', '','0'); -- id=1237
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2553459.08', 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='1235,0,1236' where sellbillid=199;
 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-03', 23080, 22199, 22199
                    , 22199, 22199, 22199, 22199
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,22199, 22199, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23080, sellCostBuyPrice =sellCostBuyPrice+22199
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22199, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22199
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22199, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22199
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22199
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22199
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22199
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (12, '2026-10-03', 23080, 22199, 22199
                    , 22199, 22199, 22199, 22199
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,22199, 22199, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23080, sellCostBuyPrice =sellCostBuyPrice+22199
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22199, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22199
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22199, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22199
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22199
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22199
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22199
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 23080, 22199, 22199
                    , 22199, 22199, 22199, 22199, 22199, 22199)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+23080, netSellCostBuyPrice = netSellCostBuyPrice+22199
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+22199
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+22199
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+22199
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+22199
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+22199
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+22199
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+22199;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac0fd9c4cdbf and sellbillId = 199 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:20:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:50:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 16:50:21', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3301
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:28:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:58:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 16:58:15', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3302

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac1162dc6b5d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2,@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-03 16:58:16', '06ac1162dc6b5d', '2', '0.00', '6608.29', '23', '2', '8582.20', '6608.29', '0', '6608.29', '1', '2026-10-03 16:58:16', '', '1', '0', 'فؤاد الطوخي', '1', '1', '3', '0', 'فؤاد الطوخي', '152' ,'0','','','','','-1','0','0','0','0','0','6608','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=200
UPDATE client SET  clientdebt = '6608.29', userid = '1' WHERE clientid = '2';
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 ('2','0.00','6608.29','0','اضافة فاتورة مبيعات','200', '6608.29', '2026-10-03 16:58:17', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6608.29', '0', null, '0', null, null,'', '0','1','1','6608.29','1','2026-10-03 16:58:16','0','0','',''); -- id=338
UPDATE client SET  inUse = 0 where clientid = 2;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '14', '4', '60.87', '243.48', '0', '', '1', '2026-10-03 16:58:17', '14', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60.87','243.48','0','','0','0.00','0','0','0','0'); -- id=1730
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 = 1730;
 INSERT INTO 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-03', 187.47948651861, 188, 188
                    , 188, 188, 188, 188
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 188, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.47948651861, sellCostBuyPrice =sellCostBuyPrice+188
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+188, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+188, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+188
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 187.47948651861, 188, 188
                    , 188, 188, 188, 188
                    , 0, 0, 0, 0
                    , 0, 0, 0, 188, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.47948651861, sellCostBuyPrice =sellCostBuyPrice+188
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+188, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+188, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+188
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '85', userid = '1', storedetaildate = '2026-10-03 16:58:17' WHERE storedetailid = '14';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '4', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '89', '85', '1', '2026-10-03 16:58:17','0','0'); -- id=3328
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '7', '4', '108.2', '432.8', '0', '', '1', '2026-10-03 16:58:17', '7', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','108.2','432.8','0','','0','0.00','0','0','0','0'); -- id=1731
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 = 1731;
 INSERT INTO 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-03', 333.25579828016, 337.84, 337.84
                    , 337.84, 337.84, 337.84, 337.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 337.84, 337.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+333.25579828016, sellCostBuyPrice =sellCostBuyPrice+337.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+337.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+337.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+337.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+337.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+337.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+337.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+337.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+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-03', 333.25579828016, 337.84, 337.84
                    , 337.84, 337.84, 337.84, 337.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 337.84, 337.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+333.25579828016, sellCostBuyPrice =sellCostBuyPrice+337.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+337.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+337.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+337.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+337.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+337.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+337.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+337.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 = '128', userid = '1', storedetaildate = '2026-10-03 16:58:18' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '4', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '132', '128', '1', '2026-10-03 16:58:18','0','0'); -- id=3329
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+7 where id = 69;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '10', '7', '304.33', '2130.31', '0', '', '1', '2026-10-03 16:58:18', '10', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','69-7,','1','1','0','0','304.33','2130.31','0','','0','0.00','0','0','0','0'); -- id=1732
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 = 1732;
 INSERT INTO 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-03', 1640.3377071031, 1659, 1659
                    , 1659, 1659, 1659, 1659
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 1659, 1659, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1640.3377071031, sellCostBuyPrice =sellCostBuyPrice+1659
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1659, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1659
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1659, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1659
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1659
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1659
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1659
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1640.3377071031, 1659, 1659
                    , 1659, 1659, 1659, 1659
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1659, 1659, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1640.3377071031, sellCostBuyPrice =sellCostBuyPrice+1659
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1659, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1659
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1659, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1659
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1659
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1659
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1659
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2026-10-03 16:58:18' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '7', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '68', '61', '1', '2026-10-03 16:58:18','0','0'); -- id=3330
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '1', '35', '67.63', '2367.0499999999997', '0', '', '1', '2026-10-03 16:58:18', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','67.63','2367.05','0','','0','0.00','0','0','0','0'); -- id=1733
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 = 1733;
 INSERT INTO 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-03', 1822.6273967631, 1846.25, 1846.25
                    , 1846.25, 1846.25, 1846.25, 1846.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 0, 1846.25, 1846.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1822.6273967631, sellCostBuyPrice =sellCostBuyPrice+1846.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1846.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1846.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1846.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1846.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1846.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1846.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1846.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+35
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1822.6273967631, 1846.25, 1846.25
                    , 1846.25, 1846.25, 1846.25, 1846.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1846.25, 1846.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1822.6273967631, sellCostBuyPrice =sellCostBuyPrice+1846.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1846.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1846.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1846.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1846.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1846.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1846.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1846.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '426', userid = '1', storedetaildate = '2026-10-03 16:58:18' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '35', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '461', '426', '1', '2026-10-03 16:58:18','0','0'); -- id=3331
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '3', '15', '44.63', '669.45', '0', '', '1', '2026-10-03 16:58:18', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','44.63','669.45','0','','0','0.00','0','0','0','0'); -- id=1734
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 = 1734;
 INSERT INTO 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-03', 515.4761879821, 522, 522
                    , 522, 522, 522, 522
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 522, 522, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+515.4761879821, sellCostBuyPrice =sellCostBuyPrice+522
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+522, sellCostMeanBuyPrice = sellCostMeanBuyPrice+522
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+522, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+522
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+522
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+522
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+522
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 515.4761879821, 522, 522
                    , 522, 522, 522, 522
                    , 0, 0, 0, 0
                    , 0, 0, 0, 522, 522, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+515.4761879821, sellCostBuyPrice =sellCostBuyPrice+522
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+522, sellCostMeanBuyPrice = sellCostMeanBuyPrice+522
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+522, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+522
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+522
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+522
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+522
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1312', userid = '1', storedetaildate = '2026-10-03 16:58:19' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '15', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1327', '1312', '1', '2026-10-03 16:58:19','0','0'); -- id=3332
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 71;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','00009', '200', '1', '9', '2', '392.24', '784.48', '0', '', '1', '2026-10-03 16:58:19', '9', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','71-2,','1','1','0','0','392.24','784.48','0','','0','0.00','0','0','0','0'); -- id=1735
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 = 1735;
 INSERT INTO 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-03', 604.04923436881, 612, 612
                    , 612, 612, 612, 612
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 612, 612, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+604.04923436881, sellCostBuyPrice =sellCostBuyPrice+612
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+612, sellCostMeanBuyPrice = sellCostMeanBuyPrice+612
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+612, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+612
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+612
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+612
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+612
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 604.04923436881, 612, 612
                    , 612, 612, 612, 612
                    , 0, 0, 0, 0
                    , 0, 0, 0, 612, 612, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+604.04923436881, sellCostBuyPrice =sellCostBuyPrice+612
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+612, sellCostMeanBuyPrice = sellCostMeanBuyPrice+612
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+612, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+612
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+612
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+612
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+612
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-03 16:58:19' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '2', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '53', '51', '1', '2026-10-03 16:58:19','0','0'); -- id=3333
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '4', '20', '44.63', '892.6', '0', '', '1', '2026-10-03 16:58:19', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','44.63','892.6','0','','0','0.00','0','0','0','0'); -- id=1736
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 = 1736;
 INSERT INTO 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-03', 687.30158397614, 696, 696
                    , 696, 696, 696, 696
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 696, 696, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+687.30158397614, sellCostBuyPrice =sellCostBuyPrice+696
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+696, sellCostMeanBuyPrice = sellCostMeanBuyPrice+696
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+696, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+696
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+696
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+696
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+696
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 687.30158397614, 696, 696
                    , 696, 696, 696, 696
                    , 0, 0, 0, 0
                    , 0, 0, 0, 696, 696, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+687.30158397614, sellCostBuyPrice =sellCostBuyPrice+696
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+696, sellCostMeanBuyPrice = sellCostMeanBuyPrice+696
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+696, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+696
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+696
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+696
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+696
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1561', userid = '1', storedetaildate = '2026-10-03 16:58:19' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '20', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1581', '1561', '1', '2026-10-03 16:58:19','0','0'); -- id=3334
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '200', '1', '5', '63', '13.53', '852.39', '0', '', '1', '2026-10-03 16:58:19', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','13.53','852.39','0','','0','0.00','0','0','0','0'); -- id=1737
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 = 1737;
 INSERT INTO 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-03', 656.33990271725, 664.65, 664.65
                    , 664.65, 664.65, 664.65, 664.65
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 0, 664.65, 664.65, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+656.33990271725, sellCostBuyPrice =sellCostBuyPrice+664.65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+664.65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+664.65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+664.65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+664.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+664.65
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+664.65
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+664.65
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+63
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 656.33990271725, 664.65, 664.65
                    , 664.65, 664.65, 664.65, 664.65
                    , 0, 0, 0, 0
                    , 0, 0, 0, 664.65, 664.65, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+656.33990271725, sellCostBuyPrice =sellCostBuyPrice+664.65
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+664.65, sellCostMeanBuyPrice = sellCostMeanBuyPrice+664.65
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+664.65, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+664.65
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+664.65
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+664.65
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+664.65
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1172', userid = '1', storedetaildate = '2026-10-03 16:58:20' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '63', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1235', '1172', '1', '2026-10-03 16:58:20','0','0'); -- id=3335
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','00008', '200', '1', '8', '1', '128.49', '128.49', '0', '', '1', '2026-10-03 16:58:20', '8', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','128.49','128.49','0','','0','0.00','0','0','0','0'); -- id=1738
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where sellbilldetailid = 1738;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (8, '2026-10-03', 98.937240113258, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+98.937240113258, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 98.937240113258, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+98.937240113258, sellCostBuyPrice =sellCostBuyPrice+100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 16:58:20' WHERE storedetailid = '8';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('8', '1', '1', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '31', '1', '2026-10-03 16:58:20','0','0'); -- id=3336
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', '200', '1', '16', '1', '81.15', '81.15', '0', '', '1', '2026-10-03 16:58:20', '16', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','67-1,','1','1','0','0','81.15','81.15','0','','0','0.00','0','0','0','0'); -- id=1739
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 = 1739;
 INSERT INTO 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-03', 62.48546217753, 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+62.48546217753, 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-03', 62.48546217753, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+62.48546217753, 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 = '88', userid = '1', storedetaildate = '2026-10-03 16:58:20' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '1', '200', 'اضافة فاتورة مبيعات', 'sellbillController.php', '89', '88', '1', '2026-10-03 16:58:20','0','0'); -- id=3337
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8582.2', '8582.2', '2026-10-03', '1', '0', '0', '2026-10-03 16:58:21','اضافة فاتورة مبيعات رقم 200','1','0',null,'0','200','sellbillController.php?do=showDetail&sellbillid=200'); -- id=1237
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1237', '426', '6608.29', '','0'); -- id=1239
UPDATE accountstree SET name = 'فؤاد الطوخي', customName = 'فؤاد الطوخي', customNameEn = 'فؤاد الطوخي', nameEn = 'فؤاد الطوخي', parent = '58', accountNature = '0', theValue = '6608.29', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 20:11:03' WHERE id = '426';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1237', '398', '1973.91', '','0'); -- id=1240
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '9790.54', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1237', '143', '8582.2', '','0'); -- id=1238
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '814367.52', 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 ( '6688.74', '6688.74', '2026-10-03', '1', '0', '0', '2026-10-03 16:58:21','اضافة فاتورة مبيعات رقم 200 - صرف البضاعة من المخزن','1','0',null,'0','200','sellbillController.php?do=showDetail&sellbillid=200'); -- id=1238
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1238', '402', '6688.74', '','0'); -- id=1241
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '745734.25', 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 ('1238', '382', '6688.74', '','0'); -- id=1239
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2546770.34', 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='1237,0,1238' where sellbillid=200;
 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-03', 6608.29, 6688.74, 6688.74
                    , 6688.74, 6688.74, 6688.74, 6688.74
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6688.74, 6688.74, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6608.29, sellCostBuyPrice =sellCostBuyPrice+6688.74
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6688.74, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6688.74
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6688.74, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6688.74
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6688.74
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6688.74
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6688.74
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-03', 6608.29, 6688.74, 6688.74
                    , 6688.74, 6688.74, 6688.74, 6688.74
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6688.74, 6688.74, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6608.29, sellCostBuyPrice =sellCostBuyPrice+6688.74
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6688.74, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6688.74
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6688.74, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6688.74
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6688.74
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6688.74
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6688.74
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 6608.29, 6688.74, 6688.74
                    , 6688.74, 6688.74, 6688.74, 6688.74, 6688.74, 6688.74)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6608.29, netSellCostBuyPrice = netSellCostBuyPrice+6688.74
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6688.74
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6688.74
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6688.74
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6688.74
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6688.74
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6688.74
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6688.74;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac1162dc6b5d and sellbillId = 200 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 13:28:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 16:58:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 16:58:22', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 14:19:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 17:49:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 17:49:35', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 14:19:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 17:49:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 17:49:50', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3305
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 ('06ac1240fe4c3c', '2026-10-03 17:49:35', '1', '42113.50', '42113.5', '0', '0', '1912.50',  '1912.50', '1912.50', '0', '1', '2026-10-03 17:49:51', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=38
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00320', '38', '7', '320', '25', '76.5', '1912.50', '0', '', '2026-10-03 17:49:51', '320','','','0','0','0','0','0',null,'76.5','1912.5','0','0','0','0','0','0','0','0','1'); -- id=137
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 17:49:35', 1, 320, 0, 0
                    , 76.5, 25, 0, 0, 1, '2026-10-03 17:49:51')
                ON DUPLICATE KEY UPDATE buyprice = 76.5,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 17:49:51' ; -- id=137
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('320', '76.5', '25', '0', 'buyBillController.php', '137', '', '0', '0'); -- id=137
UPDATE product SET  productBuyPrice = "76.5" WHERE productId = 320 ;
UPDATE buybilldetail SET  quantitybefore = 16 WHERE buybilldetailid = 137 ;
UPDATE product SET productName = 'لاصق سريع ', productDescription = '', productCatId = '7', productBuyPrice = '76.50', productSellAllPrice = '80.00', productSellUnitPrice = '85.00', productSellHalfPrice = '80.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00320',type ='0', expireDate = '0' , dailyentryId = '386',isService = '0',isOptic = '0',lastbuyprice = '76.5',lastbuyprice_withDiscount = '76.5',meanbuyprice = '76.5',meanbuyprice_withDiscount = '76.5' , productbuypricereal = '76.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.58' , buyhalf_precentage = '4.58' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='76.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='76.5',meanbuyprice_withTax='76.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='76.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 = '320';
UPDATE buybilldetail SET  lastbuyprice = 76.5 , meanbuyprice = 76.5, lastbuyprice_withDiscount = 76.5, meanbuyprice_withDiscount = 76.5
        , lastbuyprice_withTax = 76.5, meanbuyprice_withTax = 76.5, lastbuyprice_withDiscountAndTax = 76.5
                where buybilldetailid = 137;
UPDATE productunit SET proUnitBuyPrice  = 76.5 * productnumber WHERE productid = 320;
UPDATE storedetail SET  productquantity = '41', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '320';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('320', '1', '25', '0', '38', 'اضافة فاتورة مشتريات', 'buyBillController.php', '16', '41', '1', '2026-10-03 17:49:35','0','0'); -- id=3338
UPDATE supplier SET  suppliercurrentDebt = '42113.5',suppliercurrentDebtInCurrency= '42113.5' , userid = '1', supplierdate = '2026-10-03 17:49:51'   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', '42113.50', '0', '0', 'اضافة فاتورة مشتريات', '38', '42113.5', '2026-10-03 17:49:35', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','42113.5','0','42113.5','0',''); -- id=70
UPDATE save SET  savecurrentvalue = '-465877.75',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-463965.25','1912.5', '1', '1', 'اضافة فاتورة مشتريات', '38', '-465877.75', '2026-10-03 17:49:35', '1',  'buyBillController.php','0','','0'); -- id=198
update buybill set dailyentryid='0,0' where buybillid=38;
COMMIT;
UPDATE product SET overAllAveragePrice = 76.5 WHERE productId = 320;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 14:19:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 17:49:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 17:49:52', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=38'); -- id=3306
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 14:33:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 18:03:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 18:03:19', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 15:40:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:10:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:10:42', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 15:41:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:11:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:11:56', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=3309
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 ('متر سلك سماعات 1 ملي ','','6','9','10','10','10','2026-10-03','0','1','0','','0','0','0','0','0','9','9','9','9','9','0','11.11','11.11','11.11','.','0','0','0','9','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','9','9','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','9','0','0','0','0','0','0','','','0','0','0','0'); -- id=560
UPDATE product SET productName = 'متر سلك سماعات 1 ملي ', productDescription = '', productCatId = '6', productBuyPrice = '9', productSellAllPrice = '10', productSellUnitPrice = '10', productSellHalfPrice = '10', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00560',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '9',lastbuyprice_withDiscount = '9',meanbuyprice = '9',meanbuyprice_withDiscount = '9' , productbuypricereal = '9' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='9',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='9',meanbuyprice_withTax='9',price4='0',price5='0',price6='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='9',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '560';
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', '560', '1.00', '2026-10-03', '1', '0','0056001','10','10','10','9','','0','0','0','0','0','0','0','0','0','0'); -- id=560
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('560', '1', '90', '1', '2026-10-03'); -- id=560
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('560', '1', '90', '0', '560', 'إضافة منتج', 'productController.php', '0', '90', '1', '2026-10-03','0','0'); -- id=3339
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (560, 1,'2026-10-03 19:11:58',1)
                ON DUPLICATE KEY UPDATE productid = 560, edited = 1, sysdate = '2026-10-03 19:11:58', userid = 1; -- id=712
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '810', '810', '2026-10-03', '1', '0', '0', '2026-10-03 19:11:58','إضافة منتج متر سلك سماعات 1 ملي  الكمية 90','1','0','0','0','560','productController.php?do=edit&id=560'); -- id=1239
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1239', '382', '810', '','0'); -- id=1242
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2547580.34', 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 ('1239', '121', '810', '','0'); -- id=1240
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1653466.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 = 'متر سلك سماعات 1 ملي ', productDescription = '', productCatId = '6', productBuyPrice = '9.00', productSellAllPrice = '10.00', productSellUnitPrice = '10.00', productSellHalfPrice = '10.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00560',type ='0', expireDate = '0' , dailyentryId = '1239',isService = '0',isOptic = '0',lastbuyprice = '9',lastbuyprice_withDiscount = '9',meanbuyprice = '9',meanbuyprice_withDiscount = '9' , productbuypricereal = '9' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='9',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='9',meanbuyprice_withTax='9',price4='0',price5='0',price6='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='9',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '560';
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 ('متر سلك سماعات .5 ملي ','','6','6','7','7','7','2026-10-03','0','1','0','','0','0','0','0','0','6','6','6','6','6','0','16.67','16.67','16.67','.','0','0','0','6','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','6','6','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','6','0','0','0','0','0','0','','','0','0','0','0'); -- id=561
UPDATE product SET productName = 'متر سلك سماعات .5 ملي ', productDescription = '', productCatId = '6', productBuyPrice = '6', productSellAllPrice = '7', productSellUnitPrice = '7', productSellHalfPrice = '7', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00561',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '6',lastbuyprice_withDiscount = '6',meanbuyprice = '6',meanbuyprice_withDiscount = '6' , productbuypricereal = '6' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '16.67',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6',meanbuyprice_withTax='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='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 = '561';
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', '561', '1.00', '2026-10-03', '1', '0','0056101','7','7','7','6','','0','0','0','0','0','0','0','0','0','0'); -- id=561
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('561', '1', '90', '1', '2026-10-03'); -- id=561
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('561', '1', '90', '0', '561', 'إضافة منتج', 'productController.php', '0', '90', '1', '2026-10-03','0','0'); -- id=3340
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (561, 1,'2026-10-03 19:11:59',1)
                ON DUPLICATE KEY UPDATE productid = 561, edited = 1, sysdate = '2026-10-03 19:11:59', userid = 1; -- id=713
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '540', '540', '2026-10-03', '1', '0', '0', '2026-10-03 19:11:59','إضافة منتج متر سلك سماعات .5 ملي  الكمية 90','1','0','0','0','561','productController.php?do=edit&id=561'); -- id=1240
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1240', '382', '540', '','0'); -- id=1243
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2548120.34', 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 ('1240', '121', '540', '','0'); -- id=1241
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1654006.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 = 'متر سلك سماعات .5 ملي ', productDescription = '', productCatId = '6', productBuyPrice = '6.00', productSellAllPrice = '7.00', productSellUnitPrice = '7.00', productSellHalfPrice = '7.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00561',type ='0', expireDate = '0' , dailyentryId = '1240',isService = '0',isOptic = '0',lastbuyprice = '6',lastbuyprice_withDiscount = '6',meanbuyprice = '6',meanbuyprice_withDiscount = '6' , productbuypricereal = '6' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '16.67',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='6',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6',meanbuyprice_withTax='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='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 = '561';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 15:42:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:12:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:12:02', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3310
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 15:47:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:17:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 19:17:13', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3311

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac127485f4f4
-- ----------------------------------------------------------------------------------------------------

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-03 19:17:14', '06ac127485f4f4', '1', '0.00', '0', '0', '1', '4003.00', '4003', '4003', '0', '1', '2026-10-03 19:17:14', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '36' ,'0','','','','','-1','0','0','0','0','0','4003','0','','0','0','4003','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=201
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','اضافة فاتورة مبيعات','201', '0', '2026-10-03 19:17:14', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4003', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 19:17:14','0','0','',''); -- id=339
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+14 where id = 17;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('69.5','00318', '201', '7', '318', '14', '72', '1008', '0', '', '1', '2026-10-03 19:17:14', '318', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','17-14,','1','1','0','0','72','1008','0','','0','0.00','0','0','0','0'); -- id=1740
UPDATE sellbilldetail SET  lastbuyprice = 69.50 , meanbuyprice = 68.78, lastbuyprice_withDiscount = 69.50, meanbuyprice_withDiscount = 68.78
        , lastbuyprice_withTax = 69.5, meanbuyprice_withTax = 68.78, lastbuyprice_withDiscountAndTax = 69.5
                where sellbilldetailid = 1740;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (318, '2026-10-03', 1008, 973, 973
                    , 962.92, 973, 962.92, 973
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 0, 973, 962.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1008, sellCostBuyPrice =sellCostBuyPrice+973
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+973, sellCostMeanBuyPrice = sellCostMeanBuyPrice+962.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+973, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+962.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+973
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+973
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+962.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+14
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1008, 973, 973
                    , 962.92, 973, 962.92, 973
                    , 0, 0, 0, 0
                    , 0, 0, 0, 973, 962.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1008, sellCostBuyPrice =sellCostBuyPrice+973
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+973, sellCostMeanBuyPrice = sellCostMeanBuyPrice+962.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+973, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+962.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+973
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+973
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+962.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 = '45', userid = '1', storedetaildate = '2026-10-03 19:17:15' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '14', '1', '201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '45', '1', '2026-10-03 19:17:15','0','0'); -- id=3341
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+7 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', '201', '20', '196', '7', '245', '1715', '0', '', '1', '2026-10-03 19:17:15', '196', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','109-7,','1','1','0','0','245','1715','0','','0','0.00','0','0','0','0'); -- id=1741
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 = 1741;
 INSERT INTO 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-03', 1715, 1525.44, 1525.44
                    , 1511.44, 1525.44, 1511.44, 1525.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 1525.44, 1511.44, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1715, sellCostBuyPrice =sellCostBuyPrice+1525.44
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1525.44, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1511.44
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1525.44, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1511.44
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1525.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1525.44
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1511.44
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1715, 1525.44, 1525.44
                    , 1511.44, 1525.44, 1511.44, 1525.44
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1525.44, 1511.44, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1715, sellCostBuyPrice =sellCostBuyPrice+1525.44
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1525.44, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1511.44
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1525.44, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1511.44
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1525.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1525.44
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1511.44
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '203', userid = '1', storedetaildate = '2026-10-03 19:17:15' WHERE storedetailid = '196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '7', '1', '201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '210', '203', '1', '2026-10-03 19:17:15','0','0'); -- id=3342
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 52;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('168','00452', '201', '6', '452', '2', '215', '430', '0', '', '1', '2026-10-03 19:17:15', '452', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','52-2,','1','1','0','0','215','430','0','','0','0.00','0','0','0','0'); -- id=1742
UPDATE sellbilldetail SET  lastbuyprice = 168.00 , meanbuyprice = 168.00, lastbuyprice_withDiscount = 168.00, meanbuyprice_withDiscount = 168.00
        , lastbuyprice_withTax = 168, meanbuyprice_withTax = 168, lastbuyprice_withDiscountAndTax = 168
                where sellbilldetailid = 1742;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (452, '2026-10-03', 430, 336, 336
                    , 336, 336, 336, 336
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 336, 336, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+336
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+336, sellCostMeanBuyPrice = sellCostMeanBuyPrice+336
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+336, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+336
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+336
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+336
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+336
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 430, 336, 336
                    , 336, 336, 336, 336
                    , 0, 0, 0, 0
                    , 0, 0, 0, 336, 336, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+336
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+336, sellCostMeanBuyPrice = sellCostMeanBuyPrice+336
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+336, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+336
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+336
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+336
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+336
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 19:17:15' WHERE storedetailid = '452';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('452', '1', '2', '1', '201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '37', '1', '2026-10-03 19:17:15','0','0'); -- id=3343
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 53;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('212','00453', '201', '6', '453', '3', '250', '750', '0', '', '1', '2026-10-03 19:17:16', '453', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','53-3,','1','1','0','0','250','750','0','','0','0.00','0','0','0','0'); -- id=1743
UPDATE sellbilldetail SET  lastbuyprice = 212.00 , meanbuyprice = 212.00, lastbuyprice_withDiscount = 212.00, meanbuyprice_withDiscount = 212.00
        , lastbuyprice_withTax = 212, meanbuyprice_withTax = 212, lastbuyprice_withDiscountAndTax = 212
                where sellbilldetailid = 1743;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (453, '2026-10-03', 750, 636, 636
                    , 636, 636, 636, 636
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 636, 636, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+636
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+636, sellCostMeanBuyPrice = sellCostMeanBuyPrice+636
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+636, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+636
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+636
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+636
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+636
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 750, 636, 636
                    , 636, 636, 636, 636
                    , 0, 0, 0, 0
                    , 0, 0, 0, 636, 636, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+636
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+636, sellCostMeanBuyPrice = sellCostMeanBuyPrice+636
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+636, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+636
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+636
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+636
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+636
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-03 19:17:16' WHERE storedetailid = '453';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('453', '1', '3', '1', '201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '36', '1', '2026-10-03 19:17:16','0','0'); -- id=3344
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('9','00560', '201', '6', '560', '10', '10', '100', '0', '', '1', '2026-10-03 19:17:16', '560', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','100','0','','0','0.00','0','0','0','0'); -- id=1744
UPDATE sellbilldetail SET  lastbuyprice = 9.00 , meanbuyprice = 9.00, lastbuyprice_withDiscount = 9.00, meanbuyprice_withDiscount = 9.00
        , lastbuyprice_withTax = 9, meanbuyprice_withTax = 9, lastbuyprice_withDiscountAndTax = 9
                where sellbilldetailid = 1744;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (560, '2026-10-03', 100, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, 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+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-03', 100, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+100, 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 = '80', userid = '1', storedetaildate = '2026-10-03 19:17:16' WHERE storedetailid = '560';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('560', '1', '10', '1', '201', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '80', '1', '2026-10-03 19:17:16','0','0'); -- id=3345
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-461874.75',  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 ('-465877.75','4003', '0', '1', 'اضافة فاتورة مبيعات', '201', '-461874.75', '2026-10-03 19:17:16', '1',  'sellbillController.php','1','','0'); -- id=199
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4003', '4003', '2026-10-03', '1', '0', '0', '2026-10-03 19:17:17','اضافة فاتورة مبيعات رقم 201','1','0',null,'0','201','sellbillController.php?do=showDetail&sellbillid=201'); -- id=1241
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1241', '383', '4003', '','0'); -- id=1244
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-280485.72', 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 ('1241', '143', '4003', '','0'); -- id=1242
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '818370.52', 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 ( '3560.44', '3560.44', '2026-10-03', '1', '0', '0', '2026-10-03 19:17:17','اضافة فاتورة مبيعات رقم 201 - صرف البضاعة من المخزن','1','0',null,'0','201','sellbillController.php?do=showDetail&sellbillid=201'); -- id=1242
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1242', '402', '3560.44', '','0'); -- id=1245
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '749294.69', 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 ('1242', '382', '3560.44', '','0'); -- id=1243
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2544559.9', 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='1241,0,1242' where sellbillid=201;
 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-03', 4003, 3560.44, 3560.44
                    , 3536.36, 3560.44, 3536.36, 3560.44
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3560.44, 3536.36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4003, sellCostBuyPrice =sellCostBuyPrice+3560.44
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3560.44, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3536.36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3560.44, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3536.36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3560.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3560.44
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3536.36
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 4003, 3560.44, 3560.44
                    , 3536.36, 3560.44, 3536.36, 3560.44
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3560.44, 3536.36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4003, sellCostBuyPrice =sellCostBuyPrice+3560.44
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3560.44, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3536.36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3560.44, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3536.36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3560.44
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3560.44
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3536.36
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4003, 3560.44, 3560.44
                    , 3536.36, 3560.44, 3536.36, 3560.44, 3560.44, 3536.36)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4003, netSellCostBuyPrice = netSellCostBuyPrice+3560.44
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3560.44
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3536.36
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3560.44
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3536.36
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3560.44
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3560.44
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3536.36;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac127485f4f4 and sellbillId = 201 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 15:47:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:17:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 19:17:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:14:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:44:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 19:44:49', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3313
UPDATE productunit SET unitid = '1', productid = '416', productnumber = '1.00', productunitdate = '2026-09-19', userid = '1', conditions = '0',proUnitParcode='0041601',proUnitSellAllPrice='15',proUnitSellHalfPrice='15',proUnitSellUnitPrice ='15',proUnitBuyPrice='13',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '416';
UPDATE product SET productName = 'كوفريه 2 خط ', productDescription = '', productCatId = '6', productBuyPrice = '14.45', productSellAllPrice = '16', productSellUnitPrice = '17', productSellHalfPrice = '16', productDate = '2026-09-19', conditions = '0', userId = '1', limitamount = '0', parcode = '00416',type ='0', expireDate = '0' , dailyentryId = '599',isService = '0',isOptic = '0',lastbuyprice = '13.00',lastbuyprice_withDiscount = '13',meanbuyprice = '13.00',meanbuyprice_withDiscount = '13' , productbuypricereal = '13' , buypricereal_precentage = '0' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='13',meanbuyprice_withTax='13',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='13',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '416';
UPDATE productunit SET unitid = '1', productid = '450', productnumber = '1.00', productunitdate = '2026-09-23', userid = '1', conditions = '0',proUnitParcode='0045001',proUnitSellAllPrice='15',proUnitSellHalfPrice='15',proUnitSellUnitPrice ='15',proUnitBuyPrice='13',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '450';
UPDATE product SET productName = 'كوفريه 3 خط ', productDescription = '', productCatId = '6', productBuyPrice = '17.6', productSellAllPrice = '18', productSellUnitPrice = '20', productSellHalfPrice = '18', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00450',type ='0', expireDate = '0' , dailyentryId = '814',isService = '0',isOptic = '0',lastbuyprice = '13.00',lastbuyprice_withDiscount = '13',meanbuyprice = '13.00',meanbuyprice_withDiscount = '13' , productbuypricereal = '13' , buypricereal_precentage = '0' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='13',meanbuyprice_withTax='13',price4='0',price5='0',price6='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='13',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '450';
UPDATE productunit SET unitid = '1', productid = '268', productnumber = '1.00', productunitdate = '2026-09-15', userid = '1', conditions = '0',proUnitParcode='0026801',proUnitSellAllPrice='900',proUnitSellHalfPrice='900',proUnitSellUnitPrice ='960',proUnitBuyPrice='852',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '268';
UPDATE product SET productName = 'لفه سلك سماعات 1 ملي نحاس ', productDescription = '', productCatId = '10', productBuyPrice = '889', productSellAllPrice = '925', productSellUnitPrice = '995', productSellHalfPrice = '925', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00268',type ='0', expireDate = '0' , dailyentryId = '316',isService = '0',isOptic = '0',lastbuyprice = '852.00',lastbuyprice_withDiscount = '852',meanbuyprice = '852.00',meanbuyprice_withDiscount = '852' , productbuypricereal = '852' , buypricereal_precentage = '0' , buytotal_precentage = '5.63' , buyhalf_precentage = '5.63' , buypart_precentage = '12.68',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='852',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='852',meanbuyprice_withTax='852',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='852',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '268';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:17:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:47:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 19:47:15', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3314
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:18:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:48:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:48:05', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:18:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:48:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:48:39', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=3316
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 ('سلك دش 96 شعره ','','10','460','495','525','525','2026-10-03','0','1','0','','0','0','0','0','0','460','460','460','460','460','0','7.61','14.13','14.13','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=562
UPDATE product SET productName = 'سلك دش 96 شعره ', productDescription = '', productCatId = '10', productBuyPrice = '460', productSellAllPrice = '495', productSellUnitPrice = '525', productSellHalfPrice = '525', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00562',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '7.61' , buyhalf_precentage = '14.13' , buypart_precentage = '14.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '562';
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', '562', '1.00', '2026-10-03', '1', '0','0056201','495','525','525','460','','0','0','0','0','0','0','0','0','0','0'); -- id=562
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('562', '1', '5', '1', '2026-10-03'); -- id=562
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('562', '1', '5', '0', '562', 'إضافة منتج', 'productController.php', '0', '5', '1', '2026-10-03','0','0'); -- id=3346
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (562, 1,'2026-10-03 19:48:40',1)
                ON DUPLICATE KEY UPDATE productid = 562, edited = 1, sysdate = '2026-10-03 19:48:40', userid = 1; -- id=714
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2300', '2300', '2026-10-03', '1', '0', '0', '2026-10-03 19:48:40','إضافة منتج سلك دش 96 شعره  الكمية 5','1','0','0','0','562','productController.php?do=edit&id=562'); -- id=1243
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1243', '382', '2300', '','0'); -- id=1246
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2546859.9', 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 ('1243', '121', '2300', '','0'); -- id=1244
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1656306.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 = 'سلك دش 96 شعره ', productDescription = '', productCatId = '10', productBuyPrice = '460.00', productSellAllPrice = '495.00', productSellUnitPrice = '525.00', productSellHalfPrice = '525.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00562',type ='0', expireDate = '0' , dailyentryId = '1243',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '7.61' , buyhalf_precentage = '14.13' , buypart_precentage = '14.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '562';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:18:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:48:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:48:43', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3317
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:19:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:49:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:49:46', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=3318
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 ('شاسيه اسبوط مجوز جديد ','','21','26.25','28','30','30','2026-10-03','0','1','0','','0','0','0','0','0','26.25','26.25','26.25','26.25','26.25','0','6.67','14.29','14.29','.','0','0','0','26.25','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','26.25','26.25','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','26.25','0','0','0','0','0','0','','','0','0','0','0'); -- id=563
UPDATE product SET productName = 'شاسيه اسبوط مجوز جديد ', productDescription = '', productCatId = '21', productBuyPrice = '26.25', productSellAllPrice = '28', productSellUnitPrice = '30', productSellHalfPrice = '30', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00563',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '26.25',lastbuyprice_withDiscount = '26.25',meanbuyprice = '26.25',meanbuyprice_withDiscount = '26.25' , productbuypricereal = '26.25' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '14.29' , buypart_precentage = '14.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26.25',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '563';
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', '563', '1.00', '2026-10-03', '1', '0','0056301','28','30','30','26.25','','0','0','0','0','0','0','0','0','0','0'); -- id=563
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('563', '1', '144', '1', '2026-10-03'); -- id=563
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('563', '1', '144', '0', '563', 'إضافة منتج', 'productController.php', '0', '144', '1', '2026-10-03','0','0'); -- id=3347
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (563, 1,'2026-10-03 19:49:47',1)
                ON DUPLICATE KEY UPDATE productid = 563, edited = 1, sysdate = '2026-10-03 19:49:47', userid = 1; -- id=715
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3780', '3780', '2026-10-03', '1', '0', '0', '2026-10-03 19:49:47','إضافة منتج شاسيه اسبوط مجوز جديد  الكمية 144','1','0','0','0','563','productController.php?do=edit&id=563'); -- id=1244
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1244', '382', '3780', '','0'); -- id=1247
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2550639.9', 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 ('1244', '121', '3780', '','0'); -- id=1245
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1660086.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 = 'شاسيه اسبوط مجوز جديد ', productDescription = '', productCatId = '21', productBuyPrice = '26.25', productSellAllPrice = '28.00', productSellUnitPrice = '30.00', productSellHalfPrice = '30.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00563',type ='0', expireDate = '0' , dailyentryId = '1244',isService = '0',isOptic = '0',lastbuyprice = '26.25',lastbuyprice_withDiscount = '26.25',meanbuyprice = '26.25',meanbuyprice_withDiscount = '26.25' , productbuypricereal = '26.25' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '14.29' , buypart_precentage = '14.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26.25',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '563';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:19:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:49:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:49:49', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:21:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:51:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:51:00', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=3320
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 ('شاسيه مفرد اسمر قديم ','','21','14.7','15','16','16','2026-10-03','0','1','0','','0','0','0','0','0','14.7','14.7','14.7','14.7','14.7','0','2.04','8.84','8.84','.','0','0','0','14.7','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','14.7','14.7','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','14.7','0','0','0','0','0','0','','','0','0','0','0'); -- id=564
UPDATE product SET productName = 'شاسيه مفرد اسمر قديم ', productDescription = '', productCatId = '21', productBuyPrice = '14.7', productSellAllPrice = '15', productSellUnitPrice = '16', productSellHalfPrice = '16', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00564',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '14.7',lastbuyprice_withDiscount = '14.7',meanbuyprice = '14.7',meanbuyprice_withDiscount = '14.7' , productbuypricereal = '14.7' , buypricereal_precentage = '0' , buytotal_precentage = '2.04' , buyhalf_precentage = '8.84' , buypart_precentage = '8.84',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='14.7',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='14.7',meanbuyprice_withTax='14.7',price4='0',price5='0',price6='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='14.7',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '564';
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', '564', '1.00', '2026-10-03', '1', '0','0056401','15','16','16','14.7','','0','0','0','0','0','0','0','0','0','0'); -- id=564
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('564', '1', '400', '1', '2026-10-03'); -- id=564
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('564', '1', '400', '0', '564', 'إضافة منتج', 'productController.php', '0', '400', '1', '2026-10-03','0','0'); -- id=3348
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (564, 1,'2026-10-03 19:51:01',1)
                ON DUPLICATE KEY UPDATE productid = 564, edited = 1, sysdate = '2026-10-03 19:51:01', userid = 1; -- id=716
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5880', '5880', '2026-10-03', '1', '0', '0', '2026-10-03 19:51:01','إضافة منتج شاسيه مفرد اسمر قديم  الكمية 400','1','0','0','0','564','productController.php?do=edit&id=564'); -- id=1245
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1245', '382', '5880', '','0'); -- id=1248
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2556519.9', 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 ('1245', '121', '5880', '','0'); -- id=1246
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1665966.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 = 'شاسيه مفرد اسمر قديم ', productDescription = '', productCatId = '21', productBuyPrice = '14.70', productSellAllPrice = '15.00', productSellUnitPrice = '16.00', productSellHalfPrice = '16.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00564',type ='0', expireDate = '0' , dailyentryId = '1245',isService = '0',isOptic = '0',lastbuyprice = '14.7',lastbuyprice_withDiscount = '14.7',meanbuyprice = '14.7',meanbuyprice_withDiscount = '14.7' , productbuypricereal = '14.7' , buypricereal_precentage = '0' , buytotal_precentage = '2.04' , buyhalf_precentage = '8.84' , buypart_precentage = '8.84',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='14.7',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='14.7',meanbuyprice_withTax='14.7',price4='0',price5='0',price6='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='14.7',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '564';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:21:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:51:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:51:03', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3321
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:22:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:52:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:52:32', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=3322
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 ('لمبه كاسه 6 وات 3','','21','0','0','0','0','2026-10-03','0','1','0','','0','0','0','0','0','','0','','0','0','0','0','0','0','.','0','0','0','0','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','0','0','0','0','0','0','0','','','0','0','0','0'); -- id=565
UPDATE product SET productName = 'لمبه كاسه 6 وات 3', productDescription = '', productCatId = '21', productBuyPrice = '0', productSellAllPrice = '0', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
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', '565', '1.00', '2026-10-03', '1', '0','0056501','0','0','0','0','','0','0','0','0','0','0','0','0','0','0'); -- id=565
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('565', '1', '0', '1', '2026-10-03'); -- id=565
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('565', '1', '0', '0', '565', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-03','0','0'); -- id=3349
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:52:33',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:52:33', userid = 1; -- id=717
UPDATE product SET productName = 'لمبه كاسه 6 وات 3', productDescription = '', productCatId = '21', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:22:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:52:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:52:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=3323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:22:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:52:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:52:37', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=3324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:22:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:52:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-03 19:52:43', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=3325
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:52:51',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:52:51', userid = 1; -- id=717
UPDATE productunit SET proUnitBuyPrice  = 38.76 * productnumber WHERE productid = 565;
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '38.76', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '19.38',meanbuyprice_withDiscount = '19.38' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='19.38',meanbuyprice_withTax='19.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:52:56',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:52:56', userid = 1; -- id=717
UPDATE productunit SET proUnitSellAllPrice  = 39.5 * productnumber  WHERE productid = 565;
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '38.76', productSellAllPrice = '39.5', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '19.38',meanbuyprice_withDiscount = '19.38' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='19.38',meanbuyprice_withTax='19.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:52:58',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:52:58', userid = 1; -- id=717
UPDATE productunit SET proUnitSellHalfPrice = 39.5 * productnumber WHERE productid = 565;
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '38.76', productSellAllPrice = '39.50', productSellUnitPrice = '0.00', productSellHalfPrice = '39.5', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '19.38',meanbuyprice_withDiscount = '19.38' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='19.38',meanbuyprice_withTax='19.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:53:00',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:53:00', userid = 1; -- id=717
UPDATE productunit SET proUnitSellUnitPrice = 39.5 * productnumber WHERE productid = 565;
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '38.76', productSellAllPrice = '39.50', productSellUnitPrice = '39.5', productSellHalfPrice = '39.50', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '19.38',meanbuyprice_withDiscount = '19.38' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='19.38',meanbuyprice_withTax='19.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (565, 1,'2026-10-03 19:53:03',1)
                ON DUPLICATE KEY UPDATE productid = 565, edited = 1, sysdate = '2026-10-03 19:53:03', userid = 1; -- id=717
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:24:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:54:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 19:54:01', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3326
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 ('06ac13f12a30ad', '2026-10-03 19:44:50', '1', '42113.50', '67268.92', '0', '0', '25155.42',  '25155.42', '', '25155.42', '1', '2026-10-03 19:54:01', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=39
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00416', '39', '6', '416', '50', '14.45', '722.50', '0', '', '2026-10-03 19:54:01', '416','','','0','0','0','0','0',null,'14.45','722.5','0','0','0','0','0','0','0','0','1'); -- id=138
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 416, 0, 0
                    , 14.45, 50, 0, 0, 1, '2026-10-03 19:54:01')
                ON DUPLICATE KEY UPDATE buyprice = 14.45,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:01' ; -- id=138
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('416', '14.45', '50', '0', 'buyBillController.php', '138', '', '0', '0'); -- id=138
UPDATE product SET  productBuyPrice = "14.45" WHERE productId = 416 ;
UPDATE buybilldetail SET  quantitybefore = 5 WHERE buybilldetailid = 138 ;
UPDATE product SET productName = 'كوفريه 2 خط ', productDescription = '', productCatId = '6', productBuyPrice = '14.45', productSellAllPrice = '16.00', productSellUnitPrice = '17.00', productSellHalfPrice = '16.00', productDate = '2026-09-19', conditions = '0', userId = '1', limitamount = '0', parcode = '00416',type ='0', expireDate = '0' , dailyentryId = '599',isService = '0',isOptic = '0',lastbuyprice = '14.45',lastbuyprice_withDiscount = '14.45',meanbuyprice = '14.32',meanbuyprice_withDiscount = '14.32' , productbuypricereal = '13.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='14.45',meanbuyprice_withTax='14.32',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='14.45',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '416';
UPDATE buybilldetail SET  lastbuyprice = 14.45 , meanbuyprice = 14.32, lastbuyprice_withDiscount = 14.45, meanbuyprice_withDiscount = 14.32
        , lastbuyprice_withTax = 14.45, meanbuyprice_withTax = 14.32, lastbuyprice_withDiscountAndTax = 14.45
                where buybilldetailid = 138;
UPDATE productunit SET proUnitBuyPrice  = 14.45 * productnumber WHERE productid = 416;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '1', '50', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '5', '55', '1', '2026-10-03 19:44:50','0','0'); -- id=3350
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00450', '39', '6', '450', '50', '17.6', '880.00', '0', '', '2026-10-03 19:54:01', '450','','','0','0','0','0','0',null,'17.6','880','0','0','0','0','0','0','0','0','1'); -- id=139
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 450, 0, 0
                    , 17.6, 50, 0, 0, 1, '2026-10-03 19:54:02')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:02' ; -- id=139
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('450', '17.6', '50', '0', 'buyBillController.php', '139', '', '0', '0'); -- id=139
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 450 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 139 ;
UPDATE product SET productName = 'كوفريه 3 خط ', productDescription = '', productCatId = '6', productBuyPrice = '17.60', productSellAllPrice = '18.00', productSellUnitPrice = '20.00', productSellHalfPrice = '18.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00450',type ='0', expireDate = '0' , dailyentryId = '814',isService = '0',isOptic = '0',lastbuyprice = '17.6',lastbuyprice_withDiscount = '17.6',meanbuyprice = '17.6',meanbuyprice_withDiscount = '17.6' , productbuypricereal = '13.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',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 = '450';
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 = 139;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 450;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '450';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('450', '1', '50', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '1', '2026-10-03 19:44:50','0','0'); -- id=3351
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00268', '39', '10', '268', '5', '889', '4445.00', '0', '', '2026-10-03 19:54:01', '268','','','0','0','0','0','0',null,'889','4445','0','0','0','0','0','0','0','0','1'); -- id=140
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 268, 0, 0
                    , 889, 5, 0, 0, 1, '2026-10-03 19:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 889,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:03' ; -- id=140
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('268', '889', '5', '0', 'buyBillController.php', '140', '', '0', '0'); -- id=140
UPDATE product SET  productBuyPrice = "889" WHERE productId = 268 ;
UPDATE buybilldetail SET  quantitybefore = 1 WHERE buybilldetailid = 140 ;
UPDATE product SET productName = 'لفه سلك سماعات 1 ملي نحاس ', productDescription = '', productCatId = '10', productBuyPrice = '889.00', productSellAllPrice = '925.00', productSellUnitPrice = '995.00', productSellHalfPrice = '925.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00268',type ='0', expireDate = '0' , dailyentryId = '316',isService = '0',isOptic = '0',lastbuyprice = '889',lastbuyprice_withDiscount = '889',meanbuyprice = '882.83',meanbuyprice_withDiscount = '882.83' , productbuypricereal = '852.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.63' , buyhalf_precentage = '5.63' , buypart_precentage = '12.68',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='852',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='889',meanbuyprice_withTax='882.83',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='889',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '268';
UPDATE buybilldetail SET  lastbuyprice = 889 , meanbuyprice = 882.83, lastbuyprice_withDiscount = 889, meanbuyprice_withDiscount = 882.83
        , lastbuyprice_withTax = 889, meanbuyprice_withTax = 882.83, lastbuyprice_withDiscountAndTax = 889
                where buybilldetailid = 140;
UPDATE productunit SET proUnitBuyPrice  = 889 * productnumber WHERE productid = 268;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '268';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('268', '1', '5', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1', '6', '1', '2026-10-03 19:44:50','0','0'); -- id=3352
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00267', '39', '10', '267', '5', '385', '1925.00', '0', '', '2026-10-03 19:54:01', '267','','','0','0','0','0','0',null,'385','1925','0','0','0','0','0','0','0','0','1'); -- id=141
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 267, 0, 0
                    , 385, 5, 0, 0, 1, '2026-10-03 19:54:04')
                ON DUPLICATE KEY UPDATE buyprice = 385,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:04' ; -- id=141
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('267', '385', '5', '0', 'buyBillController.php', '141', '', '0', '0'); -- id=141
UPDATE product SET  productBuyPrice = "385" WHERE productId = 267 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 141 ;
UPDATE product SET productName = 'لفه سلك تلفون المصريه ', productDescription = '', productCatId = '10', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '420.00', productSellHalfPrice = '400.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00267',type ='0', expireDate = '0' , dailyentryId = '315',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '3.90' , buypart_precentage = '9.09',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='385',meanbuyprice_withTax='385',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '267';
UPDATE buybilldetail SET  lastbuyprice = 385 , meanbuyprice = 385, lastbuyprice_withDiscount = 385, meanbuyprice_withDiscount = 385
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where buybilldetailid = 141;
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 267;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '267';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('267', '1', '5', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '8', '1', '2026-10-03 19:44:50','0','0'); -- id=3353
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00241', '39', '10', '241', '2', '1587', '3174.00', '0', '', '2026-10-03 19:54:01', '241','','','0','0','0','0','0',null,'1587','3174','0','0','0','0','0','0','0','0','1'); -- id=142
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 241, 0, 0
                    , 1587, 2, 0, 0, 1, '2026-10-03 19:54:05')
                ON DUPLICATE KEY UPDATE buyprice = 1587,
                        buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:05' ; -- id=142
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('241', '1587', '2', '0', 'buyBillController.php', '142', '', '0', '0'); -- id=142
UPDATE product SET  productBuyPrice = "1587" WHERE productId = 241 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 142 ;
UPDATE product SET productName = 'لفه سلك المونيوم 25 المصريه', productDescription = '', productCatId = '10', productBuyPrice = '1587.00', productSellAllPrice = '1750.00', productSellUnitPrice = '1850.00', productSellHalfPrice = '1750.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00241',type ='0', expireDate = '0' , dailyentryId = '286',isService = '0',isOptic = '0',lastbuyprice = '1587',lastbuyprice_withDiscount = '1587',meanbuyprice = '1587',meanbuyprice_withDiscount = '1587' , productbuypricereal = '1587.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.27' , buyhalf_precentage = '10.27' , buypart_precentage = '16.57',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1587',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1587',meanbuyprice_withTax='1587',price4='0',price5='0',price6='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='1587',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '241';
UPDATE buybilldetail SET  lastbuyprice = 1587 , meanbuyprice = 1587, lastbuyprice_withDiscount = 1587, meanbuyprice_withDiscount = 1587
        , lastbuyprice_withTax = 1587, meanbuyprice_withTax = 1587, lastbuyprice_withDiscountAndTax = 1587
                where buybilldetailid = 142;
UPDATE productunit SET proUnitBuyPrice  = 1587 * productnumber WHERE productid = 241;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '241';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('241', '1', '2', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '5', '1', '2026-10-03 19:44:50','0','0'); -- id=3354
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00209', '39', '10', '209', '5', '735', '3675.00', '0', '', '2026-10-03 19:54:01', '209','','','0','0','0','0','0',null,'735','3675','0','0','0','0','0','0','0','0','1'); -- id=143
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 209, 0, 0
                    , 735, 5, 0, 0, 1, '2026-10-03 19:54:06')
                ON DUPLICATE KEY UPDATE buyprice = 735,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:06' ; -- id=143
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('209', '735', '5', '0', 'buyBillController.php', '143', '', '0', '0'); -- id=143
UPDATE product SET  productBuyPrice = "735" WHERE productId = 209 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 143 ;
UPDATE product SET productName = 'لفه سلك دش 100 ريدي رونج', productDescription = '', productCatId = '10', productBuyPrice = '735.00', productSellAllPrice = '745.00', productSellUnitPrice = '750.00', productSellHalfPrice = '745.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00209',type ='0', expireDate = '0' , dailyentryId = '236',isService = '0',isOptic = '0',lastbuyprice = '735',lastbuyprice_withDiscount = '735',meanbuyprice = '735',meanbuyprice_withDiscount = '735' , productbuypricereal = '735.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.36' , buyhalf_precentage = '1.36' , buypart_precentage = '2.04',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='735',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='735',meanbuyprice_withTax='735',price4='0',price5='0',price6='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='735',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '209';
UPDATE buybilldetail SET  lastbuyprice = 735 , meanbuyprice = 735, lastbuyprice_withDiscount = 735, meanbuyprice_withDiscount = 735
        , lastbuyprice_withTax = 735, meanbuyprice_withTax = 735, lastbuyprice_withDiscountAndTax = 735
                where buybilldetailid = 143;
UPDATE productunit SET proUnitBuyPrice  = 735 * productnumber WHERE productid = 209;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '209';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('209', '1', '5', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '9', '1', '2026-10-03 19:44:50','0','0'); -- id=3355
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00137', '39', '21', '137', '300', '16.1', '4830.00', '0', '', '2026-10-03 19:54:01', '137','','','0','0','0','0','0',null,'16.1','4830','0','0','0','0','0','0','0','0','1'); -- id=144
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 137, 0, 0
                    , 16.1, 300, 0, 0, 1, '2026-10-03 19:54:07')
                ON DUPLICATE KEY UPDATE buyprice = 16.1,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:07' ; -- id=144
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('137', '16.1', '300', '0', 'buyBillController.php', '144', '', '0', '0'); -- id=144
UPDATE product SET  productBuyPrice = "16.1" WHERE productId = 137 ;
UPDATE buybilldetail SET  quantitybefore = 100 WHERE buybilldetailid = 144 ;
UPDATE product SET productName = 'شاسيه مفرد ابيض جديد', productDescription = '', productCatId = '21', productBuyPrice = '16.10', productSellAllPrice = '16.10', productSellUnitPrice = '16.70', productSellHalfPrice = '16.10', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00137',type ='0', expireDate = '0' , dailyentryId = '152',isService = '0',isOptic = '0',lastbuyprice = '16.1',lastbuyprice_withDiscount = '16.1',meanbuyprice = '16.1',meanbuyprice_withDiscount = '16.1' , productbuypricereal = '16.10' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '3.73',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='16.1',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='16.1',meanbuyprice_withTax='16.1',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='16.1',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '137';
UPDATE buybilldetail SET  lastbuyprice = 16.1 , meanbuyprice = 16.1, lastbuyprice_withDiscount = 16.1, meanbuyprice_withDiscount = 16.1
        , lastbuyprice_withTax = 16.1, meanbuyprice_withTax = 16.1, lastbuyprice_withDiscountAndTax = 16.1
                where buybilldetailid = 144;
UPDATE productunit SET proUnitBuyPrice  = 16.1 * productnumber WHERE productid = 137;
UPDATE storedetail SET  productquantity = '400', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '137';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('137', '1', '300', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '100', '400', '1', '2026-10-03 19:44:50','0','0'); -- id=3356
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00565', '39', '21', '565', '142', '38.76', '5503.92', '0', '', '2026-10-03 19:54:01', '565','','','0','0','0','0','0',null,'38.76','5503.92','0','0','0','0','0','0','0','0','1'); -- id=145
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-03 19:44:50', 1, 565, 0, 0
                    , 38.76, 142, 0, 0, 1, '2026-10-03 19:54:07')
                ON DUPLICATE KEY UPDATE buyprice = 38.76,
                        buyQuantity =buyQuantity+142, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-03 19:54:07' ; -- id=145
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('565', '38.76', '142', '0', 'buyBillController.php', '145', '', '0', '0'); -- id=145
UPDATE product SET  productBuyPrice = "38.76" WHERE productId = 565 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 145 ;
UPDATE product SET productName = 'لمبه كاسه 6 وات 3 حركه ', productDescription = '', productCatId = '21', productBuyPrice = '38.76', productSellAllPrice = '39.50', productSellUnitPrice = '39.50', productSellHalfPrice = '39.50', productDate = '2026-10-03', conditions = '0', userId = '1', limitamount = '0', parcode = '00565',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '38.76',lastbuyprice_withDiscount = '38.76',meanbuyprice = '38.76',meanbuyprice_withDiscount = '38.76' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='38.76',meanbuyprice_withTax='38.76',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='38.76',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '565';
UPDATE buybilldetail SET  lastbuyprice = 38.76 , meanbuyprice = 38.76, lastbuyprice_withDiscount = 38.76, meanbuyprice_withDiscount = 38.76
        , lastbuyprice_withTax = 38.76, meanbuyprice_withTax = 38.76, lastbuyprice_withDiscountAndTax = 38.76
                where buybilldetailid = 145;
UPDATE productunit SET proUnitBuyPrice  = 38.76 * productnumber WHERE productid = 565;
UPDATE storedetail SET  productquantity = '142', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '565';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('565', '1', '142', '0', '39', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '142', '1', '2026-10-03 19:44:50','0','0'); -- id=3357
UPDATE supplier SET  suppliercurrentDebt = '67268.92',suppliercurrentDebtInCurrency= '67268.92' , userid = '1', supplierdate = '2026-10-03 19:54:01'   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', '42113.50', '25155.42', '0', 'اضافة فاتورة مشتريات', '39', '67268.92', '2026-10-03 19:44:50', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','25155.42','1','42113.5','25155.42','67268.92','0',''); -- id=71
update buybill set dailyentryid='0,0' where buybillid=39;
COMMIT;
UPDATE product SET overAllAveragePrice = 16.1 WHERE productId = 137;UPDATE product SET overAllAveragePrice = 735 WHERE productId = 209;UPDATE product SET overAllAveragePrice = 1587 WHERE productId = 241;UPDATE product SET overAllAveragePrice = 385 WHERE productId = 267;UPDATE product SET overAllAveragePrice = 889 WHERE productId = 268;UPDATE product SET overAllAveragePrice = 14.45 WHERE productId = 416;UPDATE product SET overAllAveragePrice = 17.6 WHERE productId = 450;UPDATE product SET overAllAveragePrice = 38.76 WHERE productId = 565;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:24:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:54:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 19:54:09', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=39'); -- id=3327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:24:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:54:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 19:54:14', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3328
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:25:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 19:55:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-03 19:55:49', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3329
UPDATE productunit SET unitid = '1', productid = '555', productnumber = '1.00', productunitdate = '2026-10-01', userid = '1', conditions = '0',proUnitParcode='0055501',proUnitSellAllPrice='1250',proUnitSellHalfPrice='1250',proUnitSellUnitPrice ='1250',proUnitBuyPrice='1000',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '555';
UPDATE product SET productName = 'مكنه سلم بيانو ', productDescription = '', productCatId = '6', productBuyPrice = '885', productSellAllPrice = '995', productSellUnitPrice = '1050', productSellHalfPrice = '995', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '00555',type ='0', expireDate = '0' , dailyentryId = '1154',isService = '0',isOptic = '0',lastbuyprice = '1000.00',lastbuyprice_withDiscount = '1000',meanbuyprice = '1000.00',meanbuyprice_withDiscount = '1000' , productbuypricereal = '1000' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '25' , buypart_precentage = '25',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1000',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1000',meanbuyprice_withTax='1000',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1000',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '555';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:30:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:00:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:00:21', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3330
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:35:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:05:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:05:28', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3331

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac141474fa57
-- ----------------------------------------------------------------------------------------------------

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-03 20:05:29', '06ac141474fa57', '1', '0.00', '0', '0', '1', '7869.72', '7869.72', '7869.72', '0', '1', '2026-10-03 20:05:29', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '256' ,'0','','','','','-1','0','0','0','0','0','7869','0','','0','0','7869.72','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=202
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','اضافة فاتورة مبيعات','202', '0', '2026-10-03 20:05:29', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7869.72', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:05:29','0','0','',''); -- id=340
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('14.7','00564', '202', '21', '564', '86', '16.52', '1420.72', '0', '', '1', '2026-10-03 20:05:29', '564', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16.52','1420.72','0','','0','0.00','0','0','0','0'); -- id=1745
UPDATE sellbilldetail SET  lastbuyprice = 14.70 , meanbuyprice = 14.70, lastbuyprice_withDiscount = 14.70, meanbuyprice_withDiscount = 14.70
        , lastbuyprice_withTax = 14.7, meanbuyprice_withTax = 14.7, lastbuyprice_withDiscountAndTax = 14.7
                where sellbilldetailid = 1745;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (564, '2026-10-03', 1420.72, 1264.2, 1264.2
                    , 1264.2, 1264.2, 1264.2, 1264.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 86, 0, 1264.2, 1264.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1420.72, sellCostBuyPrice =sellCostBuyPrice+1264.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1264.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1264.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1264.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1264.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1264.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1264.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1264.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+86
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1420.72, 1264.2, 1264.2
                    , 1264.2, 1264.2, 1264.2, 1264.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1264.2, 1264.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1420.72, sellCostBuyPrice =sellCostBuyPrice+1264.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1264.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1264.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1264.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1264.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1264.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1264.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1264.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 = '314', userid = '1', storedetaildate = '2026-10-03 20:05:30' WHERE storedetailid = '564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('564', '1', '86', '1', '202', 'اضافة فاتورة مبيعات', 'sellbillController.php', '400', '314', '1', '2026-10-03 20:05:30','0','0'); -- id=3358
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('26.25','00563', '202', '21', '563', '28', '30', '840', '0', '', '1', '2026-10-03 20:05:30', '563', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','30','840','0','','0','0.00','0','0','0','0'); -- id=1746
UPDATE sellbilldetail 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 sellbilldetailid = 1746;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (563, '2026-10-03', 840, 735, 735
                    , 735, 735, 735, 735
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28, 0, 735, 735, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+735
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+735, sellCostMeanBuyPrice = sellCostMeanBuyPrice+735
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+735, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+735
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+735
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+735
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+28
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 840, 735, 735
                    , 735, 735, 735, 735
                    , 0, 0, 0, 0
                    , 0, 0, 0, 735, 735, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+840, sellCostBuyPrice =sellCostBuyPrice+735
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+735, sellCostMeanBuyPrice = sellCostMeanBuyPrice+735
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+735, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+735
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+735
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+735
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+735
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '116', userid = '1', storedetaildate = '2026-10-03 20:05:30' WHERE storedetailid = '563';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('563', '1', '28', '1', '202', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '116', '1', '2026-10-03 20:05:30','0','0'); -- id=3359
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+142 where id = 145;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('38.76','00565', '202', '21', '565', '142', '39.5', '5609', '0', '', '1', '2026-10-03 20:05:30', '565', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','145-142,','1','1','0','0','39.5','5609','0','','0','0.00','0','0','0','0'); -- id=1747
UPDATE sellbilldetail SET  lastbuyprice = 38.76 , meanbuyprice = 38.76, lastbuyprice_withDiscount = 38.76, meanbuyprice_withDiscount = 38.76
        , lastbuyprice_withTax = 38.76, meanbuyprice_withTax = 38.76, lastbuyprice_withDiscountAndTax = 38.76
                where sellbilldetailid = 1747;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (565, '2026-10-03', 5609, 5503.92, 5503.92
                    , 5503.92, 5503.92, 5503.92, 5503.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 142, 0, 5503.92, 5503.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5609, sellCostBuyPrice =sellCostBuyPrice+5503.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5503.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5503.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5503.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5503.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5503.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5503.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5503.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+142
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 5609, 5503.92, 5503.92
                    , 5503.92, 5503.92, 5503.92, 5503.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5503.92, 5503.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5609, sellCostBuyPrice =sellCostBuyPrice+5503.92
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5503.92, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5503.92
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5503.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5503.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5503.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5503.92
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5503.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 = '0', userid = '1', storedetaildate = '2026-10-03 20:05:30' WHERE storedetailid = '565';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('565', '1', '142', '1', '202', 'اضافة فاتورة مبيعات', 'sellbillController.php', '142', '0', '1', '2026-10-03 20:05:30','0','0'); -- id=3360
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-454005.03',  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 ('-461874.75','7869.72', '0', '1', 'اضافة فاتورة مبيعات', '202', '-454005.03', '2026-10-03 20:05:30', '1',  'sellbillController.php','1','','0'); -- id=200
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7869.72', '7869.72', '2026-10-03', '1', '0', '0', '2026-10-03 20:05:31','اضافة فاتورة مبيعات رقم 202','1','0',null,'0','202','sellbillController.php?do=showDetail&sellbillid=202'); -- id=1246
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1246', '383', '7869.72', '','0'); -- id=1249
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-272616', 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 ('1246', '143', '7869.72', '','0'); -- id=1247
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '826240.24', 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 ( '7503.12', '7503.12', '2026-10-03', '1', '0', '0', '2026-10-03 20:05:31','اضافة فاتورة مبيعات رقم 202 - صرف البضاعة من المخزن','1','0',null,'0','202','sellbillController.php?do=showDetail&sellbillid=202'); -- id=1247
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1247', '402', '7503.12', '','0'); -- id=1250
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '756797.81', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1247', '382', '7503.12', '','0'); -- id=1248
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2549016.78', 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='1246,0,1247' where sellbillid=202;
 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-03', 7869.72, 7503.12, 7503.12
                    , 7503.12, 7503.12, 7503.12, 7503.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7503.12, 7503.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7869.72, sellCostBuyPrice =sellCostBuyPrice+7503.12
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7503.12, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7503.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7503.12, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7503.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7503.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7503.12
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7503.12
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 7869.72, 7503.12, 7503.12
                    , 7503.12, 7503.12, 7503.12, 7503.12
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7503.12, 7503.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7869.72, sellCostBuyPrice =sellCostBuyPrice+7503.12
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7503.12, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7503.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7503.12, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7503.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7503.12
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7503.12
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7503.12
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 7869.72, 7503.12, 7503.12
                    , 7503.12, 7503.12, 7503.12, 7503.12, 7503.12, 7503.12)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7869.72, netSellCostBuyPrice = netSellCostBuyPrice+7503.12
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7503.12
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7503.12
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7503.12
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7503.12
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7503.12
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7503.12
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7503.12;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac141474fa57 and sellbillId = 202 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:35:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:05:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:05:32', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:52:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:22:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:22:28', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3333

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac143ed29313
-- ----------------------------------------------------------------------------------------------------

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-03 20:22:28', '06ac143ed29313', '1', '0.00', '0', '0', '1', '774.00', '774', '774', '0', '1', '2026-10-03 20:22:28', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '18.25' ,'0','','','','','-1','0','0','0','0','0','774','0','','0','0','774','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=203
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','اضافة فاتورة مبيعات','203', '0', '2026-10-03 20:22:29', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '774', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:22:28','0','0','',''); -- id=341
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('223','00162', '203', '22', '162', '1', '250', '250', '0', '', '1', '2026-10-03 20:22:29', '162', '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=1748
UPDATE sellbilldetail SET  lastbuyprice = 223.00 , meanbuyprice = 223.00, lastbuyprice_withDiscount = 223.00, meanbuyprice_withDiscount = 223.00
        , lastbuyprice_withTax = 223, meanbuyprice_withTax = 223, lastbuyprice_withDiscountAndTax = 223
                where sellbilldetailid = 1748;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (162, '2026-10-03', 250, 223, 223
                    , 223, 223, 223, 223
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 223, 223, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+223
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+223, sellCostMeanBuyPrice = sellCostMeanBuyPrice+223
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+223, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+223
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+223
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+223
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+223
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 250, 223, 223
                    , 223, 223, 223, 223
                    , 0, 0, 0, 0
                    , 0, 0, 0, 223, 223, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+223
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+223, sellCostMeanBuyPrice = sellCostMeanBuyPrice+223
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+223, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+223
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+223
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+223
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+223
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2026-10-03 20:22:29' WHERE storedetailid = '162';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '14', '1', '2026-10-03 20:22:29','0','0'); -- id=3361
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '203', '6', '207', '1', '15', '15', '0', '', '1', '2026-10-03 20:22:29', '207', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0'); -- id=1749
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 = 1749;
 INSERT INTO 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-03', 15, 11, 11
                    , 11, 11, 11, 11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 11, 11, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+11
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 15, 11, 11
                    , 11, 11, 11, 11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11, 11, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+11
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '115', userid = '1', storedetaildate = '2026-10-03 20:22:30' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '116', '115', '1', '2026-10-03 20:22:30','0','0'); -- id=3362
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '203', '14', '80', '.25', '95', '23.75', '0', '', '1', '2026-10-03 20:22:30', '80', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','23.75','0','','0','0.00','0','0','0','0'); -- id=1750
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 = 1750;
 INSERT INTO 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-03', 23.75, 20.5, 20.5
                    , 20.5, 20.5, 20.5, 20.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 20.5, 20.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23.75, sellCostBuyPrice =sellCostBuyPrice+20.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20.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+0.25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 23.75, 20.5, 20.5
                    , 20.5, 20.5, 20.5, 20.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20.5, 20.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23.75, sellCostBuyPrice =sellCostBuyPrice+20.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6.9', userid = '1', storedetaildate = '2026-10-03 20:22:30' WHERE storedetailid = '80';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '0.25', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7.15', '6.9', '1', '2026-10-03 20:22:30','0','0'); -- id=3363
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 96;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00100', '203', '3', '100', '6', '17.75', '106.5', '0', '', '1', '2026-10-03 20:22:30', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','96-6,','1','1','0','0','17.75','106.5','0','','0','0.00','0','0','0','0'); -- id=1751
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1751;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-10-03', 106.5, 105.6, 105.6
                    , 105.6, 105.6, 105.6, 105.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 105.6, 105.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+106.5, sellCostBuyPrice =sellCostBuyPrice+105.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+105.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+105.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+105.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+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-03', 106.5, 105.6, 105.6
                    , 105.6, 105.6, 105.6, 105.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 105.6, 105.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+106.5, sellCostBuyPrice =sellCostBuyPrice+105.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+105.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+105.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+105.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 = '440', userid = '1', storedetaildate = '2026-10-03 20:22:30' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '6', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '446', '440', '1', '2026-10-03 20:22:30','0','0'); -- id=3364
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 97;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.6','00101', '203', '3', '101', '6', '17.75', '106.5', '0', '', '1', '2026-10-03 20:22:31', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','97-6,','1','1','0','0','17.75','106.5','0','','0','0.00','0','0','0','0'); -- id=1752
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 1752;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-10-03', 106.5, 105.6, 105.6
                    , 105.6, 105.6, 105.6, 105.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 105.6, 105.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+106.5, sellCostBuyPrice =sellCostBuyPrice+105.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+105.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+105.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+105.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+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-03', 106.5, 105.6, 105.6
                    , 105.6, 105.6, 105.6, 105.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 105.6, 105.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+106.5, sellCostBuyPrice =sellCostBuyPrice+105.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+105.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+105.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+105.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+105.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+105.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+105.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+105.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 = '482', userid = '1', storedetaildate = '2026-10-03 20:22:31' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '6', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '488', '482', '1', '2026-10-03 20:22:31','0','0'); -- id=3365
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 90;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('218','00464', '203', '3', '464', '1', '229.5', '229.5', '0', '', '1', '2026-10-03 20:22:31', '464', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','90-1,','1','1','0','0','229.5','229.5','0','','0','0.00','0','0','0','0'); -- id=1753
UPDATE sellbilldetail SET  lastbuyprice = 218.00 , meanbuyprice = 218.00, lastbuyprice_withDiscount = 218.00, meanbuyprice_withDiscount = 218.00
        , lastbuyprice_withTax = 218, meanbuyprice_withTax = 218, lastbuyprice_withDiscountAndTax = 218
                where sellbilldetailid = 1753;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (464, '2026-10-03', 229.5, 218, 218
                    , 218, 218, 218, 218
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 218, 218, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+229.5, sellCostBuyPrice =sellCostBuyPrice+218
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+218, sellCostMeanBuyPrice = sellCostMeanBuyPrice+218
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+218, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+218
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+218
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+218
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+218
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 229.5, 218, 218
                    , 218, 218, 218, 218
                    , 0, 0, 0, 0
                    , 0, 0, 0, 218, 218, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+229.5, sellCostBuyPrice =sellCostBuyPrice+218
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+218, sellCostMeanBuyPrice = sellCostMeanBuyPrice+218
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+218, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+218
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+218
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+218
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+218
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 20:22:31' WHERE storedetailid = '464';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('464', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '4', '1', '2026-10-03 20:22:31','0','0'); -- id=3366
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00104', '203', '3', '104', '1', '15.75', '15.75', '0', '', '1', '2026-10-03 20:22:31', '104', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15.75','15.75','0','','0','0.00','0','0','0','0'); -- id=1754
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 1754;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (104, '2026-10-03', 15.75, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15.75, sellCostBuyPrice =sellCostBuyPrice+15
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 15.75, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15.75, sellCostBuyPrice =sellCostBuyPrice+15
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '286', userid = '1', storedetaildate = '2026-10-03 20:22:32' WHERE storedetailid = '104';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('104', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '287', '286', '1', '2026-10-03 20:22:32','0','0'); -- id=3367
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.75','00102', '203', '3', '102', '1', '12', '12', '0', '', '1', '2026-10-03 20:22:32', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','12','12','0','','0','0.00','0','0','0','0'); -- id=1755
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 1755;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-10-03', 12, 11.75, 11.75
                    , 11.75, 11.75, 11.75, 11.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 11.75, 11.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12, sellCostBuyPrice =sellCostBuyPrice+11.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 12, 11.75, 11.75
                    , 11.75, 11.75, 11.75, 11.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11.75, 11.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12, sellCostBuyPrice =sellCostBuyPrice+11.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '960', userid = '1', storedetaildate = '2026-10-03 20:22:32' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '961', '960', '1', '2026-10-03 20:22:32','0','0'); -- id=3368
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 91;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('14','00206', '203', '6', '206', '1', '15', '15', '0', '', '1', '2026-10-03 20:22:32', '206', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','91-1,','1','1','0','0','15','15','0','','0','0.00','0','0','0','0'); -- id=1756
UPDATE sellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where sellbilldetailid = 1756;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (206, '2026-10-03', 15, 14, 14
                    , 14, 14, 14, 14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 14, 14, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+14
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 15, 14, 14
                    , 14, 14, 14, 14
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 14, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+14
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '1', storedetaildate = '2026-10-03 20:22:32' WHERE storedetailid = '206';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('206', '1', '1', '1', '203', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '47', '1', '2026-10-03 20:22:32','0','0'); -- id=3369
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-453231.03125',  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 ('-454005.03125','774', '0', '1', 'اضافة فاتورة مبيعات', '203', '-453231.03125', '2026-10-03 20:22:32', '1',  'sellbillController.php','1','','0'); -- id=201
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '774', '774', '2026-10-03', '1', '0', '0', '2026-10-03 20:22:33','اضافة فاتورة مبيعات رقم 203','1','0',null,'0','203','sellbillController.php?do=showDetail&sellbillid=203'); -- id=1248
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1248', '383', '774', '','0'); -- id=1251
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-271842', 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 ('1248', '143', '774', '','0'); -- id=1249
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '827014.24', 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 ( '724.45', '724.45', '2026-10-03', '1', '0', '0', '2026-10-03 20:22:33','اضافة فاتورة مبيعات رقم 203 - صرف البضاعة من المخزن','1','0',null,'0','203','sellbillController.php?do=showDetail&sellbillid=203'); -- id=1249
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1249', '402', '724.45', '','0'); -- id=1252
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '757522.26', 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 ('1249', '382', '724.45', '','0'); -- id=1250
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2548292.33', 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='1248,0,1249' where sellbillid=203;
 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-03', 774, 724.45, 724.45
                    , 724.45, 724.45, 724.45, 724.45
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,724.45, 724.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+774, sellCostBuyPrice =sellCostBuyPrice+724.45
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+724.45, sellCostMeanBuyPrice = sellCostMeanBuyPrice+724.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+724.45, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+724.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+724.45
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+724.45
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+724.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 774, 724.45, 724.45
                    , 724.45, 724.45, 724.45, 724.45
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,724.45, 724.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+774, sellCostBuyPrice =sellCostBuyPrice+724.45
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+724.45, sellCostMeanBuyPrice = sellCostMeanBuyPrice+724.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+724.45, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+724.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+724.45
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+724.45
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+724.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 774, 724.45, 724.45
                    , 724.45, 724.45, 724.45, 724.45, 724.45, 724.45)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+774, netSellCostBuyPrice = netSellCostBuyPrice+724.45
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+724.45
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+724.45
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+724.45
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+724.45
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+724.45
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+724.45
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+724.45;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac143ed29313 and sellbillId = 203 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 16:52:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:22:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:22:34', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:01:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:31:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 20:31:32', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=3335
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:01:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:31:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-03 20:31:54', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3336
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2026-10-03' WHERE storedetailid = '376';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('376', '1', '30', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '8', '38', '1', '2026-10-03','0','0'); -- id=3370
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5730', '5730', '2026-10-03', '1', '0', '0', '2026-10-03 20:31:55','اعادة جرد للمنتج : (وش وتربروف ابيض /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 38','1','0',null,'0','3370','inventoryController.php?do=details&id=3370'); -- id=1250
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1250', '382', '5730', '','0'); -- id=1253
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2554022.33', 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 ('1250', '188', '5730', '','0'); -- id=1251
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-54976.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:07:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:37:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:37:03', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3337

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac142b602329
-- ----------------------------------------------------------------------------------------------------

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-03 20:37:03', '06ac142b602329', '1', '0.00', '0', '20', '2', '44580.10', '35664.08', '35664.08', '0', '1', '2026-10-03 20:37:03', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '928' ,'0','','','','','-1','0','0','0','0','0','35664','0','','0','0','35664.08','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=204
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','اضافة فاتورة مبيعات','204', '0', '2026-10-03 20:37:04', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '35664.08', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:37:03','0','0','',''); -- id=342
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+180 where id = 120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('44.33','00041', '204', '1', '41', '180', '56.78', '10220.4', '0', '', '1', '2026-10-03 20:37:04', '41', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','120-180,','1','1','0','0','56.78','10220.4','0','','0','0.00','0','0','0','0'); -- id=1757
UPDATE sellbilldetail SET  lastbuyprice = 44.33 , meanbuyprice = 44.33, lastbuyprice_withDiscount = 44.33, meanbuyprice_withDiscount = 44.33
        , lastbuyprice_withTax = 44.33, meanbuyprice_withTax = 44.33, lastbuyprice_withDiscountAndTax = 44.33
                where sellbilldetailid = 1757;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-03', 8176.32, 7979.4, 7979.4
                    , 7979.4, 7979.4, 7979.4, 7979.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 0, 7979.4, 7979.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8176.32, sellCostBuyPrice =sellCostBuyPrice+7979.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7979.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7979.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7979.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7979.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7979.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7979.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7979.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+180
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 8176.32, 7979.4, 7979.4
                    , 7979.4, 7979.4, 7979.4, 7979.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7979.4, 7979.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8176.32, sellCostBuyPrice =sellCostBuyPrice+7979.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7979.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7979.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7979.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7979.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7979.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7979.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7979.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 = '745', userid = '1', storedetaildate = '2026-10-03 20:37:04' WHERE storedetailid = '41';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('41', '1', '180', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '925', '745', '1', '2026-10-03 20:37:04','0','0'); -- id=3371
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+180 where id = 121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00042', '204', '1', '42', '180', '37.87', '6816.599999999999', '0', '', '1', '2026-10-03 20:37:05', '42', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','121-180,','1','1','0','0','37.87','6816.6','0','','0','0.00','0','0','0','0'); -- id=1758
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1758;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (42, '2026-10-03', 5453.28, 5310, 5310
                    , 5310, 5310, 5310, 5310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 0, 5310, 5310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5453.28, sellCostBuyPrice =sellCostBuyPrice+5310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+180
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 5453.28, 5310, 5310
                    , 5310, 5310, 5310, 5310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5310, 5310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5453.28, sellCostBuyPrice =sellCostBuyPrice+5310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '972', userid = '1', storedetaildate = '2026-10-03 20:37:05' WHERE storedetailid = '42';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('42', '1', '180', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1152', '972', '1', '2026-10-03 20:37:05','0','0'); -- id=3372
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+150 where id = 127;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00043', '204', '1', '43', '150', '37.87', '5680.5', '0', '', '1', '2026-10-03 20:37:05', '43', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','127-150,','1','1','0','0','37.87','5680.5','0','','0','0.00','0','0','0','0'); -- id=1759
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1759;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (43, '2026-10-03', 4544.4, 4425, 4425
                    , 4425, 4425, 4425, 4425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 0, 4425, 4425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4544.4, sellCostBuyPrice =sellCostBuyPrice+4425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+150
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 4544.4, 4425, 4425
                    , 4425, 4425, 4425, 4425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4425, 4425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4544.4, sellCostBuyPrice =sellCostBuyPrice+4425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '911', userid = '1', storedetaildate = '2026-10-03 20:37:05' WHERE storedetailid = '43';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('43', '1', '150', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1061', '911', '1', '2026-10-03 20:37:05','0','0'); -- id=3373
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('191','00376', '204', '1', '376', '16', '242.44', '3879.04', '0', '', '1', '2026-10-03 20:37:05', '376', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','242.44','3879.04','0','','0','0.00','0','0','0','0'); -- id=1760
UPDATE sellbilldetail SET  lastbuyprice = 191.00 , meanbuyprice = 191.00, lastbuyprice_withDiscount = 191.00, meanbuyprice_withDiscount = 191.00
        , lastbuyprice_withTax = 191, meanbuyprice_withTax = 191, lastbuyprice_withDiscountAndTax = 191
                where sellbilldetailid = 1760;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (376, '2026-10-03', 3103.232, 3056, 3056
                    , 3056, 3056, 3056, 3056
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 3056, 3056, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3103.232, sellCostBuyPrice =sellCostBuyPrice+3056
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3056, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3056
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3056, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3056
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3056
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3056
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3056
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 3103.232, 3056, 3056
                    , 3056, 3056, 3056, 3056
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3056, 3056, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3103.232, sellCostBuyPrice =sellCostBuyPrice+3056
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3056, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3056
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3056, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3056
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3056
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3056
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3056
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2026-10-03 20:37:06' WHERE storedetailid = '376';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('376', '1', '16', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '38', '22', '1', '2026-10-03 20:37:06','0','0'); -- id=3374
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 123;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('137.25','00050', '204', '1', '50', '10', '175.83', '1758.3000000000002', '0', '', '1', '2026-10-03 20:37:06', '50', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','123-10,','1','1','0','0','175.83','1758.3','0','','0','0.00','0','0','0','0'); -- id=1761
UPDATE sellbilldetail SET  lastbuyprice = 137.25 , meanbuyprice = 137.25, lastbuyprice_withDiscount = 137.25, meanbuyprice_withDiscount = 137.25
        , lastbuyprice_withTax = 137.25, meanbuyprice_withTax = 137.25, lastbuyprice_withDiscountAndTax = 137.25
                where sellbilldetailid = 1761;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (50, '2026-10-03', 1406.64, 1372.5, 1372.5
                    , 1372.5, 1372.5, 1372.5, 1372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 1372.5, 1372.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1406.64, sellCostBuyPrice =sellCostBuyPrice+1372.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1372.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1372.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1372.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1372.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1372.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1372.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+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-03', 1406.64, 1372.5, 1372.5
                    , 1372.5, 1372.5, 1372.5, 1372.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1372.5, 1372.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1406.64, sellCostBuyPrice =sellCostBuyPrice+1372.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1372.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1372.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1372.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1372.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1372.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1372.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1372.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 = '121', userid = '1', storedetaildate = '2026-10-03 20:37:06' WHERE storedetailid = '50';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('50', '1', '10', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '131', '121', '1', '2026-10-03 20:37:06','0','0'); -- id=3375
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 129;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('52.79','00048', '204', '1', '48', '6', '67.63', '405.78', '0', '', '1', '2026-10-03 20:37:06', '48', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','129-6,','1','1','0','0','67.63','405.78','0','','0','0.00','0','0','0','0'); -- id=1762
UPDATE sellbilldetail SET  lastbuyprice = 52.79 , meanbuyprice = 52.79, lastbuyprice_withDiscount = 52.79, meanbuyprice_withDiscount = 52.79
        , lastbuyprice_withTax = 52.79, meanbuyprice_withTax = 52.79, lastbuyprice_withDiscountAndTax = 52.79
                where sellbilldetailid = 1762;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (48, '2026-10-03', 324.624, 316.74, 316.74
                    , 316.74, 316.74, 316.74, 316.74
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 316.74, 316.74, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+324.624, sellCostBuyPrice =sellCostBuyPrice+316.74
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+316.74, sellCostMeanBuyPrice = sellCostMeanBuyPrice+316.74
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+316.74, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+316.74
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+316.74
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+316.74
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+316.74
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 324.624, 316.74, 316.74
                    , 316.74, 316.74, 316.74, 316.74
                    , 0, 0, 0, 0
                    , 0, 0, 0, 316.74, 316.74, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+324.624, sellCostBuyPrice =sellCostBuyPrice+316.74
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+316.74, sellCostMeanBuyPrice = sellCostMeanBuyPrice+316.74
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+316.74, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+316.74
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+316.74
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+316.74
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+316.74
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '185', userid = '1', storedetaildate = '2026-10-03 20:37:06' WHERE storedetailid = '48';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('48', '1', '6', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '191', '185', '1', '2026-10-03 20:37:06','0','0'); -- id=3376
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 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', '204', '1', '314', '6', '324.61', '1947.66', '0', '', '1', '2026-10-03 20:37:06', '314', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','130-6,','1','1','0','0','324.61','1947.66','0','','0','0.00','0','0','0','0'); -- id=1763
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 = 1763;
 INSERT INTO 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-03', 1558.128, 1524, 1524
                    , 1524, 1524, 1524, 1524
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1524, 1524, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1558.128, sellCostBuyPrice =sellCostBuyPrice+1524
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1524, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1524
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1524, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1524
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1524
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1524
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1524
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1558.128, 1524, 1524
                    , 1524, 1524, 1524, 1524
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1524, 1524, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1558.128, sellCostBuyPrice =sellCostBuyPrice+1524
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1524, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1524
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1524, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1524
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1524
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1524
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1524
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-03 20:37:07' WHERE storedetailid = '314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('314', '1', '6', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '1', '2026-10-03 20:37:07','0','0'); -- id=3377
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 122;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('50.67','00053', '204', '1', '53', '12', '64.92', '779.04', '0', '', '1', '2026-10-03 20:37:07', '53', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','122-12,','1','1','0','0','64.92','779.04','0','','0','0.00','0','0','0','0'); -- id=1764
UPDATE sellbilldetail SET  lastbuyprice = 50.67 , meanbuyprice = 50.67, lastbuyprice_withDiscount = 50.67, meanbuyprice_withDiscount = 50.67
        , lastbuyprice_withTax = 50.67, meanbuyprice_withTax = 50.67, lastbuyprice_withDiscountAndTax = 50.67
                where sellbilldetailid = 1764;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (53, '2026-10-03', 623.232, 608.04, 608.04
                    , 608.04, 608.04, 608.04, 608.04
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 608.04, 608.04, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+623.232, sellCostBuyPrice =sellCostBuyPrice+608.04
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+608.04, sellCostMeanBuyPrice = sellCostMeanBuyPrice+608.04
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+608.04, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+608.04
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+608.04
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+608.04
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+608.04
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 623.232, 608.04, 608.04
                    , 608.04, 608.04, 608.04, 608.04
                    , 0, 0, 0, 0
                    , 0, 0, 0, 608.04, 608.04, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+623.232, sellCostBuyPrice =sellCostBuyPrice+608.04
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+608.04, sellCostMeanBuyPrice = sellCostMeanBuyPrice+608.04
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+608.04, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+608.04
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+608.04
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+608.04
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+608.04
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '125', userid = '1', storedetaildate = '2026-10-03 20:37:07' WHERE storedetailid = '53';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('53', '1', '12', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '137', '125', '1', '2026-10-03 20:37:07','0','0'); -- id=3378
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100.3','00049', '204', '1', '49', '4', '128.49', '513.96', '0', '', '1', '2026-10-03 20:37:07', '49', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','128.49','513.96','0','','0','0.00','0','0','0','0'); -- id=1765
UPDATE sellbilldetail SET  lastbuyprice = 100.30 , meanbuyprice = 100.30, lastbuyprice_withDiscount = 100.30, meanbuyprice_withDiscount = 100.30
        , lastbuyprice_withTax = 100.3, meanbuyprice_withTax = 100.3, lastbuyprice_withDiscountAndTax = 100.3
                where sellbilldetailid = 1765;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (49, '2026-10-03', 411.168, 401.2, 401.2
                    , 401.2, 401.2, 401.2, 401.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 401.2, 401.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+411.168, sellCostBuyPrice =sellCostBuyPrice+401.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+401.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+401.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+401.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+401.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+401.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+401.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+401.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+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-03', 411.168, 401.2, 401.2
                    , 401.2, 401.2, 401.2, 401.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 401.2, 401.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+411.168, sellCostBuyPrice =sellCostBuyPrice+401.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+401.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+401.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+401.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+401.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+401.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+401.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+401.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 = '-4', userid = '1', storedetaildate = '2026-10-03 20:37:07' WHERE storedetailid = '49';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('49', '1', '4', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-4', '1', '2026-10-03 20:37:07','0','0'); -- id=3379
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 124;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00046', '204', '1', '46', '20', '114.97', '2299.4', '0', '', '1', '2026-10-03 20:37:07', '46', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','124-20,','1','1','0','0','114.97','2299.4','0','','0','0.00','0','0','0','0'); -- id=1766
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1766;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (46, '2026-10-03', 1839.52, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1839.52, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1839.52, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1839.52, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '155', userid = '1', storedetaildate = '2026-10-03 20:37:08' WHERE storedetailid = '46';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('46', '1', '20', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '175', '155', '1', '2026-10-03 20:37:08','0','0'); -- id=3380
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 125;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00047', '204', '1', '47', '20', '114.97', '2299.4', '0', '', '1', '2026-10-03 20:37:08', '47', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','125-20,','1','1','0','0','114.97','2299.4','0','','0','0.00','0','0','0','0'); -- id=1767
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1767;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (47, '2026-10-03', 1839.52, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1839.52, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1839.52, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1839.52, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '164', userid = '1', storedetaildate = '2026-10-03 20:37:08' WHERE storedetailid = '47';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('47', '1', '20', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '184', '164', '1', '2026-10-03 20:37:08','0','0'); -- id=3381
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 126;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('36.95','00051', '204', '1', '51', '10', '47.34', '473.40000000000003', '0', '', '1', '2026-10-03 20:37:08', '51', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','126-10,','1','1','0','0','47.34','473.4','0','','0','0.00','0','0','0','0'); -- id=1768
UPDATE sellbilldetail SET  lastbuyprice = 36.95 , meanbuyprice = 36.95, lastbuyprice_withDiscount = 36.95, meanbuyprice_withDiscount = 36.95
        , lastbuyprice_withTax = 36.95, meanbuyprice_withTax = 36.95, lastbuyprice_withDiscountAndTax = 36.95
                where sellbilldetailid = 1768;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (51, '2026-10-03', 378.72, 369.5, 369.5
                    , 369.5, 369.5, 369.5, 369.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 369.5, 369.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+378.72, sellCostBuyPrice =sellCostBuyPrice+369.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+369.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+369.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+369.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+369.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+369.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+369.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+369.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+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-03', 378.72, 369.5, 369.5
                    , 369.5, 369.5, 369.5, 369.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 369.5, 369.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+378.72, sellCostBuyPrice =sellCostBuyPrice+369.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+369.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+369.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+369.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+369.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+369.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+369.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+369.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 = '156', userid = '1', storedetaildate = '2026-10-03 20:37:08' WHERE storedetailid = '51';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('51', '1', '10', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '166', '156', '1', '2026-10-03 20:37:08','0','0'); -- id=3382
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+300 where id = 128;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.44','00044', '204', '1', '44', '300', '10.82', '3246', '0', '', '1', '2026-10-03 20:37:08', '44', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','128-300,','1','1','0','0','10.82','3246','0','','0','0.00','0','0','0','0'); -- id=1769
UPDATE sellbilldetail SET  lastbuyprice = 8.44 , meanbuyprice = 8.44, lastbuyprice_withDiscount = 8.44, meanbuyprice_withDiscount = 8.44
        , lastbuyprice_withTax = 8.44, meanbuyprice_withTax = 8.44, lastbuyprice_withDiscountAndTax = 8.44
                where sellbilldetailid = 1769;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (44, '2026-10-03', 2596.8, 2532, 2532
                    , 2532, 2532, 2532, 2532
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 0, 2532, 2532, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2596.8, sellCostBuyPrice =sellCostBuyPrice+2532
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2532, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2532
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2532, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2532
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2532
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2532
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2532
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+300
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2596.8, 2532, 2532
                    , 2532, 2532, 2532, 2532
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2532, 2532, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2596.8, sellCostBuyPrice =sellCostBuyPrice+2532
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2532, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2532
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2532, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2532
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2532
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2532
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2532
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1950', userid = '1', storedetaildate = '2026-10-03 20:37:09' WHERE storedetailid = '44';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('44', '1', '300', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2250', '1950', '1', '2026-10-03 20:37:09','0','0'); -- id=3383
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+14 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237.5','00045', '204', '1', '45', '14', '304.33', '4260.62', '0', '', '1', '2026-10-03 20:37:09', '45', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','131-14,','1','1','0','0','304.33','4260.62','0','','0','0.00','0','0','0','0'); -- id=1770
UPDATE sellbilldetail SET  lastbuyprice = 237.50 , meanbuyprice = 237.50, lastbuyprice_withDiscount = 237.50, meanbuyprice_withDiscount = 237.50
        , lastbuyprice_withTax = 237.5, meanbuyprice_withTax = 237.5, lastbuyprice_withDiscountAndTax = 237.5
                where sellbilldetailid = 1770;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (45, '2026-10-03', 3408.496, 3325, 3325
                    , 3325, 3325, 3325, 3325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 0, 3325, 3325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3408.496, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3325
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+14
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 3408.496, 3325, 3325
                    , 3325, 3325, 3325, 3325
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3325, 3325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3408.496, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3325
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '76', userid = '1', storedetaildate = '2026-10-03 20:37:09' WHERE storedetailid = '45';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('45', '1', '14', '1', '204', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '76', '1', '2026-10-03 20:37:09','0','0'); -- id=3384
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-417566.95125',  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 ('-453231.03125','35664.08', '0', '1', 'اضافة فاتورة مبيعات', '204', '-417566.95125', '2026-10-03 20:37:09', '1',  'sellbillController.php','1','','0'); -- id=202
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '44580.1', '44580.1', '2026-10-03', '1', '0', '0', '2026-10-03 20:37:09','اضافة فاتورة مبيعات رقم 204','1','0',null,'0','204','sellbillController.php?do=showDetail&sellbillid=204'); -- id=1251
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1251', '383', '35664.08', '','0'); -- id=1254
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-236177.92', 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 ('1251', '398', '8916.02', '','0'); -- id=1255
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '18706.56', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1251', '143', '44580.1', '','0'); -- id=1252
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '871594.34', 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 ( '34807.38', '34807.38', '2026-10-03', '1', '0', '0', '2026-10-03 20:37:09','اضافة فاتورة مبيعات رقم 204 - صرف البضاعة من المخزن','1','0',null,'0','204','sellbillController.php?do=showDetail&sellbillid=204'); -- id=1252
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1252', '402', '34807.38', '','0'); -- id=1256
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '792329.64', 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 ('1252', '382', '34807.38', '','0'); -- id=1253
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2519214.95', 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='1251,0,1252' where sellbillid=204;
 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-03', 35664.08, 34807.38, 34807.38
                    , 34807.38, 34807.38, 34807.38, 34807.38
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,34807.38, 34807.38, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35664.08, sellCostBuyPrice =sellCostBuyPrice+34807.38
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34807.38, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34807.38
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34807.38, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34807.38
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34807.38
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34807.38
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34807.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;
 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-03', 35664.08, 34807.38, 34807.38
                    , 34807.38, 34807.38, 34807.38, 34807.38
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,34807.38, 34807.38, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35664.08, sellCostBuyPrice =sellCostBuyPrice+34807.38
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34807.38, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34807.38
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34807.38, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34807.38
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34807.38
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34807.38
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34807.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 35664.08, 34807.38, 34807.38
                    , 34807.38, 34807.38, 34807.38, 34807.38, 34807.38, 34807.38)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+35664.08, netSellCostBuyPrice = netSellCostBuyPrice+34807.38
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+34807.38
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+34807.38
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+34807.38
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+34807.38
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+34807.38
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+34807.38
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+34807.38;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac142b602329 and sellbillId = 204 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:07:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:37:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:37:11', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3338
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:14:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:44:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:44:05', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3339

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac14b5877f4a
-- ----------------------------------------------------------------------------------------------------

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-03 20:44:05', '06ac14b5877f4a', '1', '0.00', '0', '23', '2', '23845.44', '18360.99', '18360.99', '0', '1', '2026-10-03 20:44:05', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '516' ,'0','','','','','-1','0','0','0','0','0','18360','0','','0','0','18360.99','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=205
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','اضافة فاتورة مبيعات','205', '0', '2026-10-03 20:44:06', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '18360.99', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:44:05','0','0','',''); -- id=343
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+100 where id = 120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('44.33','00041', '205', '1', '41', '100', '56.78', '5678', '0', '', '1', '2026-10-03 20:44:06', '41', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','120-100,','1','1','0','0','56.78','5678','0','','0','0.00','0','0','0','0'); -- id=1771
UPDATE sellbilldetail SET  lastbuyprice = 44.33 , meanbuyprice = 44.33, lastbuyprice_withDiscount = 44.33, meanbuyprice_withDiscount = 44.33
        , lastbuyprice_withTax = 44.33, meanbuyprice_withTax = 44.33, lastbuyprice_withDiscountAndTax = 44.33
                where sellbilldetailid = 1771;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4372.0602857402, sellCostBuyPrice =sellCostBuyPrice+4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4433
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+100
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4372.0602857402, sellCostBuyPrice =sellCostBuyPrice+4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4433
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '645', userid = '1', storedetaildate = '2026-10-03 20:44:06' WHERE storedetailid = '41';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('41', '1', '100', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '745', '645', '1', '2026-10-03 20:44:06','0','0'); -- id=3385
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+72 where id = 121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00042', '205', '1', '42', '72', '37.87', '2726.64', '0', '', '1', '2026-10-03 20:44:07', '42', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','121-72,','1','1','0','0','37.87','2726.64','0','','0','0.00','0','0','0','0'); -- id=1772
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1772;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (42, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+72
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '900', userid = '1', storedetaildate = '2026-10-03 20:44:07' WHERE storedetailid = '42';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('42', '1', '72', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '972', '900', '1', '2026-10-03 20:44:07','0','0'); -- id=3386
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+72 where id = 127;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00043', '205', '1', '43', '72', '37.87', '2726.64', '0', '', '1', '2026-10-03 20:44:07', '43', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','127-72,','1','1','0','0','37.87','2726.64','0','','0','0.00','0','0','0','0'); -- id=1773
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1773;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (43, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+72
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '839', userid = '1', storedetaildate = '2026-10-03 20:44:07' WHERE storedetailid = '43';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('43', '1', '72', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '911', '839', '1', '2026-10-03 20:44:07','0','0'); -- id=3387
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+200 where id = 128;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.44','00044', '205', '1', '44', '200', '10.82', '2164', '0', '', '1', '2026-10-03 20:44:07', '44', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','128-200,','1','1','0','0','10.82','2164','0','','0','0.00','0','0','0','0'); -- id=1774
UPDATE sellbilldetail SET  lastbuyprice = 8.44 , meanbuyprice = 8.44, lastbuyprice_withDiscount = 8.44, meanbuyprice_withDiscount = 8.44
        , lastbuyprice_withTax = 8.44, meanbuyprice_withTax = 8.44, lastbuyprice_withDiscountAndTax = 8.44
                where sellbilldetailid = 1774;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (44, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1666.2801089013, sellCostBuyPrice =sellCostBuyPrice+1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1688
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+200
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1666.2801089013, sellCostBuyPrice =sellCostBuyPrice+1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1688
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1750', userid = '1', storedetaildate = '2026-10-03 20:44:08' WHERE storedetailid = '44';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('44', '1', '200', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1950', '1750', '1', '2026-10-03 20:44:08','0','0'); -- id=3388
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237.5','00045', '205', '1', '45', '12', '304.33', '3651.96', '0', '', '1', '2026-10-03 20:44:08', '45', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','131-12,','1','1','0','0','304.33','3651.96','0','','0','0.00','0','0','0','0'); -- id=1775
UPDATE sellbilldetail SET  lastbuyprice = 237.50 , meanbuyprice = 237.50, lastbuyprice_withDiscount = 237.50, meanbuyprice_withDiscount = 237.50
        , lastbuyprice_withTax = 237.5, meanbuyprice_withTax = 237.5, lastbuyprice_withDiscountAndTax = 237.5
                where sellbilldetailid = 1775;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (45, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2812.0093837816, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2812.0093837816, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-10-03 20:44:08' WHERE storedetailid = '45';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('45', '1', '12', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '76', '64', '1', '2026-10-03 20:44:08','0','0'); -- id=3389
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 125;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00047', '205', '1', '47', '20', '114.97', '2299.4', '0', '', '1', '2026-10-03 20:44:08', '47', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','125-20,','1','1','0','0','114.97','2299.4','0','','0','0.00','0','0','0','0'); -- id=1776
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1776;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (47, '2026-10-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770.5381157152, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770.5381157152, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '144', userid = '1', storedetaildate = '2026-10-03 20:44:08' WHERE storedetailid = '47';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('47', '1', '20', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '164', '144', '1', '2026-10-03 20:44:08','0','0'); -- id=3390
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 124;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00046', '205', '1', '46', '40', '114.97', '4598.8', '0', '', '1', '2026-10-03 20:44:08', '46', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','124-40,','1','1','0','0','114.97','4598.8','0','','0','0.00','0','0','0','0'); -- id=1777
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1777;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (46, '2026-10-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3541.0762314304, sellCostBuyPrice =sellCostBuyPrice+3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3541.0762314304, sellCostBuyPrice =sellCostBuyPrice+3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '115', userid = '1', storedetaildate = '2026-10-03 20:44:09' WHERE storedetailid = '46';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('46', '1', '40', '1', '205', 'اضافة فاتورة مبيعات', 'sellbillController.php', '155', '115', '1', '2026-10-03 20:44:09','0','0'); -- id=3391
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-399205.9475',  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 ('-417566.9375','18360.99', '0', '1', 'اضافة فاتورة مبيعات', '205', '-399205.9475', '2026-10-03 20:44:09', '1',  'sellbillController.php','1','','0'); -- id=203
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23845.44', '23845.44', '2026-10-03', '1', '0', '0', '2026-10-03 20:44:09','اضافة فاتورة مبيعات رقم 205','1','0',null,'0','205','sellbillController.php?do=showDetail&sellbillid=205'); -- id=1253
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1253', '383', '18360.99', '','0'); -- id=1257
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-217816.93', 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 ('1253', '398', '5484.45', '','0'); -- id=1258
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '24191.01', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1253', '143', '23845.44', '','0'); -- id=1254
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '895439.78', 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 ( '18601', '18601', '2026-10-03', '1', '0', '0', '2026-10-03 20:44:09','اضافة فاتورة مبيعات رقم 205 - صرف البضاعة من المخزن','1','0',null,'0','205','sellbillController.php?do=showDetail&sellbillid=205'); -- id=1254
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1254', '402', '18601', '','0'); -- id=1259
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '810930.64', 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 ('1254', '382', '18601', '','0'); -- id=1255
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2500613.95', 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='1253,0,1254' where sellbillid=205;
 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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18360.99, sellCostBuyPrice =sellCostBuyPrice+18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18360.99, sellCostBuyPrice =sellCostBuyPrice+18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601, 18601, 18601)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+18360.99, netSellCostBuyPrice = netSellCostBuyPrice+18601
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18601
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18601
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+18601
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+18601
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+18601
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18601
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18601;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac14b5877f4a and sellbillId = 205 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:14:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:44:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 20:44:11', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:27:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:57:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-03 20:57:57', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=3341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:28:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:58:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-03 20:58:06', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=3342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:28:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:58:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 20:58:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3343
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:28:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:58:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 20:58:48', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3344

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =344
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(25,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-10-03 20:58:48', userid = '1' WHERE clientid = '25';
UPDATE client SET  inUse = 0 where clientid = 25;
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 ('25','1815.00','1815','1','ايصال تحصيل (( قبض من عميل ))','344', '0', '2026-10-03 20:58:35', '1', 'clientPayedDeptController.php', '   ', '1815', '0', null, '0', null, null,'', '-1','1','1','1815','1','','27','0','','.'); -- id=344
UPDATE save SET  savecurrentvalue = '-397390.95',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-399205.95','1815', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '344', '-397390.95', '2026-10-03 20:58:48', '1',  'clientPayedDeptController.php','25','','0'); -- id=204
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1815', '1815', '2026-10-03', '1', '0', '0', '2026-10-03 20:58:48','اضافة ايصال سداد للعميل ناصر خليل ','1','0','0','0','344','clientPayedDeptController.php?do=show&id=344'); -- id=1255
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1255', '383', '1815', '','0'); -- id=1260
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-216001.93', 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 ('1255', '454', '1815', '','0'); -- id=1256
UPDATE accountstree SET name = 'ناصر خليل ', customName = 'ناصر خليل ', customNameEn = 'ناصر خليل ', nameEn = 'ناصر خليل ', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:40:32' WHERE id = '454';
UPDATE clientdebtchange SET clientid = '25', clientdebtchangebefore = '1815.000', clientdebtchangeamount = '1815.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '344', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-10-03 20:58:35', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1815.000',discount='', reciptid='0', dailyentryid = '1255',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1815',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '344';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:28:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:58:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 20:58:49', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 17:28:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 20:58:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-03 20:58:51', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:30:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:00:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-03 22:00:24', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=3347
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:30:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:00:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-03 22:00:29', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=3348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:30:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:00:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:00:33', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=199'); -- id=3349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:32:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:02:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-03 22:02:15', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=3350
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:32:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:02:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:02:37', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=3351
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:32:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:02:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:02:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=3352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:32:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:02:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:02:47', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=205'); -- id=3353
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:32:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:02:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:02:57', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=3354
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 205;
UPDATE sellbill SET  sellbillsysdate = '2026-10-03 22:02:58', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '205';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-100 where id = 120;
UPDATE sellbilldetail SET  lastbuyprice = 44.33 , meanbuyprice = 44.33, lastbuyprice_withDiscount = 44.33, meanbuyprice_withDiscount = 44.33
        , lastbuyprice_withTax = 44.33, meanbuyprice_withTax = 44.33, lastbuyprice_withDiscountAndTax = 44.33
                where sellbilldetailid = 1771;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0,100,0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4372.0602857402, sellCostBuyPrice =sellCostBuyPrice-4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4433
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-100
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4372.0602857402, sellCostBuyPrice =sellCostBuyPrice-4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4433
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '745', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '41';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('41', '1', '100', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '645', '745', '1', '2026-10-03 20:44:05','0','0'); -- id=3392
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-72 where id = 121;
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1772;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (42, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0,72,0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2099.5129372157, sellCostBuyPrice =sellCostBuyPrice-2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2124
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-72
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2099.5129372157, sellCostBuyPrice =sellCostBuyPrice-2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2124
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '972', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '42';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('42', '1', '72', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '900', '972', '1', '2026-10-03 20:44:05','0','0'); -- id=3393
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-72 where id = 127;
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1773;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (43, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0,72,0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2099.5129372157, sellCostBuyPrice =sellCostBuyPrice-2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2124
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-72
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2099.5129372157, sellCostBuyPrice =sellCostBuyPrice-2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2124
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '911', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '43';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('43', '1', '72', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '839', '911', '1', '2026-10-03 20:44:05','0','0'); -- id=3394
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-200 where id = 128;
UPDATE sellbilldetail SET  lastbuyprice = 8.44 , meanbuyprice = 8.44, lastbuyprice_withDiscount = 8.44, meanbuyprice_withDiscount = 8.44
        , lastbuyprice_withTax = 8.44, meanbuyprice_withTax = 8.44, lastbuyprice_withDiscountAndTax = 8.44
                where sellbilldetailid = 1774;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (44, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0,200,0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1666.2801089013, sellCostBuyPrice =sellCostBuyPrice-1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1688
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-200
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1666.2801089013, sellCostBuyPrice =sellCostBuyPrice-1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1688
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1950', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '44';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('44', '1', '200', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1750', '1950', '1', '2026-10-03 20:44:05','0','0'); -- id=3395
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 131;
UPDATE sellbilldetail SET  lastbuyprice = 237.50 , meanbuyprice = 237.50, lastbuyprice_withDiscount = 237.50, meanbuyprice_withDiscount = 237.50
        , lastbuyprice_withTax = 237.5, meanbuyprice_withTax = 237.5, lastbuyprice_withDiscountAndTax = 237.5
                where sellbilldetailid = 1775;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (45, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2812.0093837816, sellCostBuyPrice =sellCostBuyPrice-2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2850
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2812.0093837816, sellCostBuyPrice =sellCostBuyPrice-2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2850
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '76', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '45';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('45', '1', '12', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '64', '76', '1', '2026-10-03 20:44:05','0','0'); -- id=3396
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 125;
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1776;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (47, '2026-10-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770.5381157152, sellCostBuyPrice =sellCostBuyPrice-1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1794
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770.5381157152, sellCostBuyPrice =sellCostBuyPrice-1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1794
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '164', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '47';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('47', '1', '20', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '144', '164', '1', '2026-10-03 20:44:05','0','0'); -- id=3397
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-40 where id = 124;
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1777;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (46, '2026-10-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0,40,0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3541.0762314304, sellCostBuyPrice =sellCostBuyPrice-3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3588
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3541.0762314304, sellCostBuyPrice =sellCostBuyPrice-3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3588
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '155', userid = '1', storedetaildate = '2026-10-03 22:02:58' WHERE storedetailid = '46';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('46', '1', '40', '0', '205', 'تعديل فاتورة مبيعات', 'sellbillController.php', '115', '155', '1', '2026-10-03 20:44:05','0','0'); -- id=3398
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','تعديل فاتورة مبيعات','205', '0', '2026-10-03 20:44:05', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '18360.99', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:44:05','0','0','',''); -- id=345
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-415751.9275',  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 ('-397390.9375','18360.99', '1', '1', 'تعديل فاتورة مبيعات', '205', '-415751.9275', '2026-10-03 22:02:59', '1',  'sellbillController.php','1','','0'); -- id=205
 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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-18360.99, sellCostBuyPrice =sellCostBuyPrice-18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18601
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-18360.99, sellCostBuyPrice =sellCostBuyPrice-18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18601
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601, 18601, 18601)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-18360.99, netSellCostBuyPrice = netSellCostBuyPrice-18601
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-18601
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-18601
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-18601
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-18601
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-18601
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-18601
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-18601;

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


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

COMMIT;
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,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-03 20:44:05', '06ac14b5877f4a', '1', '0.00', '0', '23', '2', '23845.44', '18360.99', '18360.99', '0', '1', '2026-10-03 20:44:05', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '516', '205', 'sellbillController', '0','','','','','-1','0','0','18360.99','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-03','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=206
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','اضافة فاتورة مبيعات (معدله)','206', '0', '2026-10-03 22:02:59', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '18360.99', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 20:44:05','0','0','',''); -- id=346
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+100 where id = 120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('44.33','00041', '206', '1', '41', '100.00', '56.78', '5678', '0', '', '1', '2026-10-03 22:03:00', '41', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','120-100,','1','1','0','0','56.78','5678','0','','0','0.00','0','0','0','0'); -- id=1778
UPDATE sellbilldetail SET  lastbuyprice = 44.33 , meanbuyprice = 44.33, lastbuyprice_withDiscount = 44.33, meanbuyprice_withDiscount = 44.33
        , lastbuyprice_withTax = 44.33, meanbuyprice_withTax = 44.33, lastbuyprice_withDiscountAndTax = 44.33
                where sellbilldetailid = 1778;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4372.0602857402, sellCostBuyPrice =sellCostBuyPrice+4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4433
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+100
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 4372.0602857402, 4433, 4433
                    , 4433, 4433, 4433, 4433
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4433, 4433, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4372.0602857402, sellCostBuyPrice =sellCostBuyPrice+4433
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4433, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4433
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4433, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4433
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4433
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4433
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4433
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '645', userid = '1', storedetaildate = '2026-10-03 22:03:00' WHERE storedetailid = '41';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('41', '1', '100', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '745', '645', '1', '2026-10-03 22:03:00','0','0'); -- id=3399
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+72 where id = 121;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00042', '206', '1', '42', '72.00', '37.87', '2726.64', '0', '', '1', '2026-10-03 22:03:00', '42', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','121-72,','1','1','0','0','37.87','2726.64','0','','0','0.00','0','0','0','0'); -- id=1779
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1779;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (42, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+72
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '900', userid = '1', storedetaildate = '2026-10-03 22:03:00' WHERE storedetailid = '42';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('42', '1', '72', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '972', '900', '1', '2026-10-03 22:03:00','0','0'); -- id=3400
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+72 where id = 127;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('29.5','00043', '206', '1', '43', '72.00', '37.87', '2726.64', '0', '', '1', '2026-10-03 22:03:00', '43', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','127-72,','1','1','0','0','37.87','2726.64','0','','0','0.00','0','0','0','0'); -- id=1780
UPDATE sellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where sellbilldetailid = 1780;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (43, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+72
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2099.5129372157, 2124, 2124
                    , 2124, 2124, 2124, 2124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2124, 2124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2099.5129372157, sellCostBuyPrice =sellCostBuyPrice+2124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '839', userid = '1', storedetaildate = '2026-10-03 22:03:01' WHERE storedetailid = '43';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('43', '1', '72', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '911', '839', '1', '2026-10-03 22:03:01','0','0'); -- id=3401
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+200 where id = 128;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.44','00044', '206', '1', '44', '200.00', '10.82', '2164', '0', '', '1', '2026-10-03 22:03:01', '44', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','128-200,','1','1','0','0','10.82','2164','0','','0','0.00','0','0','0','0'); -- id=1781
UPDATE sellbilldetail SET  lastbuyprice = 8.44 , meanbuyprice = 8.44, lastbuyprice_withDiscount = 8.44, meanbuyprice_withDiscount = 8.44
        , lastbuyprice_withTax = 8.44, meanbuyprice_withTax = 8.44, lastbuyprice_withDiscountAndTax = 8.44
                where sellbilldetailid = 1781;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (44, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1666.2801089013, sellCostBuyPrice =sellCostBuyPrice+1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1688
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+200
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 1666.2801089013, 1688, 1688
                    , 1688, 1688, 1688, 1688
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1688, 1688, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1666.2801089013, sellCostBuyPrice =sellCostBuyPrice+1688
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1688, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1688
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1688, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1688
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1688
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1688
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1688
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1750', userid = '1', storedetaildate = '2026-10-03 22:03:01' WHERE storedetailid = '44';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('44', '1', '200', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1950', '1750', '1', '2026-10-03 22:03:01','0','0'); -- id=3402
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237.5','00045', '206', '1', '45', '12.00', '304.33', '3651.96', '0', '', '1', '2026-10-03 22:03:01', '45', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','131-12,','1','1','0','0','304.33','3651.96','0','','0','0.00','0','0','0','0'); -- id=1782
UPDATE sellbilldetail SET  lastbuyprice = 237.50 , meanbuyprice = 237.50, lastbuyprice_withDiscount = 237.50, meanbuyprice_withDiscount = 237.50
        , lastbuyprice_withTax = 237.5, meanbuyprice_withTax = 237.5, lastbuyprice_withDiscountAndTax = 237.5
                where sellbilldetailid = 1782;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (45, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2812.0093837816, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-03', 2812.0093837816, 2850, 2850
                    , 2850, 2850, 2850, 2850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2812.0093837816, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-10-03 22:03:01' WHERE storedetailid = '45';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('45', '1', '12', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '76', '64', '1', '2026-10-03 22:03:01','0','0'); -- id=3403
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 125;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00047', '206', '1', '47', '20.00', '114.97', '2299.4', '0', '', '1', '2026-10-03 22:03:01', '47', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','125-20,','1','1','0','0','114.97','2299.4','0','','0','0.00','0','0','0','0'); -- id=1783
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1783;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (47, '2026-10-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770.5381157152, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1770.5381157152, 1794, 1794
                    , 1794, 1794, 1794, 1794
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1794, 1794, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770.5381157152, sellCostBuyPrice =sellCostBuyPrice+1794
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1794, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1794
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1794, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1794
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1794
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1794
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '144', userid = '1', storedetaildate = '2026-10-03 22:03:02' WHERE storedetailid = '47';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('47', '1', '20', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '164', '144', '1', '2026-10-03 22:03:02','0','0'); -- id=3404
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 where id = 124;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('89.7','00046', '206', '1', '46', '40.00', '114.97', '4598.8', '0', '', '1', '2026-10-03 22:03:02', '46', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','124-40,','1','1','0','0','114.97','4598.8','0','','0','0.00','0','0','0','0'); -- id=1784
UPDATE sellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where sellbilldetailid = 1784;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (46, '2026-10-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3541.0762314304, sellCostBuyPrice =sellCostBuyPrice+3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 3541.0762314304, 3588, 3588
                    , 3588, 3588, 3588, 3588
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3588, 3588, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3541.0762314304, sellCostBuyPrice =sellCostBuyPrice+3588
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3588, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3588
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3588, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3588
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3588
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3588
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3588
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '115', userid = '1', storedetaildate = '2026-10-03 22:03:02' WHERE storedetailid = '46';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('46', '1', '40', '1', '206', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '155', '115', '1', '2026-10-03 22:03:02','0','0'); -- id=3405
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-397390.9475',  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 ('-415751.9375','18360.99', '0', '1', 'اضافة فاتورة مبيعات (معدله)', '206', '-397390.9475', '2026-10-03 22:03:02', '1',  'sellbillController.php','1','','0'); -- id=206
UPDATE dailyentry SET totalcreditor = '23845.44', totaldebtor = '23845.44', thedate = '2026-10-03', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-03 20:44:09', entryComment = 'اضافة فاتورة مبيعات رقم 205', fromFlag = '1',related='0',isopeningentry='0',operationId='205',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=205' WHERE id = '1253';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23845.44', '23845.44', '2026-10-03', '1', '0', '1253', '2026-10-03 22:03:02','تم عكس القيد رقم 1253 ','1','0','0','0','0',''); -- id=1256
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1256', '383', '18360.99', '','0'); -- id=1257
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-234362.92', 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 ('1256', '398', '5484.45', '','0'); -- id=1258
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '18706.56', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1256', '143', '23845.44', '','0'); -- id=1261
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '871594.34', 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 = '18601.00', totaldebtor = '18601.00', thedate = '2026-10-03', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-03 20:44:09', entryComment = 'اضافة فاتورة مبيعات رقم 205 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='205',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=205' WHERE id = '1254';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '18601.00', '18601.00', '2026-10-03', '1', '0', '1254', '2026-10-03 22:03:03','تم عكس القيد رقم 1254 ','1','0','0','0','0',''); -- id=1257
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1257', '402', '18601.00', '','0'); -- id=1259
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '792329.64', 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 ('1257', '382', '18601.00', '','0'); -- id=1262
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2519214.95', 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 ( '23845.44', '23845.44', '2026-10-03', '1', '0', '0', '2026-10-03 22:03:03','اضافة فاتورة مبيعات رقم 206','1','0',null,'0','206','sellbillController.php?do=showDetail&sellbillid=206'); -- id=1258
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1258', '383', '18360.99', '','0'); -- id=1263
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-216001.93', 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 ('1258', '398', '5484.45', '','0'); -- id=1264
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '24191.01', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1258', '143', '23845.44', '','0'); -- id=1260
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '895439.78', 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 ( '18601', '18601', '2026-10-03', '1', '0', '0', '2026-10-03 22:03:03','اضافة فاتورة مبيعات رقم 206 - صرف البضاعة من المخزن','1','0',null,'0','206','sellbillController.php?do=showDetail&sellbillid=206'); -- id=1259
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1259', '402', '18601', '','0'); -- id=1265
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '810930.64', 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 ('1259', '382', '18601', '','0'); -- id=1261
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2500613.95', 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='1258,0,1259' where sellbillid=206;
 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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18360.99, sellCostBuyPrice =sellCostBuyPrice+18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18601, 18601, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+18360.99, sellCostBuyPrice =sellCostBuyPrice+18601
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18601, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18601
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18601, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18601
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18601
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18601
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18601
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 18360.99, 18601, 18601
                    , 18601, 18601, 18601, 18601, 18601, 18601)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+18360.99, netSellCostBuyPrice = netSellCostBuyPrice+18601
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18601
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18601
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+18601
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+18601
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+18601
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18601
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18601;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 205 and newid=206 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:33:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:03:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:03:05', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=206'); -- id=3355
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:45:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:15:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:15:29', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:48:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:18:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:18:41', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3357

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac1626266894
-- ----------------------------------------------------------------------------------------------------

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-03 22:18:41', '06ac1626266894', '1', '0.00', '0', '0', '1', '5890.00', '5890', '5890', '0', '1', '2026-10-03 22:18:41', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','5890','0','','0','0','5890','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-03','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=207
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','اضافة فاتورة مبيعات','207', '0', '2026-10-03 22:18:42', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5890', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-03 22:18:41','0','0','',''); -- id=347
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 105;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('960','00522', '207', '6', '522', '1', '1050', '1050', '0', '', '1', '2026-10-03 22:18:42', '522', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','105-1,','1','1','0','0','1050','1050','0','','0','0.00','0','0','0','0'); -- id=1785
UPDATE sellbilldetail SET  lastbuyprice = 960.00 , meanbuyprice = 960.00, lastbuyprice_withDiscount = 960.00, meanbuyprice_withDiscount = 960.00
        , lastbuyprice_withTax = 960, meanbuyprice_withTax = 960, lastbuyprice_withDiscountAndTax = 960
                where sellbilldetailid = 1785;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (522, '2026-10-03', 1050, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-03', 1050, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2026-10-03 22:18:42' WHERE storedetailid = '522';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('522', '1', '1', '1', '207', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '13', '1', '2026-10-03 22:18:42','0','0'); -- id=3406
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 106;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('966','00523', '207', '6', '523', '1', '1090', '1090', '0', '', '1', '2026-10-03 22:18:42', '523', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','106-1,','1','1','0','0','1090','1090','0','','0','0.00','0','0','0','0'); -- id=1786
UPDATE sellbilldetail SET  lastbuyprice = 966.00 , meanbuyprice = 966.00, lastbuyprice_withDiscount = 966.00, meanbuyprice_withDiscount = 966.00
        , lastbuyprice_withTax = 966, meanbuyprice_withTax = 966, lastbuyprice_withDiscountAndTax = 966
                where sellbilldetailid = 1786;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (523, '2026-10-03', 1090, 966, 966
                    , 966, 966, 966, 966
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 966, 966, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1090, sellCostBuyPrice =sellCostBuyPrice+966
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+966, sellCostMeanBuyPrice = sellCostMeanBuyPrice+966
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+966, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+966
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+966
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+966
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 1090, 966, 966
                    , 966, 966, 966, 966
                    , 0, 0, 0, 0
                    , 0, 0, 0, 966, 966, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1090, sellCostBuyPrice =sellCostBuyPrice+966
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+966, sellCostMeanBuyPrice = sellCostMeanBuyPrice+966
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+966, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+966
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+966
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+966
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+966
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 22:18:42' WHERE storedetailid = '523';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('523', '1', '1', '1', '207', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '9', '1', '2026-10-03 22:18:42','0','0'); -- id=3407
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 107;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1068.75','00524', '207', '6', '524', '3', '1250', '3750', '0', '', '1', '2026-10-03 22:18:43', '524', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','107-3,','1','1','0','0','1250','3750','0','','0','0.00','0','0','0','0'); -- id=1787
UPDATE sellbilldetail SET  lastbuyprice = 1068.75 , meanbuyprice = 1068.75, lastbuyprice_withDiscount = 1068.75, meanbuyprice_withDiscount = 1068.75
        , lastbuyprice_withTax = 1068.75, meanbuyprice_withTax = 1068.75, lastbuyprice_withDiscountAndTax = 1068.75
                where sellbilldetailid = 1787;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (524, '2026-10-03', 3750, 3206.25, 3206.25
                    , 3206.25, 3206.25, 3206.25, 3206.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 3206.25, 3206.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3750, sellCostBuyPrice =sellCostBuyPrice+3206.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3206.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3206.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3206.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3206.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 3750, 3206.25, 3206.25
                    , 3206.25, 3206.25, 3206.25, 3206.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3206.25, 3206.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3750, sellCostBuyPrice =sellCostBuyPrice+3206.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3206.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3206.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3206.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3206.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-03 22:18:43' WHERE storedetailid = '524';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('524', '1', '3', '1', '207', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '6', '1', '2026-10-03 22:18:43','0','0'); -- id=3408
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-391500.9375',  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 ('-397390.9375','5890', '0', '1', 'اضافة فاتورة مبيعات', '207', '-391500.9375', '2026-10-03 22:18:43', '1',  'sellbillController.php','1','','0'); -- id=207
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5890', '5890', '2026-10-03', '1', '0', '0', '2026-10-03 22:18:43','اضافة فاتورة مبيعات رقم 207','1','0',null,'0','207','sellbillController.php?do=showDetail&sellbillid=207'); -- id=1260
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1260', '383', '5890', '','0'); -- id=1266
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-210111.93', 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 ('1260', '143', '5890', '','0'); -- id=1262
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '901329.78', 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 ( '5132.25', '5132.25', '2026-10-03', '1', '0', '0', '2026-10-03 22:18:43','اضافة فاتورة مبيعات رقم 207 - صرف البضاعة من المخزن','1','0',null,'0','207','sellbillController.php?do=showDetail&sellbillid=207'); -- id=1261
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1261', '402', '5132.25', '','0'); -- id=1267
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '816062.89', 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 ('1261', '382', '5132.25', '','0'); -- id=1263
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2495481.7', 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='1260,0,1261' where sellbillid=207;
 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-03', 5890, 5132.25, 5132.25
                    , 5132.25, 5132.25, 5132.25, 5132.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5132.25, 5132.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5890, sellCostBuyPrice =sellCostBuyPrice+5132.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5132.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5132.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5132.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5132.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5132.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5132.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5132.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-03', 5890, 5132.25, 5132.25
                    , 5132.25, 5132.25, 5132.25, 5132.25
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5132.25, 5132.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5890, sellCostBuyPrice =sellCostBuyPrice+5132.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5132.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5132.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5132.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5132.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5132.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5132.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5132.25
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 5890, 5132.25, 5132.25
                    , 5132.25, 5132.25, 5132.25, 5132.25, 5132.25, 5132.25)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5890, netSellCostBuyPrice = netSellCostBuyPrice+5132.25
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5132.25
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5132.25
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5132.25
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5132.25
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5132.25
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5132.25
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5132.25;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac1626266894 and sellbillId = 207 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:48:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:18:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-03 22:18:44', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3358
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-03 18:48:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-03 22:18:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-10-03 22:18:52', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=3359
