UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:32:20";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:32:20";
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-09-17 05:32:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:02:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-17 09:02:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=1233
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-09-17',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-09-17 05:32:40";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-17 09:02:40', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1234
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:35:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:05:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:05:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1235
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:35:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:05:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:05:24', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1236
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:35:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:05:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:05:32', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=29'); -- id=1237
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:35:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:06:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:06:00', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1238
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:52:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:22:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:22:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1239
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:53:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:23:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:23:33', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1240

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aab9551b5278
-- ----------------------------------------------------------------------------------------------------

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-09-17 09:23:34', '06aab9551b5278', '1', '0.00', '0', '0', '1', '397.50', '397.5', '397.5', '0', '1', '2026-09-17 09:23:34', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '50' ,'0','','','','','-1','0','0','0','0','0','397','0','','0','0','397.5','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=31
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','اضافة فاتورة مبيعات','31', '0', '2026-09-17 09:23:34', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '397.5', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 09:23:34','0','0','',''); -- id=49
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+40 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', '31', '3', '103', '40', '5.5', '220', '0', '', '1', '2026-09-17 09:23:34', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-40,','1','1','0','0','5.5','220','0','','0','0.00','0','0','0','0'); -- id=176
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 = 176;
 INSERT INTO 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-09-17', 220, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+40
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 220, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2691', userid = '1', storedetaildate = '2026-09-17 09:23:35' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '40', '1', '31', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2731', '2691', '1', '2026-09-17 09:23:35','0','0'); -- id=628
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '31', '3', '100', '10', '17.75', '177.5', '0', '', '1', '2026-09-17 09:23:35', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17.75','177.5','0','','0','0.00','0','0','0','0'); -- id=177
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 = 177;
 INSERT INTO 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-09-17', 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-09-17', 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 = '327', userid = '1', storedetaildate = '2026-09-17 09:23:35' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '10', '1', '31', 'اضافة فاتورة مبيعات', 'sellbillController.php', '337', '327', '1', '2026-09-17 09:23:35','0','0'); -- id=629
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-200838.046875',  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 ('-201235.546875','397.5', '0', '1', 'اضافة فاتورة مبيعات', '31', '-200838.046875', '2026-09-17 09:23:35', '1',  'sellbillController.php','1','','0'); -- id=30
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '397.5', '397.5', '2026-09-17', '1', '0', '0', '2026-09-17 09:23:35','اضافة فاتورة مبيعات رقم 31','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=472
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('472', '383', '397.5', '','0'); -- id=472
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-182106.05', 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 ('472', '143', '397.5', '','0'); -- id=472
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '76952.79', 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 ( '356', '356', '2026-09-17', '1', '0', '0', '2026-09-17 09:23:35','اضافة فاتورة مبيعات رقم 31 - صرف البضاعة من المخزن','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=473
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('473', '402', '356', '','0'); -- id=473
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '73826.92', 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 ('473', '382', '356', '','0'); -- id=473
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2101117.35', theOrder = '0', layingOrder = '120202', reportid = '1', 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='472,0,473' where sellbillid=31;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 397.5, 356, 356
                    , 356, 356, 356, 356
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,356, 356, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.5, sellCostBuyPrice =sellCostBuyPrice+356
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+356, sellCostMeanBuyPrice = sellCostMeanBuyPrice+356
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+356, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+356
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+356
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+356
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+356
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 397.5, 356, 356
                    , 356, 356, 356, 356
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,356, 356, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+397.5, sellCostBuyPrice =sellCostBuyPrice+356
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+356, sellCostMeanBuyPrice = sellCostMeanBuyPrice+356
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+356, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+356
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+356
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+356
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+356
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 397.5, 356, 356
                    , 356, 356, 356, 356, 356, 356)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+397.5, netSellCostBuyPrice = netSellCostBuyPrice+356
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+356
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+356
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+356
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+356
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+356
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+356
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+356;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06aab9551b5278 and sellbillId = 31 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:53:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:23:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:23:37', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1241
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:53:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:23:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 09:23:48', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=1242
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:54:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:24:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 09:24:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php?do=add'); -- id=1243
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('بيتر' , 'شرم الشيخ', '01224311185', '', '700', '', '0', '2026-09-17 09:25:00', '1', '0','12','0','','-10','12','10000',',','-1','0','','0','0','.','2026-09-17','0','12','','0','0','0','','','0','0','','','','','','','','','','-1','','.','.','0','','','0','0',''); -- id=12
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('12', '0', '0', '', ''); -- id=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','0','700','0','إضافة عميل جديد','12', '700', '2026-09-17 09:25:00', '1', 'clientController.php', '', '700', '0', null, '0', null, null,'', '0','1','1','700','1','','0','0','',''); -- id=50
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('بيتر', 'بيتر', 'بيتر', 'بيتر', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-17 09:25:00'); -- id=439
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '700', '700', '2026-09-17', '1', '0', '0', '2026-09-17 09:25:01','تم اضافة عميل بيتر','1','0','0','0','12','clientController.php?do=edit&id=12'); -- id=474
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('474', '439', '700', '','0'); -- id=474
UPDATE accountstree SET name = 'بيتر', customName = 'بيتر', customNameEn = 'بيتر', nameEn = 'بيتر', parent = '58', accountNature = '0', theValue = '700', 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 ('474', '121', '700', '','0'); -- id=474
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1066629.52', 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';
COMMIT;
UPDATE client SET clientname = 'بيتر', clientaddress = 'شرم الشيخ', clientphone = '01224311185', clientmobile = '', clientdebt = '700.00', clientdetails = '', conditions = '0', clientdate = '2026-09-17', userid = '1'  , clientareaid = '0'  ,clientcode = '12',dailyentryid = '474' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '12' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='12' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='439',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='.',fileimg='.',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '12';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 05:55:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:25:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 09:25:03', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=1244
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:09:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:39:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 09:39:09', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1245
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:09:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:39:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:39:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1246
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:09:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:39:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:39:48', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1247
UPDATE product SET productName = 'بكره ليد ويرليس بينك ', productDescription = '', productCatId = '6', productBuyPrice = '1100.00', productSellAllPrice = '1150.00', productSellUnitPrice = '1350.00', productSellHalfPrice = '1150.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00205',type ='0', expireDate = '0' , dailyentryId = '232',isService = '0',isOptic = '0',lastbuyprice = '1100.00',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100.00',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '4.55' , buypart_precentage = '22.73',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1100',meanbuyprice_withTax='1100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '205';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (205, 1,'2026-09-17 09:40:28',1)
                ON DUPLICATE KEY UPDATE productid = 205, edited = 1, sysdate = '2026-09-17 09:40:28', userid = 1; -- id=213
UPDATE product SET productName = 'بكره ليد ويرليس مفرد ورم', productDescription = '', productCatId = '6', productBuyPrice = '1100.00', productSellAllPrice = '1150.00', productSellUnitPrice = '1350.00', productSellHalfPrice = '1150.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00203',type ='0', expireDate = '0' , dailyentryId = '230',isService = '0',isOptic = '0',lastbuyprice = '1100.00',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100.00',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '4.55' , buypart_precentage = '22.73',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1100',meanbuyprice_withTax='1100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '203';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (203, 1,'2026-09-17 09:40:33',1)
                ON DUPLICATE KEY UPDATE productid = 203, edited = 1, sysdate = '2026-09-17 09:40:33', userid = 1; -- id=211
UPDATE product SET productName = 'بكره ليد ويرليس دبل ورم', productDescription = '', productCatId = '6', productBuyPrice = '1250.00', productSellAllPrice = '1350.00', productSellUnitPrice = '1550.00', productSellHalfPrice = '1350.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00202',type ='0', expireDate = '0' , dailyentryId = '229',isService = '0',isOptic = '0',lastbuyprice = '1250.00',lastbuyprice_withDiscount = '1250',meanbuyprice = '1250.00',meanbuyprice_withDiscount = '1250' , productbuypricereal = '1250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '8.00' , buypart_precentage = '24.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1250',meanbuyprice_withTax='1250',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1250',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '202';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (202, 1,'2026-09-17 09:40:37',1)
                ON DUPLICATE KEY UPDATE productid = 202, edited = 1, sysdate = '2026-09-17 09:40:37', userid = 1; -- id=210
UPDATE product SET productName = 'متر ليد ويرليس مفرد ازرق ', productDescription = '', productCatId = '6', productBuyPrice = '11.00', productSellAllPrice = '12.00', productSellUnitPrice = '15.00', productSellHalfPrice = '12.55', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00204',type ='0', expireDate = '0' , dailyentryId = '231',isService = '0',isOptic = '0',lastbuyprice = '11.00',lastbuyprice_withDiscount = '11',meanbuyprice = '11.00',meanbuyprice_withDiscount = '11' , productbuypricereal = '11.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '14.05' , buypart_precentage = '36.36',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='11',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='11',meanbuyprice_withTax='11',price4='0',price5='0',price6='0',price7='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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '204';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (204, 1,'2026-09-17 09:40:51',1)
                ON DUPLICATE KEY UPDATE productid = 204, edited = 1, sysdate = '2026-09-17 09:40:51', userid = 1; -- id=212
UPDATE product SET productName = 'متر ليد ويرليس دبل ورم ', productDescription = '', productCatId = '6', productBuyPrice = '14.00', productSellAllPrice = '14.00', productSellUnitPrice = '19.00', productSellHalfPrice = '14.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00206',type ='0', expireDate = '0' , dailyentryId = '233',isService = '0',isOptic = '0',lastbuyprice = '14.00',lastbuyprice_withDiscount = '14',meanbuyprice = '14.00',meanbuyprice_withDiscount = '14' , productbuypricereal = '14.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '35.71',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='14',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',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',meanbuyprice_withTax='14',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='14',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '206';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (206, 1,'2026-09-17 09:41:19',1)
                ON DUPLICATE KEY UPDATE productid = 206, edited = 1, sysdate = '2026-09-17 09:41:19', userid = 1; -- id=214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:11:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:41:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:41:19', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1248
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:11:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:41:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:41:46', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1249
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','12','16','18','16','2026-09-17','0','1','0','','0','0','0','0','0','12','12','12','12','12','0','33.33','33.33','50','.','0','0','0','12','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','12','12','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','12','0','0','0','0','0','0','','','0','0','0','0'); -- id=373
UPDATE product SET productName = 'متر ليد ويرليس بينك ', productDescription = '', productCatId = '6', productBuyPrice = '12', productSellAllPrice = '16', productSellUnitPrice = '18', productSellHalfPrice = '16', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00373',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '12',lastbuyprice_withDiscount = '12',meanbuyprice = '12',meanbuyprice_withDiscount = '12' , productbuypricereal = '12' , buypricereal_precentage = '0' , buytotal_precentage = '33.33' , buyhalf_precentage = '33.33' , buypart_precentage = '50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='12',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='12',meanbuyprice_withTax='12',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='12',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '373';
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', '373', '1.00', '2026-09-17', '1', '0','0037301','16','16','18','12','','0','0','0','0','0','0','0','0','0','0'); -- id=373
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('373', '1', '80', '1', '2026-09-17'); -- id=373
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('373', '1', '80', '0', '373', 'إضافة منتج', 'productController.php', '0', '80', '1', '2026-09-17','0','0'); -- id=630
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (373, 1,'2026-09-17 09:41:47',1)
                ON DUPLICATE KEY UPDATE productid = 373, edited = 1, sysdate = '2026-09-17 09:41:47', userid = 1; -- id=430
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '960', '960', '2026-09-17', '1', '0', '0', '2026-09-17 09:41:48','إضافة منتج متر ليد ويرليس بينك  الكمية 80','1','0','0','0','373','productController.php?do=edit&id=373'); -- id=475
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('475', '382', '960', '','0'); -- id=475
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2102077.35', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('475', '121', '960', '','0'); -- id=475
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1067589.52', 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 = '6', productBuyPrice = '12.00', productSellAllPrice = '16.00', productSellUnitPrice = '18.00', productSellHalfPrice = '16.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00373',type ='0', expireDate = '0' , dailyentryId = '475',isService = '0',isOptic = '0',lastbuyprice = '12',lastbuyprice_withDiscount = '12',meanbuyprice = '12',meanbuyprice_withDiscount = '12' , productbuypricereal = '12' , buypricereal_precentage = '0' , buytotal_precentage = '33.33' , buyhalf_precentage = '33.33' , buypart_precentage = '50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='12',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='12',meanbuyprice_withTax='12',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='12',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '373';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:11:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:41:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:41:50', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1250
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:27:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:57:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:57:29', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1251
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:58:17', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1252
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 ('سلك رباط صيني ','','14','54','60','60','60','2026-09-17','0','1','0','','0','0','0','0','0','54','54','54','54','54','0','11.11','11.11','11.11','.','0','0','0','54','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','54','54','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','54','0','0','0','0','0','0','','','0','0','0','0'); -- id=374
UPDATE product SET productName = 'سلك رباط صيني ', productDescription = '', productCatId = '14', productBuyPrice = '54', productSellAllPrice = '60', productSellUnitPrice = '60', productSellHalfPrice = '60', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00374',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '54',lastbuyprice_withDiscount = '54',meanbuyprice = '54',meanbuyprice_withDiscount = '54' , productbuypricereal = '54' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='54',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='54',meanbuyprice_withTax='54',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='54',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '374';
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', '374', '1', '2026-09-17', '1', '0','0037401','60','60','60','54','','0','0','0','0','0','0','0','0','0','0'); -- id=374
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('374', '1', '20', '1', '2026-09-17'); -- id=374
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '20', '0', '374', 'إضافة منتج', 'productController.php', '0', '20', '1', '2026-09-17','0','0'); -- id=631
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (374, 1,'2026-09-17 09:58:18',1)
                ON DUPLICATE KEY UPDATE productid = 374, edited = 1, sysdate = '2026-09-17 09:58:18', userid = 1; -- id=431
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1080', '1080', '2026-09-17', '1', '0', '0', '2026-09-17 09:58:18','إضافة منتج سلك رباط صيني  الكمية 20','1','0','0','0','374','productController.php?do=edit&id=374'); -- id=476
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('476', '382', '1080', '','0'); -- id=476
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2103157.35', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('476', '121', '1080', '','0'); -- id=476
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1068669.52', 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 = '14', productBuyPrice = '54.00', productSellAllPrice = '60.00', productSellUnitPrice = '60.00', productSellHalfPrice = '60.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00374',type ='0', expireDate = '0' , dailyentryId = '476',isService = '0',isOptic = '0',lastbuyprice = '54',lastbuyprice_withDiscount = '54',meanbuyprice = '54',meanbuyprice_withDiscount = '54' , productbuypricereal = '54' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='54',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='54',meanbuyprice_withTax='54',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='54',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '374';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:58:21', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:58:28', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:58:39', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1255
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:58:46', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1256
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:28:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:58:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-17 09:58:49', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productCatController.php'); -- id=1257
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:29:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:59:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:59:09', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1258
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:29:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:59:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:59:50', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1259
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 ('لوحه 10 خط جرين لايت','','6','200','290','295','290','2026-09-17','0','1','0','','0','0','0','0','0','200','200','200','200','200','0','45','45','47.5','.','0','0','0','200','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','200','200','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','200','0','0','0','0','0','0','','','0','0','0','0'); -- id=375
UPDATE product SET productName = 'لوحه 10 خط جرين لايت', productDescription = '', productCatId = '6', productBuyPrice = '200', productSellAllPrice = '290', productSellUnitPrice = '295', productSellHalfPrice = '290', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '200',lastbuyprice_withDiscount = '200',meanbuyprice = '200',meanbuyprice_withDiscount = '200' , productbuypricereal = '200' , buypricereal_precentage = '0' , buytotal_precentage = '45' , buyhalf_precentage = '45' , buypart_precentage = '47.5',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '375';
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', '375', '1.00', '2026-09-17', '1', '0','0037501','290','290','295','200','','0','0','0','0','0','0','0','0','0','0'); -- id=375
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('375', '1', '1', '1', '2026-09-17'); -- id=375
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '0', '375', 'إضافة منتج', 'productController.php', '0', '1', '1', '2026-09-17','0','0'); -- id=632
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (375, 1,'2026-09-17 09:59:51',1)
                ON DUPLICATE KEY UPDATE productid = 375, edited = 1, sysdate = '2026-09-17 09:59:51', userid = 1; -- id=432
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200', '200', '2026-09-17', '1', '0', '0', '2026-09-17 09:59:51','إضافة منتج لوحه 10 خط جرين لايت الكمية 1','1','0','0','0','375','productController.php?do=edit&id=375'); -- id=477
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('477', '382', '200', '','0'); -- id=477
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2103357.35', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('477', '121', '200', '','0'); -- id=477
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1068869.52', 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 = 'لوحه 10 خط جرين لايت', productDescription = '', productCatId = '6', productBuyPrice = '200.00', productSellAllPrice = '290.00', productSellUnitPrice = '295.00', productSellHalfPrice = '290.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00375',type ='0', expireDate = '0' , dailyentryId = '477',isService = '0',isOptic = '0',lastbuyprice = '200',lastbuyprice_withDiscount = '200',meanbuyprice = '200',meanbuyprice_withDiscount = '200' , productbuypricereal = '200' , buypricereal_precentage = '0' , buytotal_precentage = '45' , buyhalf_precentage = '45' , buypart_precentage = '47.5',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '375';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:29:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 09:59:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 09:59:53', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1260
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:30:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:00:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:00:01', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:30:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:00:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:00:14', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:30:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:00:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:00:19', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=13'); -- id=1263
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:33:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:03:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:03:06', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1264
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 13;
UPDATE sellbill SET  sellbillsysdate = '2026-09-17 10:03:07', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '13';
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 64;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 10:03:07' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '160', '180', '1', '2026-09-15 14:55:07','0','0'); -- id=633
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 65;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '475', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '445', '475', '1', '2026-09-15 14:55:07','0','0'); -- id=634
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 66;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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-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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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 = '155', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '153', '155', '1', '2026-09-15 14:55:07','0','0'); -- id=635
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 67;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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-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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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 = '5', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=636
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 68;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-09-15 14:55:07','0','0'); -- id=637
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 69;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '32', '34', '1', '2026-09-15 14:55:07','0','0'); -- id=638
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 70;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '71', userid = '1', storedetaildate = '2026-09-17 10:03:07' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '66', '71', '1', '2026-09-15 14:55:07','0','0'); -- id=639
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 71;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 60, 50, 50
                    , 50, 50, 50, 50
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-60, sellCostBuyPrice =sellCostBuyPrice-50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-50, sellCostMeanBuyPrice = sellCostMeanBuyPrice-50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-50
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-50
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-17 10:03:08' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '1', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=640
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 72;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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-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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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 = '13', userid = '1', storedetaildate = '2026-09-17 10:03:08' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '13', '1', '2026-09-15 14:55:07','0','0'); -- id=641
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 73;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '642', userid = '1', storedetaildate = '2026-09-17 10:03:08' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '4', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '638', '642', '1', '2026-09-15 14:55:07','0','0'); -- id=642
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 74;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 17.5, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.25,0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-17.5, 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-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-09-17', 17.5, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-17.5, 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 = '8', userid = '1', storedetaildate = '2026-09-17 10:03:08' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.25', '0', '13', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7.75', '8', '1', '2026-09-15 14:55:07','0','0'); -- id=643
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
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 ('5','4324.60','4324.60','1','تعديل فاتورة مبيعات','13', '0', '2026-09-15 14:55:07', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '4324.6', '0', null, '0', null, null,'', '0','1','1','4324.6','1','2026-09-15 14:55:07','0','0','',''); -- id=51
UPDATE client SET  inUse = 0 where clientid = 5;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4324.6, 3920.2, 3920.2
                    , 3920.2, 3920.2, 3920.2, 3920.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3920.2, 3920.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4324.6, sellCostBuyPrice =sellCostBuyPrice-3920.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3920.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3920.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3920.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3920.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3920.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3920.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3920.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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-09-17', 4324.6, 3920.2, 3920.2
                    , 3920.2, 3920.2, 3920.2, 3920.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3920.2, 3920.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4324.6, sellCostBuyPrice =sellCostBuyPrice-3920.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3920.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3920.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3920.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3920.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3920.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3920.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3920.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4324.6, 3920.2, 3920.2
                    , 3920.2, 3920.2, 3920.2, 3920.2, 3920.2, 3920.2)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-4324.6, netSellCostBuyPrice = netSellCostBuyPrice-3920.2
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-3920.2
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-3920.2
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-3920.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-3920.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-3920.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-3920.2
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-3920.2;

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


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

COMMIT;
BEGIN;
CALL clientInUse(5,@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-09-15 14:55:07', '06aa93eb95dae4', '5', '0.00', '4712.1', '0', '1', '4712.1', '4712.1', '0', '4712.1', '1', '2026-09-15 14:55:07', '', '1', '0', 'احمد عبدالحميد حسون ', '1', '1', '3', '0', 'احمد عبدالحميد حسون ', '69.75', '13', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-15','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=32
UPDATE client SET  clientdebt = '4712.1', userid = '1' WHERE clientid = '5';
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 ('5','0.00','4712.1','0','اضافة فاتورة مبيعات (معدله)','32', '4712.1', '2026-09-17 10:03:09', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '4712.1', '0', null, '0', null, null,'', '0','1','1','4324.6','1','2026-09-15 14:55:07','0','0','',''); -- id=52
UPDATE client SET  inUse = 0 where clientid = 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 ('11.1','00087', '32', '12', '87', '20.00', '11.3', '226', '0', '', '1', '2026-09-17 10:03:09', '87', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','226','0','','0','0.00','0','0','0','0'); -- id=178
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 178;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '160', userid = '1', storedetaildate = '2026-09-17 10:03:09' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '180', '160', '1', '2026-09-17 10:03:09','0','0'); -- id=644
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.9','00086', '32', '12', '86', '30.00', '6.25', '187.5', '0', '', '1', '2026-09-17 10:03:09', '86', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6.25','187.5','0','','0','0.00','0','0','0','0'); -- id=179
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 179;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '445', userid = '1', storedetaildate = '2026-09-17 10:03:10' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '475', '445', '1', '2026-09-17 10:03:10','0','0'); -- id=645
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.1','00088', '32', '12', '88', '2.00', '11.3', '22.6', '0', '', '1', '2026-09-17 10:03:10', '88', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','22.6','0','','0','0.00','0','0','0','0'); -- id=180
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 180;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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+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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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 = '153', userid = '1', storedetaildate = '2026-09-17 10:03:10' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '155', '153', '1', '2026-09-17 10:03:10','0','0'); -- id=646
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','00212', '32', '13', '212', '1.00', '245', '245', '0', '', '1', '2026-09-17 10:03:10', '212', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','245','0','','0','0.00','0','0','0','0'); -- id=181
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 181;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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+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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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 = '4', userid = '1', storedetaildate = '2026-09-17 10:03:10' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '1', '2026-09-17 10:03:10','0','0'); -- id=647
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('867','00218', '32', '13', '218', '1.00', '900', '900', '0', '', '1', '2026-09-17 10:03:10', '218', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','900','900','0','','0','0.00','0','0','0','0'); -- id=182
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 182;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-17 10:03:11' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-09-17 10:03:11','0','0'); -- id=648
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','00084', '32', '12', '84', '2.00', '195', '390', '0', '', '1', '2026-09-17 10:03:11', '84', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','195','390','0','','0','0.00','0','0','0','0'); -- id=183
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 183;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 10:03:11' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '34', '32', '1', '2026-09-17 10:03:11','0','0'); -- id=649
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '32', '12', '70', '5.00', '352', '1760', '0', '', '1', '2026-09-17 10:03:11', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','352','1760','0','','0','0.00','0','0','0','0'); -- id=184
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 184;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '66', userid = '1', storedetaildate = '2026-09-17 10:03:11' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '71', '66', '1', '2026-09-17 10:03:11','0','0'); -- id=650
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00226', '32', '12', '226', '2', '60', '120', '0', '', '1', '2026-09-17 10:03:11', '226', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','120','0','','0','0.00','0','0','0','0'); -- id=185
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 185;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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+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-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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 = '3', userid = '1', storedetaildate = '2026-09-17 10:03:12' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '2', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '3', '1', '2026-09-17 10:03:12','0','0'); -- id=651
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','00073', '32', '12', '73', '1.00', '440', '440', '0', '', '1', '2026-09-17 10:03:12', '73', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','440','440','0','','0','0.00','0','0','0','0'); -- id=186
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 186;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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+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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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 = '12', userid = '1', storedetaildate = '2026-09-17 10:03:12' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '12', '1', '2026-09-17 10:03:12','0','0'); -- id=652
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '32', '14', '81', '4.00', '19', '76', '0', '', '1', '2026-09-17 10:03:12', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','76','0','','0','0.00','0','0','0','0'); -- id=187
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 187;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+76, sellCostBuyPrice =sellCostBuyPrice+72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+72, sellCostMeanBuyPrice = sellCostMeanBuyPrice+72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+76, sellCostBuyPrice =sellCostBuyPrice+72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+72, sellCostMeanBuyPrice = sellCostMeanBuyPrice+72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '638', userid = '1', storedetaildate = '2026-09-17 10:03:12' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '4', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '642', '638', '1', '2026-09-17 10:03:12','0','0'); -- id=653
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('60','00227', '32', '14', '227', '.5', '70', '35', '0', '', '1', '2026-09-17 10:03:13', '227', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','70','35','0','','0','0.00','0','0','0','0'); -- id=188
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 188;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7.5', userid = '1', storedetaildate = '2026-09-17 10:03:13' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.5', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7.5', '1', '2026-09-17 10:03:13','0','0'); -- id=654
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('54','00374', '32', '14', '374', '.25', '60', '15', '0', '', '1', '2026-09-17 10:03:13', '374', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','15','0','','0','0.00','0','0','0','0'); -- id=189
UPDATE sellbilldetail SET  lastbuyprice = 54.00 , meanbuyprice = 54.00, lastbuyprice_withDiscount = 54.00, meanbuyprice_withDiscount = 54.00
        , lastbuyprice_withTax = 54, meanbuyprice_withTax = 54, lastbuyprice_withDiscountAndTax = 54
                where sellbilldetailid = 189;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (374, '2026-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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 = '19.75', userid = '1', storedetaildate = '2026-09-17 10:03:13' WHERE storedetailid = '374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '0.25', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '19.75', '1', '2026-09-17 10:03:13','0','0'); -- id=655
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00375', '32', '6', '375', '1', '295', '295', '0', '', '1', '2026-09-17 10:03:13', '375', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','295','295','0','','0','0.00','0','0','0','0'); -- id=190
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 = 190;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (375, '2026-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 10:03:14' WHERE storedetailid = '375';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '1', '32', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-09-17 10:03:14','0','0'); -- id=656
UPDATE dailyentry SET totalcreditor = '4324.60', totaldebtor = '4324.60', thedate = '2026-09-15', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-15 15:12:04', entryComment = 'اضافة فاتورة مبيعات رقم 13', fromFlag = '1',related='0',isopeningentry='0',operationId='13',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=13' WHERE id = '269';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4324.60', '4324.60', '2026-09-17', '1', '0', '269', '2026-09-17 10:03:14','تم عكس القيد رقم 269 ','1','0','0','0','0',''); -- id=478
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('478', '430', '4324.60', '','0'); -- id=478
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-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('478', '143', '4324.60', '','0'); -- id=478
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '72628.19', 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 = '3920.20', totaldebtor = '3920.20', thedate = '2026-09-15', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-15 15:12:04', entryComment = 'اضافة فاتورة مبيعات رقم 13 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='13',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=13' WHERE id = '270';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3920.20', '3920.20', '2026-09-17', '1', '0', '270', '2026-09-17 10:03:14','تم عكس القيد رقم 270 ','1','0','0','0','0',''); -- id=479
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('479', '402', '3920.20', '','0'); -- id=479
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '69906.72', 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 ('479', '382', '3920.20', '','0'); -- id=479
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2107277.55', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '4712.1', '4712.1', '2026-09-17', '1', '0', '0', '2026-09-17 10:03:15','اضافة فاتورة مبيعات رقم 32','1','0',null,'0','32','sellbillController.php?do=showDetail&sellbillid=32'); -- id=480
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('480', '430', '4712.1', '','0'); -- id=480
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '4712.1', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('480', '143', '4712.1', '','0'); -- id=480
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77340.29', 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 ( '4198.7', '4198.7', '2026-09-17', '1', '0', '0', '2026-09-17 10:03:15','اضافة فاتورة مبيعات رقم 32 - صرف البضاعة من المخزن','1','0',null,'0','32','sellbillController.php?do=showDetail&sellbillid=32'); -- id=481
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('481', '402', '4198.7', '','0'); -- id=481
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74105.42', 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 ('481', '382', '4198.7', '','0'); -- id=481
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2103078.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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='480,0,481' where sellbillid=32;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4712.1, sellCostBuyPrice =sellCostBuyPrice+4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4198.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 (5, '2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4712.1, sellCostBuyPrice =sellCostBuyPrice+4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4198.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, 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7, 4198.7, 4198.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4712.1, netSellCostBuyPrice = netSellCostBuyPrice+4198.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4198.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4198.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4198.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4198.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4198.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4198.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4198.7;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 13 and newid=32 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:33:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:03:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:03:16', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=32'); -- id=1265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:33:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:03:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 10:03:38', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=1266
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:33:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:03:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 10:03:50', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=1267
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:34:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:04:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:04:00', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=32'); -- id=1268
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 06:34:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 10:04:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 10:04:21', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1269
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:34:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:04:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 11:04:23', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1270
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:37:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:07:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 11:07:32', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1271
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 ('06aabad241197a', '2026-09-17 11:04:36', '1', '0.43', '0.43', '0', '0', '27960.00',  '27960.00', '27960', '0', '1', '2026-09-17 11:07:32', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=4
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00120', '4', '3', '120', '190', '15', '2850.00', '0', '', '2026-09-17 11:07:32', '120','','','0','0','0','0','0',null,'15','2850','0','0','0','0','0','0','0','0','1'); -- id=10
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 11:04:36', 1, 120, 0, 0
                    , 15, 190, 0, 0, 1, '2026-09-17 11:07:33')
                ON DUPLICATE KEY UPDATE buyprice = 15,
                        buyQuantity =buyQuantity+190, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 11:07:33' ; -- id=10
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('120', '15', '190', '0', 'buyBillController.php', '10', '', '0', '0'); -- id=10
UPDATE product SET  productBuyPrice = "15" WHERE productId = 120 ;
UPDATE buybilldetail SET  quantitybefore = 87 WHERE buybilldetailid = 10 ;
UPDATE product SET productName = 'وش اسمر ', productDescription = '', productCatId = '3', productBuyPrice = '15.00', productSellAllPrice = '15.75', productSellUnitPrice = '15.75', productSellHalfPrice = '15.75', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00120',type ='0', expireDate = '0' , dailyentryId = '129',isService = '0',isOptic = '0',lastbuyprice = '15',lastbuyprice_withDiscount = '15',meanbuyprice = '15',meanbuyprice_withDiscount = '15' , productbuypricereal = '15.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '5.00' , buypart_precentage = '5.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 = '120';
UPDATE buybilldetail SET  lastbuyprice = 15 , meanbuyprice = 15, lastbuyprice_withDiscount = 15, meanbuyprice_withDiscount = 15
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where buybilldetailid = 10;
UPDATE productunit SET proUnitBuyPrice  = 15 * productnumber WHERE productid = 120;
UPDATE storedetail SET  productquantity = '277', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '120';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '190', '0', '4', 'اضافة فاتورة مشتريات', 'buyBillController.php', '87', '277', '1', '2026-09-17 11:04:36','0','0'); -- id=657
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '4', '3', '102', '600', '11.75', '7050.00', '0', '', '2026-09-17 11:07:32', '102','','','0','0','0','0','0',null,'11.75','7050','0','0','0','0','0','0','0','0','1'); -- id=11
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 11:04:36', 1, 102, 0, 0
                    , 11.75, 600, 0, 0, 1, '2026-09-17 11:07:33')
                ON DUPLICATE KEY UPDATE buyprice = 11.75,
                        buyQuantity =buyQuantity+600, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 11:07:33' ; -- id=11
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('102', '11.75', '600', '0', 'buyBillController.php', '11', '', '0', '0'); -- id=11
UPDATE product SET  productBuyPrice = "11.75" WHERE productId = 102 ;
UPDATE buybilldetail SET  quantitybefore = 1342 WHERE buybilldetailid = 11 ;
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 = 11;
UPDATE productunit SET proUnitBuyPrice  = 11.75 * productnumber WHERE productid = 102;
UPDATE storedetail SET  productquantity = '1942', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '600', '0', '4', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1342', '1942', '1', '2026-09-17 11:04:36','0','0'); -- id=658
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '4', '3', '105', '500', '15', '7500.00', '0', '', '2026-09-17 11:07:32', '105','','','0','0','0','0','0',null,'15','7500','0','0','0','0','0','0','0','0','1'); -- id=12
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 11:04:36', 1, 105, 0, 0
                    , 15, 500, 0, 0, 1, '2026-09-17 11:07:34')
                ON DUPLICATE KEY UPDATE buyprice = 15,
                        buyQuantity =buyQuantity+500, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 11:07:34' ; -- id=12
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('105', '15', '500', '0', 'buyBillController.php', '12', '', '0', '0'); -- id=12
UPDATE product SET  productBuyPrice = "15" WHERE productId = 105 ;
UPDATE buybilldetail SET  quantitybefore = 362 WHERE buybilldetailid = 12 ;
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 = 12;
UPDATE productunit SET proUnitBuyPrice  = 15 * productnumber WHERE productid = 105;
UPDATE storedetail SET  productquantity = '862', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '500', '0', '4', 'اضافة فاتورة مشتريات', 'buyBillController.php', '362', '862', '1', '2026-09-17 11:04:36','0','0'); -- id=659
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '4', '3', '100', '300', '17.6', '5280.00', '0', '', '2026-09-17 11:07:32', '100','','','0','0','0','0','0',null,'17.6','5280','0','0','0','0','0','0','0','0','1'); -- id=13
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 11:04:36', 1, 100, 0, 0
                    , 17.6, 300, 0, 0, 1, '2026-09-17 11:07:35')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 11:07:35' ; -- id=13
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('100', '17.6', '300', '0', 'buyBillController.php', '13', '', '0', '0'); -- id=13
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 100 ;
UPDATE buybilldetail SET  quantitybefore = 327 WHERE buybilldetailid = 13 ;
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 = 13;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 100;
UPDATE storedetail SET  productquantity = '627', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '300', '0', '4', 'اضافة فاتورة مشتريات', 'buyBillController.php', '327', '627', '1', '2026-09-17 11:04:36','0','0'); -- id=660
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,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', '4', '3', '101', '300', '17.6', '5280.00', '0', '', '2026-09-17 11:07:32', '101','','','0','0','0','0','0',null,'17.6','5280','0','0','0','0','0','0','0','0','1'); -- id=14
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 11:04:36', 1, 101, 0, 0
                    , 17.6, 300, 0, 0, 1, '2026-09-17 11:07:36')
                ON DUPLICATE KEY UPDATE buyprice = 17.6,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 11:07:36' ; -- id=14
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('101', '17.6', '300', '0', 'buyBillController.php', '14', '', '0', '0'); -- id=14
UPDATE product SET  productBuyPrice = "17.6" WHERE productId = 101 ;
UPDATE buybilldetail SET  quantitybefore = 422 WHERE buybilldetailid = 14 ;
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 = 14;
UPDATE productunit SET proUnitBuyPrice  = 17.6 * productnumber WHERE productid = 101;
UPDATE storedetail SET  productquantity = '722', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '300', '0', '4', 'اضافة فاتورة مشتريات', 'buyBillController.php', '422', '722', '1', '2026-09-17 11:04:36','0','0'); -- id=661
UPDATE supplier SET  suppliercurrentDebt = '0.43',suppliercurrentDebtInCurrency= '0.43' , userid = '1', supplierdate = '2026-09-17 11:07:32'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '0.43', '0', '0', 'اضافة فاتورة مشتريات', '4', '0.43', '2026-09-17 11:04:36', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','0.43','0','0.43','0',''); -- id=16
UPDATE save SET  savecurrentvalue = '-228798.05',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-200838.05','27960', '1', '1', 'اضافة فاتورة مشتريات', '4', '-228798.05', '2026-09-17 11:04:36', '1',  'buyBillController.php','0','','0'); -- id=31
update buybill set dailyentryid='0,0' where buybillid=4;
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 product SET overAllAveragePrice = 15 WHERE productId = 120;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:37:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:07:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 11:07:38', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=4'); -- id=1272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:37:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:07:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 11:07:48', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1273
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:38:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:08:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 11:08:11', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1274
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:38:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:08:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 11:08:44', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1275
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','191','195','205','195','2026-09-17','0','1','0','','0','0','0','0','0','191','191','191','191','191','0','2.09','2.09','7.33','.','0','0','0','191','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','191','191','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','191','0','0','0','0','0','0','','','0','0','0','0'); -- id=376
UPDATE product SET productName = 'وش وتربروف ابيض ', productDescription = '', productCatId = '1', productBuyPrice = '191', productSellAllPrice = '195', productSellUnitPrice = '205', productSellHalfPrice = '195', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00376',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '191',lastbuyprice_withDiscount = '191',meanbuyprice = '191',meanbuyprice_withDiscount = '191' , productbuypricereal = '191' , buypricereal_precentage = '0' , buytotal_precentage = '2.09' , buyhalf_precentage = '2.09' , buypart_precentage = '7.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='191',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='191',meanbuyprice_withTax='191',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='191',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '376';
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', '376', '1.00', '2026-09-17', '1', '0','0037601','195','195','205','191','','0','0','0','0','0','0','0','0','0','0'); -- id=376
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('376', '1', '10', '1', '2026-09-17'); -- id=376
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('376', '1', '10', '0', '376', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-17','0','0'); -- id=662
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (376, 1,'2026-09-17 11:08:45',1)
                ON DUPLICATE KEY UPDATE productid = 376, edited = 1, sysdate = '2026-09-17 11:08:45', userid = 1; -- id=433
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1910', '1910', '2026-09-17', '1', '0', '0', '2026-09-17 11:08:45','إضافة منتج وش وتربروف ابيض  الكمية 10','1','0','0','0','376','productController.php?do=edit&id=376'); -- id=482
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('482', '382', '1910', '','0'); -- id=482
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2104988.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('482', '121', '1910', '','0'); -- id=482
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1070779.52', 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 = '1', productBuyPrice = '191.00', productSellAllPrice = '195.00', productSellUnitPrice = '205.00', productSellHalfPrice = '195.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00376',type ='0', expireDate = '0' , dailyentryId = '482',isService = '0',isOptic = '0',lastbuyprice = '191',lastbuyprice_withDiscount = '191',meanbuyprice = '191',meanbuyprice_withDiscount = '191' , productbuypricereal = '191' , buypricereal_precentage = '0' , buytotal_precentage = '2.09' , buyhalf_precentage = '2.09' , buypart_precentage = '7.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='191',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='191',meanbuyprice_withTax='191',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='191',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '376';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 07:38:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 11:08:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 11:08:48', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1276
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 08:57:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 12:27:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 12:27:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 08:57:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 12:27:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 12:27:29', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1278
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','45','48','50','48','2026-09-17','0','1','0','','0','0','0','0','0','45','45','45','45','45','0','6.67','6.67','11.11','.','0','0','0','45','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','45','45','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','45','0','0','0','0','0','0','','','0','0','0','0'); -- id=377
UPDATE product SET productName = 'باره نحاس ', productDescription = '', productCatId = '6', productBuyPrice = '45', productSellAllPrice = '48', productSellUnitPrice = '50', productSellHalfPrice = '48', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00377',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '45',lastbuyprice_withDiscount = '45',meanbuyprice = '45',meanbuyprice_withDiscount = '45' , productbuypricereal = '45' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '6.67' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='45',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='45',meanbuyprice_withTax='45',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='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 = '377';
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', '377', '1.00', '2026-09-17', '1', '0','0037701','48','48','50','45','','0','0','0','0','0','0','0','0','0','0'); -- id=377
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('377', '1', '38', '1', '2026-09-17'); -- id=377
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('377', '1', '38', '0', '377', 'إضافة منتج', 'productController.php', '0', '38', '1', '2026-09-17','0','0'); -- id=663
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (377, 1,'2026-09-17 12:27:31',1)
                ON DUPLICATE KEY UPDATE productid = 377, edited = 1, sysdate = '2026-09-17 12:27:31', userid = 1; -- id=434
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1710', '1710', '2026-09-17', '1', '0', '0', '2026-09-17 12:27:31','إضافة منتج باره نحاس  الكمية 38','1','0','0','0','377','productController.php?do=edit&id=377'); -- id=483
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('483', '382', '1710', '','0'); -- id=483
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2106698.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('483', '121', '1710', '','0'); -- id=483
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1072489.52', 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 = '6', productBuyPrice = '45.00', productSellAllPrice = '48.00', productSellUnitPrice = '50.00', productSellHalfPrice = '48.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00377',type ='0', expireDate = '0' , dailyentryId = '483',isService = '0',isOptic = '0',lastbuyprice = '45',lastbuyprice_withDiscount = '45',meanbuyprice = '45',meanbuyprice_withDiscount = '45' , productbuypricereal = '45' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '6.67' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='45',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='45',meanbuyprice_withTax='45',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='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 = '377';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 08:57:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 12:27:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 12:27:33', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:29:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 12:59:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 12:59:13', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1280
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 ('ابليك موديل 2532 اسمر مستورد','','16','425','450','485','450','2026-09-17','0','1','3','','0','0','0','0','0','425','425','425','425','425','0','5.88','5.88','14.12','.','0','0','0','425','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','425','425','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','425','0','0','0','0','0','0','','','0','0','0','0'); -- id=378
UPDATE product SET productName = 'ابليك موديل 2532 اسمر مستورد', productDescription = '', productCatId = '16', productBuyPrice = '425', productSellAllPrice = '450', productSellUnitPrice = '485', productSellHalfPrice = '450', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '3', parcode = '00378',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '425',lastbuyprice_withDiscount = '425',meanbuyprice = '425',meanbuyprice_withDiscount = '425' , productbuypricereal = '425' , buypricereal_precentage = '0' , buytotal_precentage = '5.88' , buyhalf_precentage = '5.88' , buypart_precentage = '14.12',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='425',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='425',meanbuyprice_withTax='425',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='425',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '378';
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', '378', '1.00', '2026-09-17', '1', '0','0037801','450','450','485','425','','0','0','0','0','0','0','0','0','0','0'); -- id=378
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('378', '1', '15', '1', '2026-09-17'); -- id=378
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('378', '1', '15', '0', '378', 'إضافة منتج', 'productController.php', '0', '15', '1', '2026-09-17','0','0'); -- id=664
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (378, 1,'2026-09-17 12:59:15',1)
                ON DUPLICATE KEY UPDATE productid = 378, edited = 1, sysdate = '2026-09-17 12:59:15', userid = 1; -- id=435
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6375', '6375', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:15','إضافة منتج ابليك موديل 2532 اسمر مستورد الكمية 15','1','0','0','0','378','productController.php?do=edit&id=378'); -- id=484
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('484', '382', '6375', '','0'); -- id=484
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2113073.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('484', '121', '6375', '','0'); -- id=484
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1078864.52', 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 = 'ابليك موديل 2532 اسمر مستورد', productDescription = '', productCatId = '16', productBuyPrice = '425.00', productSellAllPrice = '450.00', productSellUnitPrice = '485.00', productSellHalfPrice = '450.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '3', parcode = '00378',type ='0', expireDate = '0' , dailyentryId = '484',isService = '0',isOptic = '0',lastbuyprice = '425',lastbuyprice_withDiscount = '425',meanbuyprice = '425',meanbuyprice_withDiscount = '425' , productbuypricereal = '425' , buypricereal_precentage = '0' , buytotal_precentage = '5.88' , buyhalf_precentage = '5.88' , buypart_precentage = '14.12',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='425',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='425',meanbuyprice_withTax='425',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='425',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '378';
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 ('ابليك موديل 2532 دهبي مستورد','','16','450','475','495','475','2026-09-17','0','1','3','','0','0','0','0','0','450','450','450','450','450','0','5.56','5.56','10','.','0','0','0','450','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','450','450','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','450','0','0','0','0','0','0','','','0','0','0','0'); -- id=379
UPDATE product SET productName = 'ابليك موديل 2532 دهبي مستورد', productDescription = '', productCatId = '16', productBuyPrice = '450', productSellAllPrice = '475', productSellUnitPrice = '495', productSellHalfPrice = '475', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '3', parcode = '00379',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '10',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '379';
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', '379', '1.00', '2026-09-17', '1', '0','0037901','475','475','495','450','','0','0','0','0','0','0','0','0','0','0'); -- id=379
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('379', '1', '15', '1', '2026-09-17'); -- id=379
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('379', '1', '15', '0', '379', 'إضافة منتج', 'productController.php', '0', '15', '1', '2026-09-17','0','0'); -- id=665
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (379, 1,'2026-09-17 12:59:17',1)
                ON DUPLICATE KEY UPDATE productid = 379, edited = 1, sysdate = '2026-09-17 12:59:17', userid = 1; -- id=436
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6750', '6750', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:17','إضافة منتج ابليك موديل 2532 دهبي مستورد الكمية 15','1','0','0','0','379','productController.php?do=edit&id=379'); -- id=485
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('485', '382', '6750', '','0'); -- id=485
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2119823.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('485', '121', '6750', '','0'); -- id=485
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1085614.52', 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 = 'ابليك موديل 2532 دهبي مستورد', productDescription = '', productCatId = '16', productBuyPrice = '450.00', productSellAllPrice = '475.00', productSellUnitPrice = '495.00', productSellHalfPrice = '475.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '3', parcode = '00379',type ='0', expireDate = '0' , dailyentryId = '485',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '10',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '379';
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 ('نجفه ليد موديل 3037 اسمر مستورد ','','16','1400','1450','1650','1450','2026-09-17','0','1','0','','0','0','0','0','0','1400','1400','1400','1400','1400','0','3.57','3.57','17.86','.','0','0','0','1400','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1400','1400','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1400','0','0','0','0','0','0','','','0','0','0','0'); -- id=380
UPDATE product SET productName = 'نجفه ليد موديل 3037 اسمر مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1400', productSellAllPrice = '1450', productSellUnitPrice = '1650', productSellHalfPrice = '1450', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00380',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1400',lastbuyprice_withDiscount = '1400',meanbuyprice = '1400',meanbuyprice_withDiscount = '1400' , productbuypricereal = '1400' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '3.57' , buypart_precentage = '17.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1400',meanbuyprice_withTax='1400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '380';
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', '380', '1.00', '2026-09-17', '1', '0','0038001','1450','1450','1650','1400','','0','0','0','0','0','0','0','0','0','0'); -- id=380
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('380', '1', '2', '1', '2026-09-17'); -- id=380
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('380', '1', '2', '0', '380', 'إضافة منتج', 'productController.php', '0', '2', '1', '2026-09-17','0','0'); -- id=666
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (380, 1,'2026-09-17 12:59:18',1)
                ON DUPLICATE KEY UPDATE productid = 380, edited = 1, sysdate = '2026-09-17 12:59:18', userid = 1; -- id=437
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2800', '2800', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:18','إضافة منتج نجفه ليد موديل 3037 اسمر مستورد  الكمية 2','1','0','0','0','380','productController.php?do=edit&id=380'); -- id=486
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('486', '382', '2800', '','0'); -- id=486
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2122623.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('486', '121', '2800', '','0'); -- id=486
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1088414.52', 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 = 'نجفه ليد موديل 3037 اسمر مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1400.00', productSellAllPrice = '1450.00', productSellUnitPrice = '1650.00', productSellHalfPrice = '1450.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00380',type ='0', expireDate = '0' , dailyentryId = '486',isService = '0',isOptic = '0',lastbuyprice = '1400',lastbuyprice_withDiscount = '1400',meanbuyprice = '1400',meanbuyprice_withDiscount = '1400' , productbuypricereal = '1400' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '3.57' , buypart_precentage = '17.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1400',meanbuyprice_withTax='1400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '380';
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 ('نجفه موديل k18 اسمر ثلاثي مستورد ','','16','1800','1900','2150','1900','2026-09-17','0','1','1','','0','0','0','0','0','1800','1800','1800','1800','1800','0','5.56','5.56','19.44','.','0','0','0','1800','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1800','1800','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1800','0','0','0','0','0','0','','','0','0','0','0'); -- id=381
UPDATE product SET productName = 'نجفه موديل k18 اسمر ثلاثي مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1800', productSellAllPrice = '1900', productSellUnitPrice = '2150', productSellHalfPrice = '1900', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00381',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1800',lastbuyprice_withDiscount = '1800',meanbuyprice = '1800',meanbuyprice_withDiscount = '1800' , productbuypricereal = '1800' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '19.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1800',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1800',meanbuyprice_withTax='1800',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1800',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '381';
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', '381', '1.00', '2026-09-17', '1', '0','0038101','1900','1900','2150','1800','','0','0','0','0','0','0','0','0','0','0'); -- id=381
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('381', '1', '5', '1', '2026-09-17'); -- id=381
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('381', '1', '5', '0', '381', 'إضافة منتج', 'productController.php', '0', '5', '1', '2026-09-17','0','0'); -- id=667
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (381, 1,'2026-09-17 12:59:20',1)
                ON DUPLICATE KEY UPDATE productid = 381, edited = 1, sysdate = '2026-09-17 12:59:20', userid = 1; -- id=438
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9000', '9000', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:21','إضافة منتج نجفه موديل k18 اسمر ثلاثي مستورد  الكمية 5','1','0','0','0','381','productController.php?do=edit&id=381'); -- id=487
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('487', '382', '9000', '','0'); -- id=487
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2131623.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('487', '121', '9000', '','0'); -- id=487
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1097414.52', 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 = 'نجفه موديل k18 اسمر ثلاثي مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1800.00', productSellAllPrice = '1900.00', productSellUnitPrice = '2150.00', productSellHalfPrice = '1900.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00381',type ='0', expireDate = '0' , dailyentryId = '487',isService = '0',isOptic = '0',lastbuyprice = '1800',lastbuyprice_withDiscount = '1800',meanbuyprice = '1800',meanbuyprice_withDiscount = '1800' , productbuypricereal = '1800' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '19.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1800',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1800',meanbuyprice_withTax='1800',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1800',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '381';
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 ('نجفه موديل 3037 شامبين مستورد ','','16','1400','1450','1650','1450','2026-09-17','0','1','0','','0','0','0','0','0','1400','1400','1400','1400','1400','0','3.57','3.57','17.86','.','0','0','0','1400','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1400','1400','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1400','0','0','0','0','0','0','','','0','0','0','0'); -- id=382
UPDATE product SET productName = 'نجفه موديل 3037 شامبين مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1400', productSellAllPrice = '1450', productSellUnitPrice = '1650', productSellHalfPrice = '1450', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00382',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1400',lastbuyprice_withDiscount = '1400',meanbuyprice = '1400',meanbuyprice_withDiscount = '1400' , productbuypricereal = '1400' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '3.57' , buypart_precentage = '17.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1400',meanbuyprice_withTax='1400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '382';
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', '382', '1.00', '2026-09-17', '1', '0','0038201','1450','1450','1650','1400','','0','0','0','0','0','0','0','0','0','0'); -- id=382
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('382', '1', '6', '1', '2026-09-17'); -- id=382
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('382', '1', '6', '0', '382', 'إضافة منتج', 'productController.php', '0', '6', '1', '2026-09-17','0','0'); -- id=668
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (382, 1,'2026-09-17 12:59:23',1)
                ON DUPLICATE KEY UPDATE productid = 382, edited = 1, sysdate = '2026-09-17 12:59:23', userid = 1; -- id=439
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8400', '8400', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:23','إضافة منتج نجفه موديل 3037 شامبين مستورد  الكمية 6','1','0','0','0','382','productController.php?do=edit&id=382'); -- id=488
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('488', '382', '8400', '','0'); -- id=488
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2140023.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('488', '121', '8400', '','0'); -- id=488
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1105814.52', 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 = 'نجفه موديل 3037 شامبين مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1400.00', productSellAllPrice = '1450.00', productSellUnitPrice = '1650.00', productSellHalfPrice = '1450.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00382',type ='0', expireDate = '0' , dailyentryId = '488',isService = '0',isOptic = '0',lastbuyprice = '1400',lastbuyprice_withDiscount = '1400',meanbuyprice = '1400',meanbuyprice_withDiscount = '1400' , productbuypricereal = '1400' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '3.57' , buypart_precentage = '17.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1400',meanbuyprice_withTax='1400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '382';
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 ('دلايه ليد مفرد اسمر موديل k18 مفرد ','','16','450','475','510','475','2026-09-17','0','1','0','','0','0','0','0','0','450','450','450','450','450','0','5.56','5.56','13.33','.','0','0','0','450','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','450','450','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','450','0','0','0','0','0','0','','','0','0','0','0'); -- id=383
UPDATE product SET productName = 'دلايه ليد مفرد اسمر موديل k18 مفرد ', productDescription = '', productCatId = '16', productBuyPrice = '450', productSellAllPrice = '475', productSellUnitPrice = '510', productSellHalfPrice = '475', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00383',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '13.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '383';
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', '383', '1.00', '2026-09-17', '1', '0','0038301','475','475','510','450','','0','0','0','0','0','0','0','0','0','0'); -- id=383
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('383', '1', '10', '1', '2026-09-17'); -- id=383
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('383', '1', '10', '0', '383', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-17','0','0'); -- id=669
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (383, 1,'2026-09-17 12:59:25',1)
                ON DUPLICATE KEY UPDATE productid = 383, edited = 1, sysdate = '2026-09-17 12:59:25', userid = 1; -- id=440
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4500', '4500', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:25','إضافة منتج دلايه ليد مفرد اسمر موديل k18 مفرد  الكمية 10','1','0','0','0','383','productController.php?do=edit&id=383'); -- id=489
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('489', '382', '4500', '','0'); -- id=489
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2144523.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('489', '121', '4500', '','0'); -- id=489
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1110314.52', 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 = 'دلايه ليد مفرد اسمر موديل k18 مفرد ', productDescription = '', productCatId = '16', productBuyPrice = '450.00', productSellAllPrice = '475.00', productSellUnitPrice = '510.00', productSellHalfPrice = '475.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00383',type ='0', expireDate = '0' , dailyentryId = '489',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '5.56' , buypart_precentage = '13.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='450',meanbuyprice_withTax='450',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '383';
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 ('دلايه ليد مفرد اسمر موديل k36 مفرد ','','16','350','375','400','375','2026-09-17','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','7.14','7.14','14.29','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=384
UPDATE product SET productName = 'دلايه ليد مفرد اسمر موديل k36 مفرد ', productDescription = '', productCatId = '16', productBuyPrice = '350', productSellAllPrice = '375', productSellUnitPrice = '400', productSellHalfPrice = '375', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00384',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '7.14' , buyhalf_precentage = '7.14' , buypart_precentage = '14.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '384';
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', '384', '1.00', '2026-09-17', '1', '0','0038401','375','375','400','350','','0','0','0','0','0','0','0','0','0','0'); -- id=384
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('384', '1', '10', '1', '2026-09-17'); -- id=384
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('384', '1', '10', '0', '384', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-17','0','0'); -- id=670
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (384, 1,'2026-09-17 12:59:27',1)
                ON DUPLICATE KEY UPDATE productid = 384, edited = 1, sysdate = '2026-09-17 12:59:27', userid = 1; -- id=441
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3500', '3500', '2026-09-17', '1', '0', '0', '2026-09-17 12:59:27','إضافة منتج دلايه ليد مفرد اسمر موديل k36 مفرد  الكمية 10','1','0','0','0','384','productController.php?do=edit&id=384'); -- id=490
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('490', '382', '3500', '','0'); -- id=490
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148023.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('490', '121', '3500', '','0'); -- id=490
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1113814.52', 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 = 'دلايه ليد مفرد اسمر موديل k36 مفرد ', productDescription = '', productCatId = '16', productBuyPrice = '350.00', productSellAllPrice = '375.00', productSellUnitPrice = '400.00', productSellHalfPrice = '375.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00384',type ='0', expireDate = '0' , dailyentryId = '490',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '7.14' , buyhalf_precentage = '7.14' , buypart_precentage = '14.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '384';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:29:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 12:59:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 12:59:29', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1281
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:33:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:03:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:03:34', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:33:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:03:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:03:54', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:34:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:04:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:04:01', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1284
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:40:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:10:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:10:56', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1285
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:41:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:11:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:11:06', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:41:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:11:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:11:17', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1287
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:41:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:11:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:11:23', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1288
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:41:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:11:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:11:38', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1289
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:41:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:11:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:11:45', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1290
UPDATE product SET productName = 'بواط صاج 20 في 20 حجازي', productDescription = '', productCatId = '13', productBuyPrice = '105.00', productSellAllPrice = '110.00', productSellUnitPrice = '110.00', productSellHalfPrice = '110.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00222',type ='0', expireDate = '0' , dailyentryId = '253',isService = '0',isOptic = '0',lastbuyprice = '105.00',lastbuyprice_withDiscount = '105',meanbuyprice = '105.00',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.76' , buyhalf_precentage = '4.76' , buypart_precentage = '4.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '222';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (222, 1,'2026-09-17 13:12:26',1)
                ON DUPLICATE KEY UPDATE productid = 222, edited = 1, sysdate = '2026-09-17 13:12:26', userid = 1; -- id=230
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:42:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:12:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:12:36', '1', 'executeOperation', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=executeOperation'); -- id=1291
BEGIN;
UPDATE dailyentry SET totalcreditor = '500.00', totaldebtor = '500.00', thedate = '2026-09-16', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-16 10:08:35', entryComment = 'إضافة منتج بواط صاج 20 في 20 حجازي  الكمية 5', fromFlag = '1',related='0',isopeningentry='0',operationId='281',operationDetailLink='productController.php?do=edit&id=281' WHERE id = '332';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500.00', '500.00', '2026-09-17', '1', '0', '332', '2026-09-17 13:12:37','تم عكس القيد رقم 332 ','1','0','0','0','0',''); -- id=491
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('491', '382', '500.00', '','0'); -- id=491
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2147523.85', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('491', '121', '500.00', '','0'); -- id=491
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1113314.52', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'بواط صاج 20 في 20 حجازي ', productDescription = '', productCatId = '13', productBuyPrice = '100.00', productSellAllPrice = '108.00', productSellUnitPrice = '108.00', productSellHalfPrice = '108.00', productDate = '2026-09-16', conditions = '2', userId = '1', limitamount = '0', parcode = '00281',type ='0', expireDate = '0' , dailyentryId = '491',isService = '0',isOptic = '0',lastbuyprice = '100.00',lastbuyprice_withDiscount = '100',meanbuyprice = '100.00',meanbuyprice_withDiscount = '100' , productbuypricereal = '100.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '8.00' , buypart_precentage = '8.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='100',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='100',meanbuyprice_withTax='100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '281';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (281, 2,'2026-09-17 13:12:38',1)
                ON DUPLICATE KEY UPDATE productid = 281, edited = 2, sysdate = '2026-09-17 13:12:38', userid = 1; -- id=295
DELETE FROM productingredients WHERE productId = '281';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:42:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:12:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:12:38', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=sucess'); -- id=1292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:42:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:12:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:12:40', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:42:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:12:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:12:46', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1294
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:42:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:12:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:12:59', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1295
UPDATE productunit SET proUnitSellAllPrice  = 4.00 * productnumber  WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.00', productSellAllPrice = '4.00', productSellUnitPrice = '4.00', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.00',meanbuyprice_withDiscount = '4' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4',meanbuyprice_withTax='4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:13',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:13', userid = 1; -- id=93
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '220', '220', '2026-09-17', '1', '0', '0', '2026-09-17 13:13:16','تعديل منتج (علبه ماجيك مفرد كوبرا ) السعر من (4.00) الى (4.5) و الكميه (440)','1','0',null,'0','89','productController.php?do=edit&id=89'); -- id=492
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('492', '382', '220', '','0'); -- id=492
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2147743.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('492', '53', '220', '','0'); -- id=492
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '397', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 4.5 * productnumber WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.5', productSellAllPrice = '4.00', productSellUnitPrice = '4.00', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:17',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:17', userid = 1; -- id=93
UPDATE productunit SET proUnitSellAllPrice  = 4.75 * productnumber  WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.50', productSellAllPrice = '4.75', productSellUnitPrice = '4.00', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:18',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:18', userid = 1; -- id=93
UPDATE productunit SET proUnitSellHalfPrice = 4.00 * productnumber WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.50', productSellAllPrice = '4.75', productSellUnitPrice = '4.00', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:19',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:19', userid = 1; -- id=93
UPDATE productunit SET proUnitSellUnitPrice = 4.9 * productnumber WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.50', productSellAllPrice = '4.75', productSellUnitPrice = '4.9', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:22',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:22', userid = 1; -- id=93
UPDATE productunit SET proUnitSellHalfPrice = 4.00 * productnumber WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.50', productSellAllPrice = '4.75', productSellUnitPrice = '4.90', productSellHalfPrice = '4.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:23',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:23', userid = 1; -- id=93
UPDATE productunit SET proUnitSellHalfPrice = 4.75 * productnumber WHERE productid = 89;
UPDATE product SET productName = 'علبه ماجيك مفرد كوبرا ', productDescription = '', productCatId = '12', productBuyPrice = '4.50', productSellAllPrice = '4.75', productSellUnitPrice = '4.90', productSellHalfPrice = '4.75', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00089',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.00',lastbuyprice_withDiscount = '4',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.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='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '89';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-17 13:13:34',1)
                ON DUPLICATE KEY UPDATE productid = 89, edited = 1, sysdate = '2026-09-17 13:13:34', userid = 1; -- id=93
UPDATE product SET productName = 'علبه ماجيك مجوز شاشه مصطفي محمود', productDescription = '', productCatId = '12', productBuyPrice = '11.10', productSellAllPrice = '11.30', productSellUnitPrice = '11.30', productSellHalfPrice = '11.30', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00088',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '11.10',lastbuyprice_withDiscount = '11.1',meanbuyprice = '11.10',meanbuyprice_withDiscount = '11.1' , productbuypricereal = '11.10' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.80' , buyhalf_precentage = '1.80' , buypart_precentage = '1.80',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='11.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='11.1',meanbuyprice_withTax='11.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='11.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 = '88';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (88, 1,'2026-09-17 13:13:38',1)
                ON DUPLICATE KEY UPDATE productid = 88, edited = 1, sysdate = '2026-09-17 13:13:38', userid = 1; -- id=92
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:44:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:14:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:14:13', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:44:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:14:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:14:39', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1297
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:45:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:15:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:15:22', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1298
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 ('علبه ماجيك مجوز احمد ومحمود','','12','8.5','9.5','9.8','9.5','2026-09-17','0','1','0','','0','0','0','0','0','8.5','8.5','8.5','8.5','8.5','0','11.76','11.76','15.29','.','0','0','0','8.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','8.5','8.5','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','8.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=385
UPDATE product SET productName = 'علبه ماجيك مجوز احمد ومحمود', productDescription = '', productCatId = '12', productBuyPrice = '8.5', productSellAllPrice = '9.5', productSellUnitPrice = '9.8', productSellHalfPrice = '9.5', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00385',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '8.5',lastbuyprice_withDiscount = '8.5',meanbuyprice = '8.5',meanbuyprice_withDiscount = '8.5' , productbuypricereal = '8.5' , buypricereal_precentage = '0' , buytotal_precentage = '11.76' , buyhalf_precentage = '11.76' , buypart_precentage = '15.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='8.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='8.5',meanbuyprice_withTax='8.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='8.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 = '385';
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', '385', '1.00', '2026-09-17', '1', '0','0038501','9.5','9.5','9.8','8.5','','0','0','0','0','0','0','0','0','0','0'); -- id=385
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('385', '1', '40', '1', '2026-09-17'); -- id=385
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('385', '1', '40', '0', '385', 'إضافة منتج', 'productController.php', '0', '40', '1', '2026-09-17','0','0'); -- id=671
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (385, 1,'2026-09-17 13:15:24',1)
                ON DUPLICATE KEY UPDATE productid = 385, edited = 1, sysdate = '2026-09-17 13:15:24', userid = 1; -- id=452
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '340', '340', '2026-09-17', '1', '0', '0', '2026-09-17 13:15:24','إضافة منتج علبه ماجيك مجوز احمد ومحمود الكمية 40','1','0','0','0','385','productController.php?do=edit&id=385'); -- id=493
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('493', '382', '340', '','0'); -- id=493
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148083.85', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('493', '121', '340', '','0'); -- id=493
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1113654.52', 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 = '12', productBuyPrice = '8.50', productSellAllPrice = '9.50', productSellUnitPrice = '9.80', productSellHalfPrice = '9.50', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00385',type ='0', expireDate = '0' , dailyentryId = '493',isService = '0',isOptic = '0',lastbuyprice = '8.5',lastbuyprice_withDiscount = '8.5',meanbuyprice = '8.5',meanbuyprice_withDiscount = '8.5' , productbuypricereal = '8.5' , buypricereal_precentage = '0' , buytotal_precentage = '11.76' , buyhalf_precentage = '11.76' , buypart_precentage = '15.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='8.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='8.5',meanbuyprice_withTax='8.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='8.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 = '385';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 09:45:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:15:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 13:15:26', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:09:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:39:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:39:51', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:10:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:40:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:40:15', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=1301
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:11:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:41:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 13:41:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=1302
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:11:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:41:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 13:41:17', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=1303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:11:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:41:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:41:26', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=29'); -- id=1304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:11:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:41:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:41:36', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1305
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:11:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:41:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:41:48', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1306
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:12:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:42:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:42:00', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=29'); -- id=1307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:12:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 13:42:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 13:42:25', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:33:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:03:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:03:42', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1309
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:34:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:04:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:04:49', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1310
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('مفتاح سخان 20 امبير ','','3','78.4','80','82.5','80','2026-09-17','0','1','0','','0','0','0','0','0','78.4','78.4','78.4','78.4','78.4','0','2.04','2.04','5.23','.','0','0','0','78.4','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','78.4','78.4','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','78.4','0','0','0','0','0','0','','','0','0','0','0'); -- id=386
UPDATE product SET productName = 'مفتاح سخان 20 امبير ', productDescription = '', productCatId = '3', productBuyPrice = '78.4', productSellAllPrice = '80', productSellUnitPrice = '82.5', productSellHalfPrice = '80', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00386',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '78.4',lastbuyprice_withDiscount = '78.4',meanbuyprice = '78.4',meanbuyprice_withDiscount = '78.4' , productbuypricereal = '78.4' , buypricereal_precentage = '0' , buytotal_precentage = '2.04' , buyhalf_precentage = '2.04' , buypart_precentage = '5.23',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='78.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='78.4',meanbuyprice_withTax='78.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='78.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '386';
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', '386', '1.00', '2026-09-17', '1', '0','0038601','80','80','82.5','78.4','','0','0','0','0','0','0','0','0','0','0'); -- id=386
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('386', '1', '4', '1', '2026-09-17'); -- id=386
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('386', '1', '4', '0', '386', 'إضافة منتج', 'productController.php', '0', '4', '1', '2026-09-17','0','0'); -- id=672
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (386, 1,'2026-09-17 14:04:50',1)
                ON DUPLICATE KEY UPDATE productid = 386, edited = 1, sysdate = '2026-09-17 14:04:50', userid = 1; -- id=453
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '313.6', '313.6', '2026-09-17', '1', '0', '0', '2026-09-17 14:04:50','إضافة منتج مفتاح سخان 20 امبير  الكمية 4','1','0','0','0','386','productController.php?do=edit&id=386'); -- id=494
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('494', '382', '313.6', '','0'); -- id=494
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148397.45', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('494', '121', '313.6', '','0'); -- id=494
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1113968.12', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'مفتاح سخان 20 امبير ', productDescription = '', productCatId = '3', productBuyPrice = '78.40', productSellAllPrice = '80.00', productSellUnitPrice = '82.50', productSellHalfPrice = '80.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00386',type ='0', expireDate = '0' , dailyentryId = '494',isService = '0',isOptic = '0',lastbuyprice = '78.4',lastbuyprice_withDiscount = '78.4',meanbuyprice = '78.4',meanbuyprice_withDiscount = '78.4' , productbuypricereal = '78.4' , buypricereal_precentage = '0' , buytotal_precentage = '2.04' , buyhalf_precentage = '2.04' , buypart_precentage = '5.23',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='78.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='78.4',meanbuyprice_withTax='78.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='78.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '386';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:34:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:04:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:04:53', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:40:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:10:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:10:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1312
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.7 اسمر داخل ','','7','83','90','93','90','2026-09-17','0','1','0','','0','0','0','0','0','83','83','83','83','83','0','8.43','8.43','12.05','.','0','0','0','83','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','83','83','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','83','0','0','0','0','0','0','','','0','0','0','0'); -- id=387
UPDATE product SET productName = 'عود بروفايل 1.7 اسمر داخل ', productDescription = '', productCatId = '7', productBuyPrice = '83', productSellAllPrice = '90', productSellUnitPrice = '93', productSellHalfPrice = '90', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00387',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '83',lastbuyprice_withDiscount = '83',meanbuyprice = '83',meanbuyprice_withDiscount = '83' , productbuypricereal = '83' , buypricereal_precentage = '0' , buytotal_precentage = '8.43' , buyhalf_precentage = '8.43' , buypart_precentage = '12.05',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='83',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='83',meanbuyprice_withTax='83',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='83',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '387';
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', '387', '1.00', '2026-09-17', '1', '0','0038701','90','90','93','83','','0','0','0','0','0','0','0','0','0','0'); -- id=387
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('387', '1', '12', '1', '2026-09-17'); -- id=387
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '12', '0', '387', 'إضافة منتج', 'productController.php', '0', '12', '1', '2026-09-17','0','0'); -- id=673
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (387, 1,'2026-09-17 14:11:00',1)
                ON DUPLICATE KEY UPDATE productid = 387, edited = 1, sysdate = '2026-09-17 14:11:00', userid = 1; -- id=454
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '996', '996', '2026-09-17', '1', '0', '0', '2026-09-17 14:11:00','إضافة منتج عود بروفايل 1.7 اسمر داخل  الكمية 12','1','0','0','0','387','productController.php?do=edit&id=387'); -- id=495
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('495', '382', '996', '','0'); -- id=495
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2149393.45', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('495', '121', '996', '','0'); -- id=495
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1114964.12', 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.7 اسمر داخل ', productDescription = '', productCatId = '7', productBuyPrice = '83.00', productSellAllPrice = '90.00', productSellUnitPrice = '93.00', productSellHalfPrice = '90.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00387',type ='0', expireDate = '0' , dailyentryId = '495',isService = '0',isOptic = '0',lastbuyprice = '83',lastbuyprice_withDiscount = '83',meanbuyprice = '83',meanbuyprice_withDiscount = '83' , productbuypricereal = '83' , buypricereal_precentage = '0' , buytotal_precentage = '8.43' , buyhalf_precentage = '8.43' , buypart_precentage = '12.05',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='83',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='83',meanbuyprice_withTax='83',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='83',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '387';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:41:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:11:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:11:03', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1313
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:41:24";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:11:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:11:24', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1314
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 ('06aabd8d7d12a1', '2026-09-17 14:11:03', '1', '0.43', '992.43', '0', '0', '992.00',  '992.00', '', '992', '1', '2026-09-17 14:11:25', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=5
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00291', '5', '24', '291', '40', '24.8', '992.00', '0', '', '2026-09-17 14:11:25', '291','','','0','0','0','0','0',null,'24.8','992','0','0','0','0','0','0','0','0','1'); -- id=15
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 14:11:03', 1, 291, 0, 0
                    , 24.8, 40, 0, 0, 1, '2026-09-17 14:11:25')
                ON DUPLICATE KEY UPDATE buyprice = 24.8,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 14:11:25' ; -- id=15
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('291', '24.8', '40', '0', 'buyBillController.php', '15', '', '0', '0'); -- id=15
UPDATE product SET  productBuyPrice = "24.8" WHERE productId = 291 ;
UPDATE buybilldetail SET  quantitybefore = 78 WHERE buybilldetailid = 15 ;
UPDATE product SET productName = 'فيشه دكر ', productDescription = '', productCatId = '24', productBuyPrice = '24.80', productSellAllPrice = '25.80', productSellUnitPrice = '28.00', productSellHalfPrice = '25.80', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00291',type ='0', expireDate = '0' , dailyentryId = '342',isService = '0',isOptic = '0',lastbuyprice = '24.8',lastbuyprice_withDiscount = '24.8',meanbuyprice = '24.8',meanbuyprice_withDiscount = '24.8' , productbuypricereal = '24.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.03' , buyhalf_precentage = '4.03' , buypart_precentage = '12.90',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='24.8',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='24.8',meanbuyprice_withTax='24.8',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='24.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '291';
UPDATE buybilldetail SET  lastbuyprice = 24.8 , meanbuyprice = 24.8, lastbuyprice_withDiscount = 24.8, meanbuyprice_withDiscount = 24.8
        , lastbuyprice_withTax = 24.8, meanbuyprice_withTax = 24.8, lastbuyprice_withDiscountAndTax = 24.8
                where buybilldetailid = 15;
UPDATE productunit SET proUnitBuyPrice  = 24.8 * productnumber WHERE productid = 291;
UPDATE storedetail SET  productquantity = '118', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('291', '1', '40', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '78', '118', '1', '2026-09-17 14:11:03','0','0'); -- id=674
UPDATE supplier SET  suppliercurrentDebt = '992.43',suppliercurrentDebtInCurrency= '992.43' , userid = '1', supplierdate = '2026-09-17 14:11:25'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '0.43', '992', '0', 'اضافة فاتورة مشتريات', '5', '992.43', '2026-09-17 14:11:03', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','992','1','0.43','992','992.43','0',''); -- id=17
update buybill set dailyentryid='0,0' where buybillid=5;
COMMIT;
UPDATE product SET overAllAveragePrice = 24.8 WHERE productId = 291;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:41:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:11:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:11:26', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=5'); -- id=1315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:41:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:11:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:11:52', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1316
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:41:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:11:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:11:56', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1317
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:42:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:12:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 14:12:05', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1318
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:42:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:12:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:12:44', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:43:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:13:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:13:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1320
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('علبه ماجيك مفرد ','','20','4.75','4.96','4.96','4.96','2026-09-17','0','1','0','','0','0','0','0','0','4.75','4.75','4.75','4.75','4.75','0','4.42','4.42','4.42','.','0','0','0','4.75','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','4.75','4.75','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','4.75','0','0','0','0','0','0','','','0','0','0','0'); -- id=388
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.75', productSellAllPrice = '4.96', productSellUnitPrice = '4.96', productSellHalfPrice = '4.96', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.75',meanbuyprice_withDiscount = '4.75' , productbuypricereal = '4.75' , buypricereal_precentage = '0' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.75',meanbuyprice_withTax='4.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
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', '388', '1.00', '2026-09-17', '1', '0','0038801','4.96','4.96','4.96','4.75','','0','0','0','0','0','0','0','0','0','0'); -- id=388
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('388', '1', '25', '1', '2026-09-17'); -- id=388
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '25', '0', '388', 'إضافة منتج', 'productController.php', '0', '25', '1', '2026-09-17','0','0'); -- id=675
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (388, 1,'2026-09-17 14:13:17',1)
                ON DUPLICATE KEY UPDATE productid = 388, edited = 1, sysdate = '2026-09-17 14:13:17', userid = 1; -- id=455
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '118.75', '118.75', '2026-09-17', '1', '0', '0', '2026-09-17 14:13:17','إضافة منتج علبه ماجيك مفرد  الكمية 25','1','0','0','0','388','productController.php?do=edit&id=388'); -- id=496
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('496', '382', '118.75', '','0'); -- id=496
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2149512.2', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('496', '121', '118.75', '','0'); -- id=496
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1115082.87', 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 = '20', productBuyPrice = '4.75', productSellAllPrice = '4.96', productSellUnitPrice = '4.96', productSellHalfPrice = '4.96', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.75',meanbuyprice_withDiscount = '4.75' , productbuypricereal = '4.75' , buypricereal_precentage = '0' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.75',meanbuyprice_withTax='4.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:43:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:13:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:13:19', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1321
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:44:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:14:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:14:00', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1322
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:44:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:14:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 14:14:09', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1323
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1.75', '1.75', '2026-09-17', '1', '0', '0', '2026-09-17 14:14:26','تعديل منتج (علبه ماجيك مفرد ) السعر من (4.75) الى (4.82) و الكميه (25)','1','0',null,'0','388','productController.php?do=edit&id=388'); -- id=497
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('497', '382', '1.75', '','0'); -- id=497
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2149513.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('497', '53', '1.75', '','0'); -- id=497
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '398.75', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 4.82 * productnumber WHERE productid = 388;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.82', productSellAllPrice = '4.96', productSellUnitPrice = '4.96', productSellHalfPrice = '4.96', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.79',meanbuyprice_withDiscount = '4.79' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.79',meanbuyprice_withTax='4.79',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (388, 1,'2026-09-17 14:14:27',1)
                ON DUPLICATE KEY UPDATE productid = 388, edited = 1, sysdate = '2026-09-17 14:14:27', userid = 1; -- id=455
UPDATE productunit SET proUnitSellAllPrice  = 5 * productnumber  WHERE productid = 388;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.82', productSellAllPrice = '5', productSellUnitPrice = '4.96', productSellHalfPrice = '4.96', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.79',meanbuyprice_withDiscount = '4.79' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.79',meanbuyprice_withTax='4.79',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (388, 1,'2026-09-17 14:14:29',1)
                ON DUPLICATE KEY UPDATE productid = 388, edited = 1, sysdate = '2026-09-17 14:14:29', userid = 1; -- id=455
UPDATE productunit SET proUnitSellHalfPrice = 5 * productnumber WHERE productid = 388;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.82', productSellAllPrice = '5.00', productSellUnitPrice = '4.96', productSellHalfPrice = '5', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.79',meanbuyprice_withDiscount = '4.79' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.79',meanbuyprice_withTax='4.79',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (388, 1,'2026-09-17 14:14:31',1)
                ON DUPLICATE KEY UPDATE productid = 388, edited = 1, sysdate = '2026-09-17 14:14:31', userid = 1; -- id=455
UPDATE productunit SET proUnitSellUnitPrice = 5.25 * productnumber WHERE productid = 388;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.82', productSellAllPrice = '5.00', productSellUnitPrice = '5.25', productSellHalfPrice = '5.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.75',lastbuyprice_withDiscount = '4.75',meanbuyprice = '4.79',meanbuyprice_withDiscount = '4.79' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.79',meanbuyprice_withTax='4.79',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.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 = '388';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (388, 1,'2026-09-17 14:14:35',1)
                ON DUPLICATE KEY UPDATE productid = 388, edited = 1, sysdate = '2026-09-17 14:14:35', userid = 1; -- id=455
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 10:44:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:14:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 14:14:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:02:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:32:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:32:44', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1325
UPDATE productunit SET unitid = '1', productid = '387', productnumber = '1.00', productunitdate = '2026-09-17', userid = '1', conditions = '0',proUnitParcode='0038701',proUnitSellAllPrice='90',proUnitSellHalfPrice='90',proUnitSellUnitPrice ='93',proUnitBuyPrice='83',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '387';
UPDATE product SET productName = 'عود بروفايل 1.7 اسمر داخل ', productDescription = '', productCatId = '7', productBuyPrice = '80', productSellAllPrice = '90', productSellUnitPrice = '93', productSellHalfPrice = '90', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00387',type ='0', expireDate = '0' , dailyentryId = '495',isService = '0',isOptic = '0',lastbuyprice = '83.00',lastbuyprice_withDiscount = '83',meanbuyprice = '83.00',meanbuyprice_withDiscount = '83' , productbuypricereal = '83' , buypricereal_precentage = '0' , buytotal_precentage = '8.43' , buyhalf_precentage = '8.43' , buypart_precentage = '12.05',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='83',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='83',meanbuyprice_withTax='83',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='83',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '387';
UPDATE productunit SET unitid = '1', productid = '318', productnumber = '1.00', productunitdate = '2026-09-16', userid = '1', conditions = '0',proUnitParcode='0031801',proUnitSellAllPrice='73',proUnitSellHalfPrice='73',proUnitSellUnitPrice ='75',proUnitBuyPrice='67.5',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '318';
UPDATE product SET productName = 'عود بروفايل 1.7 فضي ', productDescription = '', productCatId = '7', productBuyPrice = '69.5', productSellAllPrice = '73', productSellUnitPrice = '75', productSellHalfPrice = '73', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00318',type ='0', expireDate = '0' , dailyentryId = '384',isService = '0',isOptic = '0',lastbuyprice = '67.50',lastbuyprice_withDiscount = '67.5',meanbuyprice = '67.50',meanbuyprice_withDiscount = '67.5' , productbuypricereal = '67.5' , buypricereal_precentage = '0' , buytotal_precentage = '8.15' , buyhalf_precentage = '8.15' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='67.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='67.5',meanbuyprice_withTax='67.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='67.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '318';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:04:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:34:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:34:06', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1326
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 ('06aabdded582fa', '2026-09-17 14:32:45', '1', '992.43', '8467.43', '0', '0', '7475.00',  '7475.00', '', '7475', '1', '2026-09-17 14:34:07', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=6
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00387', '6', '7', '387', '50', '80', '4000.00', '0', '', '2026-09-17 14:34:07', '387','','','0','0','0','0','0',null,'80','4000','0','0','0','0','0','0','0','0','1'); -- id=16
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 14:32:45', 1, 387, 0, 0
                    , 80, 50, 0, 0, 1, '2026-09-17 14:34:07')
                ON DUPLICATE KEY UPDATE buyprice = 80,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 14:34:07' ; -- id=16
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('387', '80', '50', '0', 'buyBillController.php', '16', '', '0', '0'); -- id=16
UPDATE product SET  productBuyPrice = "80" WHERE productId = 387 ;
UPDATE buybilldetail SET  quantitybefore = 12 WHERE buybilldetailid = 16 ;
UPDATE product SET productName = 'عود بروفايل 1.7 اسمر داخل ', productDescription = '', productCatId = '7', productBuyPrice = '80.00', productSellAllPrice = '90.00', productSellUnitPrice = '93.00', productSellHalfPrice = '90.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00387',type ='0', expireDate = '0' , dailyentryId = '495',isService = '0',isOptic = '0',lastbuyprice = '80',lastbuyprice_withDiscount = '80',meanbuyprice = '80.58',meanbuyprice_withDiscount = '80.58' , productbuypricereal = '83.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.43' , buyhalf_precentage = '8.43' , buypart_precentage = '12.05',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='83',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='80',meanbuyprice_withTax='80.58',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='80',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '387';
UPDATE buybilldetail SET  lastbuyprice = 80 , meanbuyprice = 80.58, lastbuyprice_withDiscount = 80, meanbuyprice_withDiscount = 80.58
        , lastbuyprice_withTax = 80, meanbuyprice_withTax = 80.58, lastbuyprice_withDiscountAndTax = 80
                where buybilldetailid = 16;
UPDATE productunit SET proUnitBuyPrice  = 80 * productnumber WHERE productid = 387;
UPDATE storedetail SET  productquantity = '62', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '50', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '12', '62', '1', '2026-09-17 14:32:45','0','0'); -- id=676
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00318', '6', '7', '318', '50', '69.5', '3475.00', '0', '', '2026-09-17 14:34:07', '318','','','0','0','0','0','0',null,'69.5','3475','0','0','0','0','0','0','0','0','1'); -- id=17
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 14:32:45', 1, 318, 0, 0
                    , 69.5, 50, 0, 0, 1, '2026-09-17 14:34:08')
                ON DUPLICATE KEY UPDATE buyprice = 69.5,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 14:34:08' ; -- id=17
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('318', '69.5', '50', '0', 'buyBillController.php', '17', '', '0', '0'); -- id=17
UPDATE product SET  productBuyPrice = "69.5" WHERE productId = 318 ;
UPDATE buybilldetail SET  quantitybefore = 28 WHERE buybilldetailid = 17 ;
UPDATE product SET productName = 'عود بروفايل 1.7 فضي ', productDescription = '', productCatId = '7', productBuyPrice = '69.50', productSellAllPrice = '73.00', productSellUnitPrice = '75.00', productSellHalfPrice = '73.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00318',type ='0', expireDate = '0' , dailyentryId = '384',isService = '0',isOptic = '0',lastbuyprice = '69.5',lastbuyprice_withDiscount = '69.5',meanbuyprice = '68.78',meanbuyprice_withDiscount = '68.78' , productbuypricereal = '67.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.15' , buyhalf_precentage = '8.15' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='67.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='69.5',meanbuyprice_withTax='68.78',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='69.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '318';
UPDATE buybilldetail SET  lastbuyprice = 69.5 , meanbuyprice = 68.78, lastbuyprice_withDiscount = 69.5, meanbuyprice_withDiscount = 68.78
        , lastbuyprice_withTax = 69.5, meanbuyprice_withTax = 68.78, lastbuyprice_withDiscountAndTax = 69.5
                where buybilldetailid = 17;
UPDATE productunit SET proUnitBuyPrice  = 69.5 * productnumber WHERE productid = 318;
UPDATE storedetail SET  productquantity = '78', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '50', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '28', '78', '1', '2026-09-17 14:32:45','0','0'); -- id=677
UPDATE supplier SET  suppliercurrentDebt = '8467.43',suppliercurrentDebtInCurrency= '8467.43' , userid = '1', supplierdate = '2026-09-17 14:34:07'   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', '992.43', '7475', '0', 'اضافة فاتورة مشتريات', '6', '8467.43', '2026-09-17 14:32:45', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7475','1','992.43','7475','8467.43','0',''); -- id=18
update buybill set dailyentryid='0,0' where buybillid=6;
COMMIT;
UPDATE product SET overAllAveragePrice = 69.5 WHERE productId = 318;UPDATE product SET overAllAveragePrice = 80 WHERE productId = 387;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:04:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:34:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 14:34:09', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=6'); -- id=1327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:04:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:34:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-17 14:34:46', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=1328
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:04:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:34:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 14:34:53', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=1329
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:05:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:35:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 14:35:08', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=1330
BEGIN;
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', '8467.43', '8467.43', '1', 'ايصال دفع لمورد', '1', '0', '2026-09-17 14:34:53', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','8467.43','1','0','0','0','4',''); -- id=19
UPDATE supplierdebtchange SET supplierid = '1', supplierdebtchangebefore = '8467.43', supplierdebtchangeamount = '8467.43', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '0', supplierdebtchangedate = '2026-09-17 14:34:53', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='8467.43',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='8467.43',debtchangamountInSupplierCurrency='8467.43',debtchangafterInSupplierCurrency='0', paySerialNo='4',tagids='' WHERE supplierdebtchangeid = '19';
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-09-17 14:35:09'   WHERE supplierid = '1';
UPDATE save SET  savecurrentvalue = '-237265.48',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-228798.05','8467.43', '1', '1', 'ايصال دفع لمورد', '19', '-237265.48', '2026-09-17 14:35:09', '1',  'supplierPayedDeptController.php','0','','0'); -- id=32
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8467.43', '8467.43', '2026-09-17', '1', '0', '0', '2026-09-17 14:35:09','ايصال دفع لمورد ( مباشر ) ','1','0','0','0','19','supplierReportsController.php?do=show&id=19'); -- id=498
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('498', '-1', '8467.43', '','0'); -- id=498
UPDATE accountstree SET name = '', customName = '', customNameEn = '', nameEn = '', parent = null, accountNature = '0', theValue = '8467.43', theOrder = null, layingOrder = '', reportid = '0', listId = '0', notes = '', itemfrom = null, itemtype = null, itemtype2 = null, itemtype3 = '', userid = null, del = null, sysdate = '' WHERE id = null;
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('498', '383', '8467.43', '','0'); -- id=498
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-190573.48', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '1', supplierdebtchangebefore = '8467.43', supplierdebtchangeamount = '8467.43', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '0.00', supplierdebtchangedate = '2026-09-17 14:34:53', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '498',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='8467.43',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='8467.43',debtchangamountInSupplierCurrency='8467.43',debtchangafterInSupplierCurrency='0', paySerialNo='4',tagids='' WHERE supplierdebtchangeid = '19';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:05:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:35:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 14:35:10', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=1331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:05:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:35:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 14:35:12', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=1332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:05:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:35:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 14:35:13', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=1333
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:05:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 14:35:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 14:35:14', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:44:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:14:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:14:21', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1335
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:44:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:14:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:14:54', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1336

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aabe7ae8d1eb
-- ----------------------------------------------------------------------------------------------------

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-09-17 15:14:54', '06aabe7ae8d1eb', '1', '0.00', '0', '0', '1', '500.00', '500', '500', '0', '1', '2026-09-17 15:14:54', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','500','0','','0','0','500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=33
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','اضافة فاتورة مبيعات','33', '0', '2026-09-17 15:14:55', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 15:14:54','0','0','',''); -- 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 ('223','00162', '33', '22', '162', '2', '250', '500', '0', '', '1', '2026-09-17 15:14:55', '162', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','500','0','','0','0.00','0','0','0','0'); -- id=191
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 = 191;
 INSERT INTO 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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:14:55' WHERE storedetailid = '162';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '2', '1', '33', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '26', '1', '2026-09-17 15:14:55','0','0'); -- id=678
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-236765.484375',  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 ('-237265.484375','500', '0', '1', 'اضافة فاتورة مبيعات', '33', '-236765.484375', '2026-09-17 15:14:55', '1',  'sellbillController.php','1','','0'); -- id=33
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500', '500', '2026-09-17', '1', '0', '0', '2026-09-17 15:14:56','اضافة فاتورة مبيعات رقم 33','1','0',null,'0','33','sellbillController.php?do=showDetail&sellbillid=33'); -- id=499
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('499', '383', '500', '','0'); -- id=499
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-190073.48', 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 ('499', '143', '500', '','0'); -- id=499
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77840.29', 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 ( '446', '446', '2026-09-17', '1', '0', '0', '2026-09-17 15:14:56','اضافة فاتورة مبيعات رقم 33 - صرف البضاعة من المخزن','1','0',null,'0','33','sellbillController.php?do=showDetail&sellbillid=33'); -- id=500
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('500', '402', '446', '','0'); -- id=500
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74551.42', 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 ('500', '382', '446', '','0'); -- id=500
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2149067.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='499,0,500' where sellbillid=33;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 500, 446, 446
                    , 446, 446, 446, 446, 446, 446)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+500, netSellCostBuyPrice = netSellCostBuyPrice+446
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+446
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+446
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+446
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+446
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+446
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+446
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+446;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06aabe7ae8d1eb and sellbillId = 33 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:44:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:14:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:14:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1337
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:45:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:15:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:15:29', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=33'); -- id=1338
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:45:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:15:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:15:36', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1339
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:45:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:15:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:15:56', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:46:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:16:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:16:02', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=33'); -- id=1341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:46:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:16:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:16:57', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1342
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 33;
UPDATE sellbill SET  sellbillsysdate = '2026-09-17 15:16:57', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '33';
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 = 191;
 INSERT INTO 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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-446, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-446
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-446, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-446
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-09-17 15:16:57' WHERE storedetailid = '162';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '2', '0', '33', 'تعديل فاتورة مبيعات', 'sellbillController.php', '26', '28', '1', '2026-09-17 15:14:54','0','0'); -- id=679
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','تعديل فاتورة مبيعات','33', '0', '2026-09-17 15:14:54', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 15:14:54','0','0','',''); -- id=54
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-237265.484375',  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 ('-236765.484375','500', '1', '1', 'تعديل فاتورة مبيعات', '33', '-237265.484375', '2026-09-17 15:16:57', '1',  'sellbillController.php','1','','0'); -- id=34
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-446, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-446
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-500, sellCostBuyPrice =sellCostBuyPrice-446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-446, sellCostMeanBuyPrice = sellCostMeanBuyPrice-446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-446
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 500, 446, 446
                    , 446, 446, 446, 446, 446, 446)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-500, netSellCostBuyPrice = netSellCostBuyPrice-446
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-446
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-446
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-446
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-446
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-446
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-446
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-446;

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


-- ----------------------------------------------------------------------------------------------------
-- bill update start - new add start - with id = 33 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-09-17 15:14:54', '06aabe7ae8d1eb', '1', '0.00', '0', '0', '1', '610', '610', '610', '0', '1', '2026-09-17 15:14:54', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '22', '33', 'sellbillController', '0','','','','','-1','0','0','610','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-17','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=34
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','اضافة فاتورة مبيعات (معدله)','34', '0', '2026-09-17 15:16:58', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '610', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 15:14:54','0','0','',''); -- id=55
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('223','00162', '34', '22', '162', '2.00', '250', '500', '0', '', '1', '2026-09-17 15:16:58', '162', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','250','500','0','','0','0.00','0','0','0','0'); -- id=192
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 = 192;
 INSERT INTO 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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 500, 446, 446
                    , 446, 446, 446, 446
                    , 0, 0, 0, 0
                    , 0, 0, 0, 446, 446, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+446
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+446, sellCostMeanBuyPrice = sellCostMeanBuyPrice+446
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+446, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+446
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+446
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+446
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+446
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:16:59' WHERE storedetailid = '162';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '2', '1', '34', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '28', '26', '1', '2026-09-17 15:16:59','0','0'); -- id=680
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 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', '34', '3', '103', '20', '5.5', '110', '0', '', '1', '2026-09-17 15:16:59', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-20,','1','1','0','0','5.5','110','0','','0','0.00','0','0','0','0'); -- id=193
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 = 193;
 INSERT INTO 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-09-17', 110, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, 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+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-09-17', 110, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+110, 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 = '2671', userid = '1', storedetaildate = '2026-09-17 15:16:59' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '20', '1', '34', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2691', '2671', '1', '2026-09-17 15:16:59','0','0'); -- id=681
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-236655.484375',  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 ('-237265.484375','610', '0', '1', 'اضافة فاتورة مبيعات (معدله)', '34', '-236655.484375', '2026-09-17 15:16:59', '1',  'sellbillController.php','1','','0'); -- id=35
UPDATE dailyentry SET totalcreditor = '500.00', totaldebtor = '500.00', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 15:14:56', entryComment = 'اضافة فاتورة مبيعات رقم 33', fromFlag = '1',related='0',isopeningentry='0',operationId='33',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=33' WHERE id = '499';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500.00', '500.00', '2026-09-17', '1', '0', '499', '2026-09-17 15:16:59','تم عكس القيد رقم 499 ','1','0','0','0','0',''); -- id=501
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('501', '383', '500.00', '','0'); -- id=501
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-190573.48', 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 ('501', '143', '500.00', '','0'); -- id=501
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77340.29', 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 = '446.00', totaldebtor = '446.00', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 15:14:56', entryComment = 'اضافة فاتورة مبيعات رقم 33 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='33',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=33' WHERE id = '500';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '446.00', '446.00', '2026-09-17', '1', '0', '500', '2026-09-17 15:17:00','تم عكس القيد رقم 500 ','1','0','0','0','0',''); -- id=502
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('502', '402', '446.00', '','0'); -- id=502
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74105.42', 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 ('502', '382', '446.00', '','0'); -- id=502
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2149513.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 ( '610', '610', '2026-09-17', '1', '0', '0', '2026-09-17 15:17:00','اضافة فاتورة مبيعات رقم 34','1','0',null,'0','34','sellbillController.php?do=showDetail&sellbillid=34'); -- id=503
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('503', '383', '610', '','0'); -- id=503
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-189963.48', 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 ('503', '143', '610', '','0'); -- id=503
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77950.29', 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 ( '536', '536', '2026-09-17', '1', '0', '0', '2026-09-17 15:17:00','اضافة فاتورة مبيعات رقم 34 - صرف البضاعة من المخزن','1','0',null,'0','34','sellbillController.php?do=showDetail&sellbillid=34'); -- id=504
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('504', '402', '536', '','0'); -- id=504
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74641.42', 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 ('504', '382', '536', '','0'); -- id=504
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148977.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='503,0,504' where sellbillid=34;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 610, 536, 536
                    , 536, 536, 536, 536
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,536, 536, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+536
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+536, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+536
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+536
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+536
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 610, 536, 536
                    , 536, 536, 536, 536
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,536, 536, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+536
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+536, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+536, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+536
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+536
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+536
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 610, 536, 536
                    , 536, 536, 536, 536, 536, 536)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+610, netSellCostBuyPrice = netSellCostBuyPrice+536
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+536
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+536
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+536
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+536
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+536
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+536
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+536;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 33 and newid=34 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 11:47:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:17:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:17:02', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=34'); -- id=1343
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:12:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:42:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:42:10', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1344
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:12:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:42:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:42:23', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:12:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:42:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:42:31', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=32'); -- id=1346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:12:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:42:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:42:56', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1347
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 32;
UPDATE sellbill SET  sellbillsysdate = '2026-09-17 15:42:56', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '32';
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 178;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 15:42:56' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '160', '180', '1', '2026-09-15 14:55:07','0','0'); -- id=682
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 179;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '475', userid = '1', storedetaildate = '2026-09-17 15:42:56' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '445', '475', '1', '2026-09-15 14:55:07','0','0'); -- id=683
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 180;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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-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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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 = '155', userid = '1', storedetaildate = '2026-09-17 15:42:56' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '153', '155', '1', '2026-09-15 14:55:07','0','0'); -- id=684
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 181;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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-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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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 = '5', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=685
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 182;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-09-15 14:55:07','0','0'); -- id=686
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 183;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '32', '34', '1', '2026-09-15 14:55:07','0','0'); -- id=687
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 184;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '71', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '66', '71', '1', '2026-09-15 14:55:07','0','0'); -- id=688
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 185;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, 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-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-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, 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 = '5', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '2', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=689
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 186;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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-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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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 = '13', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '13', '1', '2026-09-15 14:55:07','0','0'); -- id=690
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 187;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '642', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '4', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '638', '642', '1', '2026-09-15 14:55:07','0','0'); -- id=691
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 188;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.5,0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-35, sellCostBuyPrice =sellCostBuyPrice-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-30
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-0.5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-35, sellCostBuyPrice =sellCostBuyPrice-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-30
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.5', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7.5', '8', '1', '2026-09-15 14:55:07','0','0'); -- id=692
UPDATE sellbilldetail SET  lastbuyprice = 54.00 , meanbuyprice = 54.00, lastbuyprice_withDiscount = 54.00, meanbuyprice_withDiscount = 54.00
        , lastbuyprice_withTax = 54, meanbuyprice_withTax = 54, lastbuyprice_withDiscountAndTax = 54
                where sellbilldetailid = 189;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (374, '2026-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.25,0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15, sellCostBuyPrice =sellCostBuyPrice-13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-13.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-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15, sellCostBuyPrice =sellCostBuyPrice-13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-13.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 = '20', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '0.25', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '19.75', '20', '1', '2026-09-15 14:55:07','0','0'); -- id=693
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 = 190;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (375, '2026-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-295, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-295, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-09-17 15:42:57' WHERE storedetailid = '375';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '0', '32', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '1', '2026-09-15 14:55:07','0','0'); -- id=694
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
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 ('5','4712.10','4712.10','1','تعديل فاتورة مبيعات','32', '0', '2026-09-15 14:55:07', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '4712.1', '0', null, '0', null, null,'', '0','1','1','4712.1','1','2026-09-15 14:55:07','0','0','',''); -- id=56
UPDATE client SET  inUse = 0 where clientid = 5;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4712.1, sellCostBuyPrice =sellCostBuyPrice-4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4198.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 (5, '2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4712.1, sellCostBuyPrice =sellCostBuyPrice-4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4198.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, 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7, 4198.7, 4198.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-4712.1, netSellCostBuyPrice = netSellCostBuyPrice-4198.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-4198.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-4198.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-4198.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-4198.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-4198.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-4198.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-4198.7;

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


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

COMMIT;
BEGIN;
CALL clientInUse(5,@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-09-15 14:55:07', '06aa93eb95dae4', '5', '0.00', '4712.1', '0', '1', '4712.1', '4712.1', '0', '4712.1', '1', '2026-09-15 14:55:07', '', '1', '0', 'احمد عبدالحميد حسون ', '1', '1', '3', '0', 'احمد عبدالحميد حسون ', '69.75', '32', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-15','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=35
UPDATE client SET  clientdebt = '4712.1', userid = '1' WHERE clientid = '5';
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 ('5','0.00','4712.1','0','اضافة فاتورة مبيعات (معدله)','35', '4712.1', '2026-09-17 15:42:58', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '4712.1', '0', null, '0', null, null,'', '0','1','1','4712.1','1','2026-09-15 14:55:07','0','0','',''); -- id=57
UPDATE client SET  inUse = 0 where clientid = 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 ('11.1','00087', '35', '12', '87', '20.00', '11.3', '226', '0', '', '1', '2026-09-17 15:42:58', '87', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','226','0','','0','0.00','0','0','0','0'); -- id=194
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 194;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '160', userid = '1', storedetaildate = '2026-09-17 15:42:59' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '180', '160', '1', '2026-09-17 15:42:59','0','0'); -- id=695
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.9','00086', '35', '12', '86', '30.00', '6.25', '187.5', '0', '', '1', '2026-09-17 15:42:59', '86', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6.25','187.5','0','','0','0.00','0','0','0','0'); -- id=195
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 195;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '445', userid = '1', storedetaildate = '2026-09-17 15:42:59' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '475', '445', '1', '2026-09-17 15:42:59','0','0'); -- id=696
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.1','00088', '35', '12', '88', '2.00', '11.3', '22.6', '0', '', '1', '2026-09-17 15:42:59', '88', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','22.6','0','','0','0.00','0','0','0','0'); -- id=196
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 196;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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+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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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 = '153', userid = '1', storedetaildate = '2026-09-17 15:42:59' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '155', '153', '1', '2026-09-17 15:42:59','0','0'); -- id=697
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','00212', '35', '13', '212', '1.00', '245', '245', '0', '', '1', '2026-09-17 15:42:59', '212', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','245','0','','0','0.00','0','0','0','0'); -- id=197
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 197;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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+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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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 = '4', userid = '1', storedetaildate = '2026-09-17 15:43:00' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '1', '2026-09-17 15:43:00','0','0'); -- id=698
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('867','00218', '35', '13', '218', '1.00', '900', '900', '0', '', '1', '2026-09-17 15:43:00', '218', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','900','900','0','','0','0.00','0','0','0','0'); -- id=198
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 198;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-17 15:43:00' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-09-17 15:43:00','0','0'); -- id=699
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','00084', '35', '12', '84', '2.00', '195', '390', '0', '', '1', '2026-09-17 15:43:00', '84', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','195','390','0','','0','0.00','0','0','0','0'); -- id=199
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 199;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:43:00' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '34', '32', '1', '2026-09-17 15:43:00','0','0'); -- id=700
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '35', '12', '70', '5.00', '352', '1760', '0', '', '1', '2026-09-17 15:43:00', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','352','1760','0','','0','0.00','0','0','0','0'); -- id=200
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 200;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '66', userid = '1', storedetaildate = '2026-09-17 15:43:01' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '71', '66', '1', '2026-09-17 15:43:01','0','0'); -- id=701
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00226', '35', '12', '226', '2.00', '60', '120', '0', '', '1', '2026-09-17 15:43:01', '226', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','120','0','','0','0.00','0','0','0','0'); -- id=201
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 201;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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+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-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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 = '3', userid = '1', storedetaildate = '2026-09-17 15:43:01' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '2', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '3', '1', '2026-09-17 15:43:01','0','0'); -- id=702
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','00073', '35', '12', '73', '1.00', '440', '440', '0', '', '1', '2026-09-17 15:43:01', '73', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','440','440','0','','0','0.00','0','0','0','0'); -- id=202
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 202;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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+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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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 = '12', userid = '1', storedetaildate = '2026-09-17 15:43:01' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '12', '1', '2026-09-17 15:43:01','0','0'); -- id=703
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '35', '14', '81', '4.00', '19', '76', '0', '', '1', '2026-09-17 15:43:01', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','76','0','','0','0.00','0','0','0','0'); -- id=203
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 203;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+76, sellCostBuyPrice =sellCostBuyPrice+72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+72, sellCostMeanBuyPrice = sellCostMeanBuyPrice+72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+76, sellCostBuyPrice =sellCostBuyPrice+72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+72, sellCostMeanBuyPrice = sellCostMeanBuyPrice+72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+72
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '638', userid = '1', storedetaildate = '2026-09-17 15:43:02' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '4', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '642', '638', '1', '2026-09-17 15:43:02','0','0'); -- id=704
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('60','00227', '35', '14', '227', '0.50', '70', '35', '0', '', '1', '2026-09-17 15:43:02', '227', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','70','35','0','','0','0.00','0','0','0','0'); -- id=204
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 204;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7.5', userid = '1', storedetaildate = '2026-09-17 15:43:02' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.5', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7.5', '1', '2026-09-17 15:43:02','0','0'); -- id=705
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('54','00374', '35', '14', '374', '0.25', '60', '15', '0', '', '1', '2026-09-17 15:43:02', '374', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','15','0','','0','0.00','0','0','0','0'); -- id=205
UPDATE sellbilldetail SET  lastbuyprice = 54.00 , meanbuyprice = 54.00, lastbuyprice_withDiscount = 54.00, meanbuyprice_withDiscount = 54.00
        , lastbuyprice_withTax = 54, meanbuyprice_withTax = 54, lastbuyprice_withDiscountAndTax = 54
                where sellbilldetailid = 205;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (374, '2026-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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 = '19.75', userid = '1', storedetaildate = '2026-09-17 15:43:02' WHERE storedetailid = '374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '0.25', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '19.75', '1', '2026-09-17 15:43:02','0','0'); -- id=706
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00375', '35', '6', '375', '1.00', '295', '295', '0', '', '1', '2026-09-17 15:43:02', '375', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','295','295','0','','0','0.00','0','0','0','0'); -- id=206
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 = 206;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (375, '2026-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:43:03' WHERE storedetailid = '375';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '1', '35', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-09-17 15:43:03','0','0'); -- id=707
UPDATE dailyentry SET totalcreditor = '4712.10', totaldebtor = '4712.10', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 10:03:15', entryComment = 'اضافة فاتورة مبيعات رقم 32', fromFlag = '1',related='0',isopeningentry='0',operationId='32',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=32' WHERE id = '480';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4712.10', '4712.10', '2026-09-17', '1', '0', '480', '2026-09-17 15:43:03','تم عكس القيد رقم 480 ','1','0','0','0','0',''); -- id=505
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('505', '430', '4712.10', '','0'); -- id=505
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-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('505', '143', '4712.10', '','0'); -- id=505
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '73238.19', 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 = '4198.70', totaldebtor = '4198.70', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 10:03:15', entryComment = 'اضافة فاتورة مبيعات رقم 32 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='32',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=32' WHERE id = '481';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4198.70', '4198.70', '2026-09-17', '1', '0', '481', '2026-09-17 15:43:03','تم عكس القيد رقم 481 ','1','0','0','0','0',''); -- id=506
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('506', '402', '4198.70', '','0'); -- id=506
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '70442.72', 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 ('506', '382', '4198.70', '','0'); -- id=506
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2153176.65', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '4712.1', '4712.1', '2026-09-17', '1', '0', '0', '2026-09-17 15:43:04','اضافة فاتورة مبيعات رقم 35','1','0',null,'0','35','sellbillController.php?do=showDetail&sellbillid=35'); -- id=507
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('507', '430', '4712.1', '','0'); -- id=507
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '4712.1', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('507', '143', '4712.1', '','0'); -- id=507
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77950.29', 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 ( '4198.7', '4198.7', '2026-09-17', '1', '0', '0', '2026-09-17 15:43:04','اضافة فاتورة مبيعات رقم 35 - صرف البضاعة من المخزن','1','0',null,'0','35','sellbillController.php?do=showDetail&sellbillid=35'); -- id=508
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('508', '402', '4198.7', '','0'); -- id=508
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74641.42', 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 ('508', '382', '4198.7', '','0'); -- id=508
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148977.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='507,0,508' where sellbillid=35;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4712.1, sellCostBuyPrice =sellCostBuyPrice+4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4198.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 (5, '2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4712.1, sellCostBuyPrice =sellCostBuyPrice+4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4198.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, 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7, 4198.7, 4198.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4712.1, netSellCostBuyPrice = netSellCostBuyPrice+4198.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4198.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4198.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4198.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4198.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4198.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4198.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4198.7;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 32 and newid=35 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:13:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:43:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:43:05', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=35'); -- id=1348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-17 15:44:10', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=1349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-17 15:44:26', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=1350

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =58
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '712.1' , clientdate = '2026-09-17 15:44:26', userid = '1' WHERE clientid = '5';
UPDATE client SET  inUse = 0 where clientid = 5;
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 ('5','4712.10','4000','1','ايصال تحصيل (( قبض من عميل ))','58', '712.1', '2026-09-17 15:44:10', '1', 'clientPayedDeptController.php', '   ', '4000', '0', null, '0', null, null,'', '-1','1','1','4000','1','','4','0','','.'); -- id=58
UPDATE save SET  savecurrentvalue = '-232655.48',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-236655.48','4000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '58', '-232655.48', '2026-09-17 15:44:26', '1',  'clientPayedDeptController.php','5','','0'); -- id=36
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4000', '4000', '2026-09-17', '1', '0', '0', '2026-09-17 15:44:27','اضافة ايصال سداد للعميل احمد عبدالحميد حسون ','1','0','0','0','58','clientPayedDeptController.php?do=show&id=58'); -- id=509
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('509', '383', '4000', '','0'); -- id=509
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-185963.48', 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 ('509', '430', '4000', '','0'); -- id=509
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '712.1', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
UPDATE clientdebtchange SET clientid = '5', clientdebtchangebefore = '4712.100', clientdebtchangeamount = '4000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '58', clientdebtchangeafter = '712.100', clientdebtchangedate = '2026-09-17 15:44:10', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4000.000',discount='', reciptid='0', dailyentryid = '509',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '58';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-17 15:44:28', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=1351
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-17 15:44:29', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=1352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 15:44:34', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=1353
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 15:44:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=1354
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:14:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:44:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:44:52', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=35'); -- id=1355
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:15:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:45:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:45:00', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:15:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:45:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:45:08', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1357
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:15:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:45:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:45:13', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=35'); -- id=1358
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:15:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:45:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:45:29', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1359
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 35;
UPDATE sellbill SET  sellbillsysdate = '2026-09-17 15:45:30', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '35';
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 194;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-226, sellCostBuyPrice =sellCostBuyPrice-222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-222, sellCostMeanBuyPrice = sellCostMeanBuyPrice-222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-222
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 15:45:30' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '160', '180', '1', '2026-09-15 14:55:07','0','0'); -- id=708
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 195;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-187.5, sellCostBuyPrice =sellCostBuyPrice-177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-177, sellCostMeanBuyPrice = sellCostMeanBuyPrice-177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-177
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '475', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '445', '475', '1', '2026-09-15 14:55:07','0','0'); -- id=709
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 196;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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-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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-22.6, sellCostBuyPrice =sellCostBuyPrice-22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice-22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-22.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 = '155', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '153', '155', '1', '2026-09-15 14:55:07','0','0'); -- id=710
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 197;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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-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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-245, 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 = '5', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=711
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 198;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-900, sellCostBuyPrice =sellCostBuyPrice-867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-867, sellCostMeanBuyPrice = sellCostMeanBuyPrice-867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-867
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2', '3', '1', '2026-09-15 14:55:07','0','0'); -- id=712
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 199;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-390, sellCostBuyPrice =sellCostBuyPrice-320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '32', '34', '1', '2026-09-15 14:55:07','0','0'); -- id=713
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 200;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1760, sellCostBuyPrice =sellCostBuyPrice-1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '71', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '66', '71', '1', '2026-09-15 14:55:07','0','0'); -- id=714
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 201;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, 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-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-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, 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 = '5', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '2', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3', '5', '1', '2026-09-15 14:55:07','0','0'); -- id=715
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 202;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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-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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-440, 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 = '13', userid = '1', storedetaildate = '2026-09-17 15:45:30' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '13', '1', '2026-09-15 14:55:07','0','0'); -- id=716
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 203;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 76, 72, 72
                    , 72, 72, 72, 72
                    , 0, 0, 0, 0
                    , 0, 0, 0, 72, 72, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-76, sellCostBuyPrice =sellCostBuyPrice-72
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-72, sellCostMeanBuyPrice = sellCostMeanBuyPrice-72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-72, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-72
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-72
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-72
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '642', userid = '1', storedetaildate = '2026-09-17 15:45:31' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '4', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '638', '642', '1', '2026-09-15 14:55:07','0','0'); -- id=717
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 204;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.5,0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-35, sellCostBuyPrice =sellCostBuyPrice-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-30
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-0.5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-35, sellCostBuyPrice =sellCostBuyPrice-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-30
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-17 15:45:31' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.5', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '7.5', '8', '1', '2026-09-15 14:55:07','0','0'); -- id=718
UPDATE sellbilldetail SET  lastbuyprice = 54.00 , meanbuyprice = 54.00, lastbuyprice_withDiscount = 54.00, meanbuyprice_withDiscount = 54.00
        , lastbuyprice_withTax = 54, meanbuyprice_withTax = 54, lastbuyprice_withDiscountAndTax = 54
                where sellbilldetailid = 205;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (374, '2026-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,0.25,0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15, sellCostBuyPrice =sellCostBuyPrice-13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-13.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-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-15, sellCostBuyPrice =sellCostBuyPrice-13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-13.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 = '20', userid = '1', storedetaildate = '2026-09-17 15:45:31' WHERE storedetailid = '374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '0.25', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '19.75', '20', '1', '2026-09-15 14:55:07','0','0'); -- id=719
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 = 206;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (375, '2026-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-295, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-295, sellCostBuyPrice =sellCostBuyPrice-200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-200, sellCostMeanBuyPrice = sellCostMeanBuyPrice-200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-200
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-09-17 15:45:31' WHERE storedetailid = '375';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '0', '35', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '1', '2026-09-15 14:55:07','0','0'); -- id=720
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-4000', userid = '1' WHERE clientid = '5';
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 ('5','712.10','4712.10','1','تعديل فاتورة مبيعات','35', '-4000', '2026-09-15 14:55:07', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '4712.1', '0', null, '0', null, null,'', '0','1','1','4712.1','1','2026-09-15 14:55:07','0','0','',''); -- id=59
UPDATE client SET  inUse = 0 where clientid = 5;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4712.1, sellCostBuyPrice =sellCostBuyPrice-4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4198.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 (5, '2026-09-17', 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4198.7, 4198.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4712.1, sellCostBuyPrice =sellCostBuyPrice-4198.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4198.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4198.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4198.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4198.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4198.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4198.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4198.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, 4712.1, 4198.7, 4198.7
                    , 4198.7, 4198.7, 4198.7, 4198.7, 4198.7, 4198.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-4712.1, netSellCostBuyPrice = netSellCostBuyPrice-4198.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-4198.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-4198.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-4198.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-4198.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-4198.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-4198.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-4198.7;

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


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

COMMIT;
BEGIN;
CALL clientInUse(5,@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-09-15 14:55:07', '06aa93eb95dae4', '5', '-4000.00', '731.1', '0', '1', '4731.1', '4731.1', '0', '4731.1', '1', '2026-09-15 14:55:07', '', '1', '0', 'احمد عبدالحميد حسون ', '1', '1', '3', '0', 'احمد عبدالحميد حسون ', '70.75', '35', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-15','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=36
UPDATE client SET  clientdebt = '731.1', userid = '1' WHERE clientid = '5';
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 ('5','-4000.00','4731.1','0','اضافة فاتورة مبيعات (معدله)','36', '731.1', '2026-09-17 15:45:32', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '4731.1', '0', null, '0', null, null,'', '0','1','1','4712.1','1','2026-09-15 14:55:07','0','0','',''); -- id=60
UPDATE client SET  inUse = 0 where clientid = 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 ('11.1','00087', '36', '12', '87', '20.00', '11.3', '226', '0', '', '1', '2026-09-17 15:45:32', '87', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','226','0','','0','0.00','0','0','0','0'); -- id=207
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 207;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 226, 222, 222
                    , 222, 222, 222, 222
                    , 0, 0, 0, 0
                    , 0, 0, 0, 222, 222, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+226, sellCostBuyPrice =sellCostBuyPrice+222
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+222, sellCostMeanBuyPrice = sellCostMeanBuyPrice+222
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+222, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+222
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+222
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+222
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+222
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '160', userid = '1', storedetaildate = '2026-09-17 15:45:32' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '20', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '180', '160', '1', '2026-09-17 15:45:32','0','0'); -- id=721
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.9','00086', '36', '12', '86', '30.00', '6.25', '187.5', '0', '', '1', '2026-09-17 15:45:32', '86', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','6.25','187.5','0','','0','0.00','0','0','0','0'); -- id=208
UPDATE sellbilldetail SET  lastbuyprice = 5.90 , meanbuyprice = 5.90, lastbuyprice_withDiscount = 5.90, meanbuyprice_withDiscount = 5.90
        , lastbuyprice_withTax = 5.9, meanbuyprice_withTax = 5.9, lastbuyprice_withDiscountAndTax = 5.9
                where sellbilldetailid = 208;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (86, '2026-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 187.5, 177, 177
                    , 177, 177, 177, 177
                    , 0, 0, 0, 0
                    , 0, 0, 0, 177, 177, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+187.5, sellCostBuyPrice =sellCostBuyPrice+177
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+177, sellCostMeanBuyPrice = sellCostMeanBuyPrice+177
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+177, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+177
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+177
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+177
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+177
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '445', userid = '1', storedetaildate = '2026-09-17 15:45:32' WHERE storedetailid = '86';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('86', '1', '30', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '475', '445', '1', '2026-09-17 15:45:32','0','0'); -- id=722
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.1','00088', '36', '12', '88', '2.00', '11.3', '22.6', '0', '', '1', '2026-09-17 15:45:33', '88', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','22.6','0','','0','0.00','0','0','0','0'); -- id=209
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 209;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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+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-09-17', 22.6, 22.2, 22.2
                    , 22.2, 22.2, 22.2, 22.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 22.2, 22.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+22.6, sellCostBuyPrice =sellCostBuyPrice+22.2
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22.2, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22.2
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22.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 = '153', userid = '1', storedetaildate = '2026-09-17 15:45:33' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '2', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '155', '153', '1', '2026-09-17 15:45:33','0','0'); -- id=723
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','00212', '36', '13', '212', '1.00', '245', '245', '0', '', '1', '2026-09-17 15:45:33', '212', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','245','0','','0','0.00','0','0','0','0'); -- id=210
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 210;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (212, '2026-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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+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-09-17', 245, 225, 225
                    , 225, 225, 225, 225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 225, 225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+245, 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 = '4', userid = '1', storedetaildate = '2026-09-17 15:45:33' WHERE storedetailid = '212';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('212', '1', '1', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '4', '1', '2026-09-17 15:45:33','0','0'); -- id=724
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('867','00218', '36', '13', '218', '1.00', '900', '900', '0', '', '1', '2026-09-17 15:45:33', '218', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','900','900','0','','0','0.00','0','0','0','0'); -- id=211
UPDATE sellbilldetail SET  lastbuyprice = 867.00 , meanbuyprice = 867.00, lastbuyprice_withDiscount = 867.00, meanbuyprice_withDiscount = 867.00
        , lastbuyprice_withTax = 867, meanbuyprice_withTax = 867, lastbuyprice_withDiscountAndTax = 867
                where sellbilldetailid = 211;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (218, '2026-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 900, 867, 867
                    , 867, 867, 867, 867
                    , 0, 0, 0, 0
                    , 0, 0, 0, 867, 867, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+867
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+867, sellCostMeanBuyPrice = sellCostMeanBuyPrice+867
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+867, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+867
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+867
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+867
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+867
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-17 15:45:33' WHERE storedetailid = '218';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('218', '1', '1', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '3', '2', '1', '2026-09-17 15:45:33','0','0'); -- id=725
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('160','00084', '36', '12', '84', '2.00', '195', '390', '0', '', '1', '2026-09-17 15:45:34', '84', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','195','390','0','','0','0.00','0','0','0','0'); -- id=212
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
        , lastbuyprice_withTax = 160, meanbuyprice_withTax = 160, lastbuyprice_withDiscountAndTax = 160
                where sellbilldetailid = 212;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (84, '2026-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 390, 320, 320
                    , 320, 320, 320, 320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 320, 320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:45:34' WHERE storedetailid = '84';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('84', '1', '2', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '34', '32', '1', '2026-09-17 15:45:34','0','0'); -- id=726
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '36', '12', '70', '5.00', '352', '1760', '0', '', '1', '2026-09-17 15:45:34', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','352','1760','0','','0','0.00','0','0','0','0'); -- id=213
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 213;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 1760, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1760, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '66', userid = '1', storedetaildate = '2026-09-17 15:45:34' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '71', '66', '1', '2026-09-17 15:45:34','0','0'); -- id=727
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00226', '36', '12', '226', '2.00', '60', '120', '0', '', '1', '2026-09-17 15:45:34', '226', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','120','0','','0','0.00','0','0','0','0'); -- id=214
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 214;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (226, '2026-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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+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-09-17', 120, 100, 100
                    , 100, 100, 100, 100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, 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 = '3', userid = '1', storedetaildate = '2026-09-17 15:45:35' WHERE storedetailid = '226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('226', '1', '2', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '3', '1', '2026-09-17 15:45:35','0','0'); -- id=728
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','00073', '36', '12', '73', '1.00', '440', '440', '0', '', '1', '2026-09-17 15:45:35', '73', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','440','440','0','','0','0.00','0','0','0','0'); -- id=215
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 215;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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+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-09-17', 440, 390, 390
                    , 390, 390, 390, 390
                    , 0, 0, 0, 0
                    , 0, 0, 0, 390, 390, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, 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 = '12', userid = '1', storedetaildate = '2026-09-17 15:45:35' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '13', '12', '1', '2026-09-17 15:45:35','0','0'); -- id=729
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '36', '14', '81', '5', '19', '95', '0', '', '1', '2026-09-17 15:45:35', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','95','0','','0','0.00','0','0','0','0'); -- id=216
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 216;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 95, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+90
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 95, 90, 90
                    , 90, 90, 90, 90
                    , 0, 0, 0, 0
                    , 0, 0, 0, 90, 90, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+90
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+90, sellCostMeanBuyPrice = sellCostMeanBuyPrice+90
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+90, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+90
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+90
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+90
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+90
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '637', userid = '1', storedetaildate = '2026-09-17 15:45:35' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '5', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '642', '637', '1', '2026-09-17 15:45:35','0','0'); -- id=730
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('60','00227', '36', '14', '227', '0.50', '70', '35', '0', '', '1', '2026-09-17 15:45:35', '227', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','70','35','0','','0','0.00','0','0','0','0'); -- id=217
UPDATE sellbilldetail SET  lastbuyprice = 60.00 , meanbuyprice = 60.00, lastbuyprice_withDiscount = 60.00, meanbuyprice_withDiscount = 60.00
        , lastbuyprice_withTax = 60, meanbuyprice_withTax = 60, lastbuyprice_withDiscountAndTax = 60
                where sellbilldetailid = 217;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (227, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 35, 30, 30
                    , 30, 30, 30, 30
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+35, sellCostBuyPrice =sellCostBuyPrice+30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7.5', userid = '1', storedetaildate = '2026-09-17 15:45:36' WHERE storedetailid = '227';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('227', '1', '0.5', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '7.5', '1', '2026-09-17 15:45:36','0','0'); -- id=731
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('54','00374', '36', '14', '374', '0.25', '60', '15', '0', '', '1', '2026-09-17 15:45:36', '374', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','15','0','','0','0.00','0','0','0','0'); -- id=218
UPDATE sellbilldetail SET  lastbuyprice = 54.00 , meanbuyprice = 54.00, lastbuyprice_withDiscount = 54.00, meanbuyprice_withDiscount = 54.00
        , lastbuyprice_withTax = 54, meanbuyprice_withTax = 54, lastbuyprice_withDiscountAndTax = 54
                where sellbilldetailid = 218;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (374, '2026-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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-09-17', 15, 13.5, 13.5
                    , 13.5, 13.5, 13.5, 13.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.5, 13.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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 = '19.75', userid = '1', storedetaildate = '2026-09-17 15:45:36' WHERE storedetailid = '374';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('374', '1', '0.25', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '19.75', '1', '2026-09-17 15:45:36','0','0'); -- id=732
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','00375', '36', '6', '375', '1.00', '295', '295', '0', '', '1', '2026-09-17 15:45:36', '375', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','295','295','0','','0','0.00','0','0','0','0'); -- id=219
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 = 219;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (375, '2026-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 295, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+295, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 15:45:36' WHERE storedetailid = '375';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('375', '1', '1', '1', '36', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-09-17 15:45:36','0','0'); -- id=733
UPDATE dailyentry SET totalcreditor = '4712.10', totaldebtor = '4712.10', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 15:43:04', entryComment = 'اضافة فاتورة مبيعات رقم 35', fromFlag = '1',related='0',isopeningentry='0',operationId='35',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=35' WHERE id = '507';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4712.10', '4712.10', '2026-09-17', '1', '0', '507', '2026-09-17 15:45:36','تم عكس القيد رقم 507 ','1','0','0','0','0',''); -- id=510
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('510', '430', '4712.10', '','0'); -- id=510
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '-4000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('510', '143', '4712.10', '','0'); -- id=510
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '73238.19', 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 = '4198.70', totaldebtor = '4198.70', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 15:43:04', entryComment = 'اضافة فاتورة مبيعات رقم 35 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='35',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=35' WHERE id = '508';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4198.70', '4198.70', '2026-09-17', '1', '0', '508', '2026-09-17 15:45:37','تم عكس القيد رقم 508 ','1','0','0','0','0',''); -- id=511
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('511', '402', '4198.70', '','0'); -- id=511
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '70442.72', 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 ('511', '382', '4198.70', '','0'); -- id=511
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2153176.65', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '4731.1', '4731.1', '2026-09-17', '1', '0', '0', '2026-09-17 15:45:37','اضافة فاتورة مبيعات رقم 36','1','0',null,'0','36','sellbillController.php?do=showDetail&sellbillid=36'); -- id=512
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('512', '430', '4731.1', '','0'); -- id=512
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '731.1', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('512', '143', '4731.1', '','0'); -- id=512
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '77969.29', 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 ( '4216.7', '4216.7', '2026-09-17', '1', '0', '0', '2026-09-17 15:45:37','اضافة فاتورة مبيعات رقم 36 - صرف البضاعة من المخزن','1','0',null,'0','36','sellbillController.php?do=showDetail&sellbillid=36'); -- id=513
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('513', '402', '4216.7', '','0'); -- id=513
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '74659.42', 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 ('513', '382', '4216.7', '','0'); -- id=513
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2148959.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='512,0,513' where sellbillid=36;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4731.1, 4216.7, 4216.7
                    , 4216.7, 4216.7, 4216.7, 4216.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4216.7, 4216.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4731.1, sellCostBuyPrice =sellCostBuyPrice+4216.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4216.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4216.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4216.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4216.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4216.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4216.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4216.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 (5, '2026-09-17', 4731.1, 4216.7, 4216.7
                    , 4216.7, 4216.7, 4216.7, 4216.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4216.7, 4216.7, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4731.1, sellCostBuyPrice =sellCostBuyPrice+4216.7
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4216.7, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4216.7
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4216.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4216.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4216.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4216.7
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4216.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, 4731.1, 4216.7, 4216.7
                    , 4216.7, 4216.7, 4216.7, 4216.7, 4216.7, 4216.7)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4731.1, netSellCostBuyPrice = netSellCostBuyPrice+4216.7
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4216.7
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4216.7
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4216.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4216.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4216.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4216.7
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4216.7;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 35 and newid=36 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:15:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 15:45:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 15:45:39', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=36'); -- id=1360
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:52:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:22:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:22:58', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1361
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:53:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:23:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:23:12', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1362
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:53:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:23:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:23:26', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1363
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:53:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:23:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:23:35', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1364
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:53:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:23:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:23:43', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=36'); -- id=1365
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:58:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:28:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:28:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1366
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:58:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:28:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 16:28:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=1367
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:58:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:28:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 16:28:54', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=1368
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:59:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:29:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:29:03', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=36'); -- id=1369
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 12:59:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:29:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:29:17', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1370
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:01:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:31:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 16:31:36', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1371
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:01:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:31:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 16:31:52', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1372
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','2350','2450','2550','2550','2026-09-17','0','1','1','','0','0','0','0','0','2350','2350','2350','2350','2350','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','2350','2350','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=389
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (389, 1,'2026-09-17 16:33:07',1)
                ON DUPLICATE KEY UPDATE productid = 389, edited = 1, sysdate = '2026-09-17 16:33:07', userid = 1; -- id=460
UPDATE product SET productName = 'كالون كهرباء ايطالي ', productDescription = '', productCatId = '6', productBuyPrice = '2350', productSellAllPrice = '2450', productSellUnitPrice = '2550', productSellHalfPrice = '2550', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00389',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '2350',lastbuyprice_withDiscount = '2350',meanbuyprice = '2350',meanbuyprice_withDiscount = '2350' , productbuypricereal = '2350' , 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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2350',meanbuyprice_withTax='2350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '389';
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', '389', '1', '2026-09-17', '1', '0','0038901','2450','2550','2550','2350','','0','0','0','0','0','0','0','0','0','0'); -- id=389
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('389', '1', '3', '1', '2026-09-17'); -- id=389
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('389', '1', '3', '0', '389', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-17','0','0'); -- id=734
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7050', '7050', '2026-09-17', '1', '0', '0', '2026-09-17 16:33:08','إضافة منتج كالون كهرباء ايطالي  الكمية 3','1','0','0','0','0',''); -- id=514
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('514', '382', '7050', '','0'); -- id=514
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2156009.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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('514', '121', '7050', '','0'); -- id=514
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1122132.87', 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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:03:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:33:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:33:53', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1373
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:04:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:34:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:34:53', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1374

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aabfa5224a8f
-- ----------------------------------------------------------------------------------------------------

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-09-17 16:34:54', '06aabfa5224a8f', '1', '0.00', '0', '0', '1', '985.00', '985', '985', '0', '1', '2026-09-17 16:34:54', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','985','0','','0','0','985','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=37
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','اضافة فاتورة مبيعات','37', '0', '2026-09-17 16:34:55', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '985', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 16:34:54','0','0','',''); -- id=61
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 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', '37', '7', '318', '5', '75', '375', '0', '', '1', '2026-09-17 16:34:55', '318', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','17-5,','1','1','0','0','75','375','0','','0','0.00','0','0','0','0'); -- id=220
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 = 220;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (318, '2026-09-17', 375, 347.5, 347.5
                    , 343.9, 347.5, 343.9, 347.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 347.5, 343.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+375, sellCostBuyPrice =sellCostBuyPrice+347.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+347.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+343.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+347.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+343.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+347.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+347.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+343.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 375, 347.5, 347.5
                    , 343.9, 347.5, 343.9, 347.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 347.5, 343.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+375, sellCostBuyPrice =sellCostBuyPrice+347.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+347.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+343.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+347.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+343.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+347.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+347.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+343.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '73', userid = '1', storedetaildate = '2026-09-17 16:34:55' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '5', '1', '37', 'اضافة فاتورة مبيعات', 'sellbillController.php', '78', '73', '1', '2026-09-17 16:34:55','0','0'); -- id=735
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','00282', '37', '22', '282', '2', '305', '610', '0', '', '1', '2026-09-17 16:34:55', '282', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','305','610','0','','0','0.00','0','0','0','0'); -- id=221
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 221;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (282, '2026-09-17', 610, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 610, 550, 550
                    , 550, 550, 550, 550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 550, 550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+610, sellCostBuyPrice =sellCostBuyPrice+550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 16:34:55' WHERE storedetailid = '282';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('282', '1', '2', '1', '37', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '14', '1', '2026-09-17 16:34:55','0','0'); -- id=736
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-231670.484375',  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 ('-232655.484375','985', '0', '1', 'اضافة فاتورة مبيعات', '37', '-231670.484375', '2026-09-17 16:34:55', '1',  'sellbillController.php','1','','0'); -- id=37
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '985', '985', '2026-09-17', '1', '0', '0', '2026-09-17 16:34:56','اضافة فاتورة مبيعات رقم 37','1','0',null,'0','37','sellbillController.php?do=showDetail&sellbillid=37'); -- id=515
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('515', '383', '985', '','0'); -- id=515
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-184978.48', 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 ('515', '143', '985', '','0'); -- id=515
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '78954.29', 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 ( '897.5', '897.5', '2026-09-17', '1', '0', '0', '2026-09-17 16:34:56','اضافة فاتورة مبيعات رقم 37 - صرف البضاعة من المخزن','1','0',null,'0','37','sellbillController.php?do=showDetail&sellbillid=37'); -- id=516
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('516', '402', '897.5', '','0'); -- id=516
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '75556.92', 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 ('516', '382', '897.5', '','0'); -- id=516
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2155112.45', theOrder = '0', layingOrder = '120202', reportid = '1', 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='515,0,516' where sellbillid=37;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 985, 897.5, 897.5
                    , 893.9, 897.5, 893.9, 897.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,897.5, 893.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+985, sellCostBuyPrice =sellCostBuyPrice+897.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+897.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+893.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+897.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+893.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+897.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+897.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+893.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 985, 897.5, 897.5
                    , 893.9, 897.5, 893.9, 897.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,897.5, 893.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+985, sellCostBuyPrice =sellCostBuyPrice+897.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+897.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+893.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+897.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+893.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+897.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+897.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+893.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 985, 897.5, 897.5
                    , 893.9, 897.5, 893.9, 897.5, 897.5, 893.9)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+985, netSellCostBuyPrice = netSellCostBuyPrice+897.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+897.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+893.9
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+897.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+893.9
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+897.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+897.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+893.9;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:04:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 16:34:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 16:34:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1375
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 خط فيرماكس اسباني ','','6','6762','6850','6950','6850','2026-09-17','0','1','1','','0','0','0','0','0','6762','6762','6762','6762','6762','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','6762','6762','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=390
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (390, 1,'2026-09-17 16:59:38',1)
                ON DUPLICATE KEY UPDATE productid = 390, edited = 1, sysdate = '2026-09-17 16:59:38', userid = 1; -- id=461
UPDATE product SET productName = 'انتركم 6 خط فيرماكس اسباني ', productDescription = '', productCatId = '6', productBuyPrice = '6762', productSellAllPrice = '6850', productSellUnitPrice = '6950', productSellHalfPrice = '6850', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00390',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '6762',lastbuyprice_withDiscount = '6762',meanbuyprice = '6762',meanbuyprice_withDiscount = '6762' , productbuypricereal = '6762' , 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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6762',meanbuyprice_withTax='6762',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '390';
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', '390', '1', '2026-09-17', '1', '0','0039001','6850','6850','6950','6762','','0','0','0','0','0','0','0','0','0','0'); -- id=390
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('390', '1', '2', '1', '2026-09-17'); -- id=390
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('390', '1', '2', '0', '390', 'إضافة منتج', 'productController.php', '0', '2', '1', '2026-09-17','0','0'); -- id=737
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13524', '13524', '2026-09-17', '1', '0', '0', '2026-09-17 16:59:39','إضافة منتج انتركم 6 خط فيرماكس اسباني  الكمية 2','1','0','0','0','0',''); -- id=517
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('517', '382', '13524', '','0'); -- id=517
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2168636.45', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('517', '121', '13524', '','0'); -- id=517
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1135656.87', 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';
COMMIT;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('انتركم 4 خط فيرماكس اسباني ','','6','5382','5480','5600','5480','2026-09-17','0','1','1','','0','0','0','0','0','5382','5382','5382','5382','5382','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','5382','5382','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=391
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (391, 1,'2026-09-17 17:00:29',1)
                ON DUPLICATE KEY UPDATE productid = 391, edited = 1, sysdate = '2026-09-17 17:00:29', userid = 1; -- id=462
UPDATE product SET productName = 'انتركم 4 خط فيرماكس اسباني ', productDescription = '', productCatId = '6', productBuyPrice = '5382', productSellAllPrice = '5480', productSellUnitPrice = '5600', productSellHalfPrice = '5480', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00391',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '5382',lastbuyprice_withDiscount = '5382',meanbuyprice = '5382',meanbuyprice_withDiscount = '5382' , productbuypricereal = '5382' , 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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='5382',meanbuyprice_withTax='5382',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '391';
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', '391', '1', '2026-09-17', '1', '0','0039101','5480','5480','5600','5382','','0','0','0','0','0','0','0','0','0','0'); -- id=391
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('391', '1', '2', '1', '2026-09-17'); -- id=391
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('391', '1', '2', '0', '391', 'إضافة منتج', 'productController.php', '0', '2', '1', '2026-09-17','0','0'); -- id=738
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10764', '10764', '2026-09-17', '1', '0', '0', '2026-09-17 17:00:30','إضافة منتج انتركم 4 خط فيرماكس اسباني  الكمية 2','1','0','0','0','0',''); -- id=518
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('518', '382', '10764', '','0'); -- id=518
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2179400.45', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('518', '121', '10764', '','0'); -- id=518
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1146420.87', 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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:30:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:00:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:00:49', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=1376
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 ('06aabf9db3bc1b', '2026-09-17 16:31:55', '1', '0.00', '31338', '0', '0', '31338.00',  '31338.00', '', '31338', '1', '2026-09-17 17:00:49', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=7
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00389', '7', '6', '389', '3', '2350', '7050.00', '0', '', '2026-09-17 17:00:49', '389','','','0','0','0','0','0',null,'2350','7050','0','0','0','0','0','0','0','0','1'); -- id=18
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 16:31:55', 1, 389, 0, 0
                    , 2350, 3, 0, 0, 1, '2026-09-17 17:00:50')
                ON DUPLICATE KEY UPDATE buyprice = 2350,
                        buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:00:50' ; -- id=18
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('389', '2350', '3', '0', 'buyBillController.php', '18', '', '0', '0'); -- id=18
UPDATE product SET  productBuyPrice = "2350" WHERE productId = 389 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 18 ;
UPDATE product SET productName = 'كالون كهرباء ايطالي ', productDescription = '', productCatId = '6', productBuyPrice = '2350.00', productSellAllPrice = '2450.00', productSellUnitPrice = '2550.00', productSellHalfPrice = '2550.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00389',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '2350',lastbuyprice_withDiscount = '2350',meanbuyprice = '2350',meanbuyprice_withDiscount = '2350' , productbuypricereal = '2350.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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2350',meanbuyprice_withTax='2350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='2350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '389';
UPDATE buybilldetail SET  lastbuyprice = 2350 , meanbuyprice = 2350, lastbuyprice_withDiscount = 2350, meanbuyprice_withDiscount = 2350
        , lastbuyprice_withTax = 2350, meanbuyprice_withTax = 2350, lastbuyprice_withDiscountAndTax = 2350
                where buybilldetailid = 18;
UPDATE productunit SET proUnitBuyPrice  = 2350 * productnumber WHERE productid = 389;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '389';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('389', '1', '3', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '6', '1', '2026-09-17 16:31:55','0','0'); -- id=739
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00390', '7', '6', '390', '2', '6762', '13524.00', '0', '', '2026-09-17 17:00:49', '390','','','0','0','0','0','0',null,'6762','13524','0','0','0','0','0','0','0','0','1'); -- id=19
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 16:31:55', 1, 390, 0, 0
                    , 6762, 2, 0, 0, 1, '2026-09-17 17:00:51')
                ON DUPLICATE KEY UPDATE buyprice = 6762,
                        buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:00:51' ; -- id=19
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('390', '6762', '2', '0', 'buyBillController.php', '19', '', '0', '0'); -- id=19
UPDATE product SET  productBuyPrice = "6762" WHERE productId = 390 ;
UPDATE buybilldetail SET  quantitybefore = 2 WHERE buybilldetailid = 19 ;
UPDATE product SET productName = 'انتركم 6 خط فيرماكس اسباني ', productDescription = '', productCatId = '6', productBuyPrice = '6762.00', productSellAllPrice = '6850.00', productSellUnitPrice = '6950.00', productSellHalfPrice = '6850.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00390',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '6762',lastbuyprice_withDiscount = '6762',meanbuyprice = '6762',meanbuyprice_withDiscount = '6762' , productbuypricereal = '6762.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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='6762',meanbuyprice_withTax='6762',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='6762',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '390';
UPDATE buybilldetail SET  lastbuyprice = 6762 , meanbuyprice = 6762, lastbuyprice_withDiscount = 6762, meanbuyprice_withDiscount = 6762
        , lastbuyprice_withTax = 6762, meanbuyprice_withTax = 6762, lastbuyprice_withDiscountAndTax = 6762
                where buybilldetailid = 19;
UPDATE productunit SET proUnitBuyPrice  = 6762 * productnumber WHERE productid = 390;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('390', '1', '2', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '2', '4', '1', '2026-09-17 16:31:55','0','0'); -- id=740
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00391', '7', '6', '391', '2', '5382', '10764.00', '0', '', '2026-09-17 17:00:49', '391','','','0','0','0','0','0',null,'5382','10764','0','0','0','0','0','0','0','0','1'); -- id=20
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 16:31:55', 1, 391, 0, 0
                    , 5382, 2, 0, 0, 1, '2026-09-17 17:00:52')
                ON DUPLICATE KEY UPDATE buyprice = 5382,
                        buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:00:52' ; -- id=20
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('391', '5382', '2', '0', 'buyBillController.php', '20', '', '0', '0'); -- id=20
UPDATE product SET  productBuyPrice = "5382" WHERE productId = 391 ;
UPDATE buybilldetail SET  quantitybefore = 2 WHERE buybilldetailid = 20 ;
UPDATE product SET productName = 'انتركم 4 خط فيرماكس اسباني ', productDescription = '', productCatId = '6', productBuyPrice = '5382.00', productSellAllPrice = '5480.00', productSellUnitPrice = '5600.00', productSellHalfPrice = '5480.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '1', parcode = '00391',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '5382',lastbuyprice_withDiscount = '5382',meanbuyprice = '5382',meanbuyprice_withDiscount = '5382' , productbuypricereal = '5382.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='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='5382',meanbuyprice_withTax='5382',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='5382',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '391';
UPDATE buybilldetail SET  lastbuyprice = 5382 , meanbuyprice = 5382, lastbuyprice_withDiscount = 5382, meanbuyprice_withDiscount = 5382
        , lastbuyprice_withTax = 5382, meanbuyprice_withTax = 5382, lastbuyprice_withDiscountAndTax = 5382
                where buybilldetailid = 20;
UPDATE productunit SET proUnitBuyPrice  = 5382 * productnumber WHERE productid = 391;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '391';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('391', '1', '2', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '2', '4', '1', '2026-09-17 16:31:55','0','0'); -- id=741
UPDATE supplier SET  suppliercurrentDebt = '31338',suppliercurrentDebtInCurrency= '31338' , userid = '1', supplierdate = '2026-09-17 17:00:49'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '0.00', '31338', '0', 'اضافة فاتورة مشتريات', '7', '31338', '2026-09-17 16:31:55', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','31338','1','0','31338','31338','0',''); -- id=20
update buybill set dailyentryid='0,0' where buybillid=7;
COMMIT;
UPDATE product SET overAllAveragePrice = 2350 WHERE productId = 389;UPDATE product SET overAllAveragePrice = 6762 WHERE productId = 390;UPDATE product SET overAllAveragePrice = 5382 WHERE productId = 391;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:30:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:00:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:00:53', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1377
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:31:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:01:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 17:01:29', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=1378
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:31:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:01:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:01:31', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php'); -- id=1379
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:31:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:01:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:01:54', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=add'); -- id=1380
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('اسلام طارق جوي', '', '', '31338', '', '0', '1', '2026-09-17 17:01:54', '0', '', '','0','0','','','','','','','','','','0','0','1','31338','0','0'); -- id=11
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 ('11', '0', '31338', '0', 'إضافة مورد جديد', '11', '31338', '2026-09-17 17:01:54', '1', 'supplierController.php', '', '0','', '0','1','1','31338','1','0','31338','31338','0',''); -- id=21
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '11',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('اسلام طارق جوي', 'اسلام طارق جوي', 'اسلام طارق جوي', 'اسلام طارق جوي', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-17 17:01:56'); -- id=440
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '31338', '31338', '2026-09-17', '1', '0', '0', '2026-09-17 17:01:56','إضافة مورد  ( اسلام طارق جوي ) ','1','0','0','0','11','supplierController.php?do=edit&id=11'); -- id=519
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('519', '121', '31338', '','0'); -- id=519
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1115082.87', 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';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('519', '440', '31338', '','0'); -- id=519
UPDATE accountstree SET name = 'اسلام طارق جوي', customName = 'اسلام طارق جوي', customNameEn = 'اسلام طارق جوي', nameEn = 'اسلام طارق جوي', parent = '81', accountNature = '1', theValue = '31338', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 17:01:56' WHERE id = '440';
COMMIT;
UPDATE supplier SET suppliername = 'اسلام طارق جوي', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '31338.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-17', dailyentryid = '519', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='440',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='31338',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '11';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:31:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:01:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:01:57', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=sucess'); -- id=1381
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:31:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:01:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:01:59', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=show'); -- id=1382
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:32:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:02:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:02:16', '1', 'tempdelete', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=tempdelete&id=1'); -- id=1383
UPDATE supplier SET conditions = 1, suppliername = "مباشر-del"
		        WHERE supplierid =1 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:32:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:02:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:02:17', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=sucess'); -- id=1384
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:32:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:02:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-17 17:02:18', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=show'); -- id=1385
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:32:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:02:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:02:31', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1386
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:33:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:03:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:03:56', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1387
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 ('06aac0108567a8', '2026-09-17 17:02:32', '11', '31338.00', '42936.8', '0', '0', '11598.80',  '11598.80', '0', '11598.8', '1', '2026-09-17 17:03:56', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=8
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00347', '8', '3', '347', '40', '29.77', '1190.80', '0', '', '2026-09-17 17:03:56', '347','','','0','0','0','0','0',null,'29.77','1190.8','0','0','0','0','0','0','0','0','1'); -- id=21
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:02:32', 1, 347, 0, 0
                    , 29.77, 40, 0, 0, 1, '2026-09-17 17:03:57')
                ON DUPLICATE KEY UPDATE buyprice = 29.77,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:03:57' ; -- id=21
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('347', '29.77', '40', '0', 'buyBillController.php', '21', '', '0', '0'); -- id=21
UPDATE product SET  productBuyPrice = "29.77" WHERE productId = 347 ;
UPDATE buybilldetail SET  quantitybefore = 15 WHERE buybilldetailid = 21 ;
UPDATE product SET productName = 'زر جرس مفرد', productDescription = '', productCatId = '3', productBuyPrice = '29.77', productSellAllPrice = '31.00', productSellUnitPrice = '31.00', productSellHalfPrice = '31.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00347',type ='0', expireDate = '0' , dailyentryId = '420',isService = '0',isOptic = '0',lastbuyprice = '29.77',lastbuyprice_withDiscount = '29.77',meanbuyprice = '29.77',meanbuyprice_withDiscount = '29.77' , productbuypricereal = '29.77' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.13' , buyhalf_precentage = '4.13' , buypart_precentage = '4.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='29.77',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='29.77',meanbuyprice_withTax='29.77',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='29.77',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '347';
UPDATE buybilldetail SET  lastbuyprice = 29.77 , meanbuyprice = 29.77, lastbuyprice_withDiscount = 29.77, meanbuyprice_withDiscount = 29.77
        , lastbuyprice_withTax = 29.77, meanbuyprice_withTax = 29.77, lastbuyprice_withDiscountAndTax = 29.77
                where buybilldetailid = 21;
UPDATE productunit SET proUnitBuyPrice  = 29.77 * productnumber WHERE productid = 347;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '347';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('347', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '15', '55', '1', '2026-09-17 17:02:32','0','0'); -- id=742
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00386', '8', '3', '386', '40', '78.4', '3136.00', '0', '', '2026-09-17 17:03:56', '386','','','0','0','0','0','0',null,'78.4','3136','0','0','0','0','0','0','0','0','1'); -- id=22
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:02:32', 1, 386, 0, 0
                    , 78.4, 40, 0, 0, 1, '2026-09-17 17:03:58')
                ON DUPLICATE KEY UPDATE buyprice = 78.4,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:03:58' ; -- id=22
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('386', '78.4', '40', '0', 'buyBillController.php', '22', '', '0', '0'); -- id=22
UPDATE product SET  productBuyPrice = "78.4" WHERE productId = 386 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 22 ;
UPDATE product SET productName = 'مفتاح سخان 20 امبير ', productDescription = '', productCatId = '3', productBuyPrice = '78.40', productSellAllPrice = '80.00', productSellUnitPrice = '82.50', productSellHalfPrice = '80.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00386',type ='0', expireDate = '0' , dailyentryId = '494',isService = '0',isOptic = '0',lastbuyprice = '78.4',lastbuyprice_withDiscount = '78.4',meanbuyprice = '78.4',meanbuyprice_withDiscount = '78.4' , productbuypricereal = '78.40' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.04' , buyhalf_precentage = '2.04' , buypart_precentage = '5.23',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='78.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='78.4',meanbuyprice_withTax='78.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='78.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '386';
UPDATE buybilldetail SET  lastbuyprice = 78.4 , meanbuyprice = 78.4, lastbuyprice_withDiscount = 78.4, meanbuyprice_withDiscount = 78.4
        , lastbuyprice_withTax = 78.4, meanbuyprice_withTax = 78.4, lastbuyprice_withDiscountAndTax = 78.4
                where buybilldetailid = 22;
UPDATE productunit SET proUnitBuyPrice  = 78.4 * productnumber WHERE productid = 386;
UPDATE storedetail SET  productquantity = '44', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '386';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('386', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '44', '1', '2026-09-17 17:02:32','0','0'); -- id=743
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00107', '8', '3', '107', '48', '101', '4848.00', '0', '', '2026-09-17 17:03:56', '107','','','0','0','0','0','0',null,'101','4848','0','0','0','0','0','0','0','0','1'); -- id=23
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:02:32', 1, 107, 0, 0
                    , 101, 48, 0, 0, 1, '2026-09-17 17:03:59')
                ON DUPLICATE KEY UPDATE buyprice = 101,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:03:59' ; -- id=23
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('107', '101', '48', '0', 'buyBillController.php', '23', '', '0', '0'); -- id=23
UPDATE product SET  productBuyPrice = "101" WHERE productId = 107 ;
UPDATE buybilldetail SET  quantitybefore = 46 WHERE buybilldetailid = 23 ;
UPDATE product SET productName = 'مفتاح اتوماتيك 16 امبير ', productDescription = '', productCatId = '3', productBuyPrice = '101.00', productSellAllPrice = '103.00', productSellUnitPrice = '103.00', productSellHalfPrice = '103.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '12', parcode = '00107',type ='0', expireDate = '0' , dailyentryId = '116',isService = '0',isOptic = '0',lastbuyprice = '101',lastbuyprice_withDiscount = '101',meanbuyprice = '101',meanbuyprice_withDiscount = '101' , productbuypricereal = '101.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.98' , buyhalf_precentage = '1.98' , buypart_precentage = '1.98',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='101',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='101',meanbuyprice_withTax='101',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='101',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '107';
UPDATE buybilldetail SET  lastbuyprice = 101 , meanbuyprice = 101, lastbuyprice_withDiscount = 101, meanbuyprice_withDiscount = 101
        , lastbuyprice_withTax = 101, meanbuyprice_withTax = 101, lastbuyprice_withDiscountAndTax = 101
                where buybilldetailid = 23;
UPDATE productunit SET proUnitBuyPrice  = 101 * productnumber WHERE productid = 107;
UPDATE storedetail SET  productquantity = '94', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '107';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('107', '1', '48', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '46', '94', '1', '2026-09-17 17:02:32','0','0'); -- id=744
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00108', '8', '3', '108', '24', '101', '2424.00', '0', '', '2026-09-17 17:03:56', '108','','','0','0','0','0','0',null,'101','2424','0','0','0','0','0','0','0','0','1'); -- id=24
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:02:32', 1, 108, 0, 0
                    , 101, 24, 0, 0, 1, '2026-09-17 17:03:59')
                ON DUPLICATE KEY UPDATE buyprice = 101,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:03:59' ; -- id=24
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('108', '101', '24', '0', 'buyBillController.php', '24', '', '0', '0'); -- id=24
UPDATE product SET  productBuyPrice = "101" WHERE productId = 108 ;
UPDATE buybilldetail SET  quantitybefore = 23 WHERE buybilldetailid = 24 ;
UPDATE product SET productName = 'مفتاح اتوماتيك 20 امبير', productDescription = '', productCatId = '3', productBuyPrice = '101.00', productSellAllPrice = '103.00', productSellUnitPrice = '103.00', productSellHalfPrice = '103.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '12', parcode = '00108',type ='0', expireDate = '0' , dailyentryId = '117',isService = '0',isOptic = '0',lastbuyprice = '101',lastbuyprice_withDiscount = '101',meanbuyprice = '101',meanbuyprice_withDiscount = '101' , productbuypricereal = '101.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.98' , buyhalf_precentage = '1.98' , buypart_precentage = '1.98',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='101',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='101',meanbuyprice_withTax='101',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='101',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '108';
UPDATE buybilldetail SET  lastbuyprice = 101 , meanbuyprice = 101, lastbuyprice_withDiscount = 101, meanbuyprice_withDiscount = 101
        , lastbuyprice_withTax = 101, meanbuyprice_withTax = 101, lastbuyprice_withDiscountAndTax = 101
                where buybilldetailid = 24;
UPDATE productunit SET proUnitBuyPrice  = 101 * productnumber WHERE productid = 108;
UPDATE storedetail SET  productquantity = '47', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '108';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('108', '1', '24', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '23', '47', '1', '2026-09-17 17:02:32','0','0'); -- id=745
UPDATE supplier SET  suppliercurrentDebt = '42936.8',suppliercurrentDebtInCurrency= '42936.8' , userid = '1', supplierdate = '2026-09-17 17:03:56'   WHERE supplierid = '11';
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 ('11', '31338.00', '11598.8', '0', 'اضافة فاتورة مشتريات', '8', '42936.8', '2026-09-17 17:02:32', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','11598.8','1','31338','11598.8','42936.8','0',''); -- id=22
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11598.8', '11598.8', '2026-09-17', '1', '0', '0', '2026-09-17 17:04:00','اضافة فاتورة مشتريات رقم 8','1','0',null,'0','8','buyBillController.php?do=details&id=8'); -- id=520
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('520', '382', '11598.8', '','0'); -- id=520
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2190999.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('520', '440', '11598.8', '','0'); -- id=520
UPDATE accountstree SET name = 'اسلام طارق جوي', customName = 'اسلام طارق جوي', customNameEn = 'اسلام طارق جوي', nameEn = 'اسلام طارق جوي', parent = '81', accountNature = '1', theValue = '42936.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 17:01:56' WHERE id = '440';
update buybill set dailyentryid='520,0' where buybillid=8;
COMMIT;
UPDATE product SET overAllAveragePrice = 101 WHERE productId = 107;UPDATE product SET overAllAveragePrice = 101 WHERE productId = 108;UPDATE product SET overAllAveragePrice = 29.77 WHERE productId = 347;UPDATE product SET overAllAveragePrice = 78.4 WHERE productId = 386;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:34:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:04:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:04:01', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=8'); -- id=1388
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:34:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:04:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:04:12', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=1389
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:34:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:04:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:04:58', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=1390
BEGIN;
CALL supplierInUse(11,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('11', '42936.80', '26788', '1', 'ايصال دفع لمورد', '1', '16148.8', '2026-09-17 17:04:12', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','26788','1','0','0','0','5',''); -- id=23
UPDATE supplierdebtchange SET supplierid = '11', supplierdebtchangebefore = '42936.80', supplierdebtchangeamount = '26788', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '16148.8', supplierdebtchangedate = '2026-09-17 17:04:12', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='26788',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='42936.8',debtchangamountInSupplierCurrency='26788',debtchangafterInSupplierCurrency='16148.8', paySerialNo='5',tagids='' WHERE supplierdebtchangeid = '23';
UPDATE supplier SET  suppliercurrentDebt = '16148.8',suppliercurrentDebtInCurrency= '16148.8' , userid = '1', supplierdate = '2026-09-17 17:04:59'   WHERE supplierid = '11';
UPDATE supplier SET  inUse = 0 where supplierid = 11;
UPDATE save SET  savecurrentvalue = '-258458.48',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-231670.48','26788', '1', '1', 'ايصال دفع لمورد', '23', '-258458.48', '2026-09-17 17:04:59', '1',  'supplierPayedDeptController.php','0','','0'); -- id=38
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26788', '26788', '2026-09-17', '1', '0', '0', '2026-09-17 17:04:59','ايصال دفع لمورد ( اسلام طارق جوي ) ','1','0','0','0','23','supplierReportsController.php?do=show&id=23'); -- id=521
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('521', '440', '26788', '','0'); -- id=521
UPDATE accountstree SET name = 'اسلام طارق جوي', customName = 'اسلام طارق جوي', customNameEn = 'اسلام طارق جوي', nameEn = 'اسلام طارق جوي', parent = '81', accountNature = '1', theValue = '16148.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 17:01:56' WHERE id = '440';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('521', '383', '26788', '','0'); -- id=521
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-211766.48', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '11', supplierdebtchangebefore = '42936.80', supplierdebtchangeamount = '26788.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '16148.80', supplierdebtchangedate = '2026-09-17 17:04:12', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '521',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='26788',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='42936.8',debtchangamountInSupplierCurrency='26788',debtchangafterInSupplierCurrency='16148.8', paySerialNo='5',tagids='' WHERE supplierdebtchangeid = '23';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:35:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:05:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:05:00', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=1391
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:35:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:05:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:05:02', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=1392
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:35:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:05:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:05:03', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=1393
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:35:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:05:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:05:46', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1394
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:38:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:08:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:08:27', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1395
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 ('06aac01cb0a0bd', '2026-09-17 17:05:47', '9', '176067.00', '185321.4', '0', '0', '9254.40',  '9254.40', '0', '9254.4', '1', '2026-09-17 17:08:27', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=9
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00388', '9', '20', '388', '1920', '4.82', '9254.40', '0', '', '2026-09-17 17:08:27', '388','','','0','0','0','0','0',null,'4.82','9254.4','0','0','0','0','0','0','0','0','1'); -- id=25
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:05:47', 1, 388, 0, 0
                    , 4.82, 1920, 0, 0, 1, '2026-09-17 17:08:28')
                ON DUPLICATE KEY UPDATE buyprice = 4.82,
                        buyQuantity =buyQuantity+1920, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:08:28' ; -- id=25
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('388', '4.82', '1920', '0', 'buyBillController.php', '25', '', '0', '0'); -- id=25
UPDATE product SET  productBuyPrice = "4.82" WHERE productId = 388 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 25 ;
UPDATE product SET productName = 'علبه ماجيك مفرد ', productDescription = '', productCatId = '20', productBuyPrice = '4.82', productSellAllPrice = '5.00', productSellUnitPrice = '5.25', productSellHalfPrice = '5.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00388',type ='0', expireDate = '0' , dailyentryId = '496',isService = '0',isOptic = '0',lastbuyprice = '4.82',lastbuyprice_withDiscount = '4.82',meanbuyprice = '4.82',meanbuyprice_withDiscount = '4.82' , productbuypricereal = '4.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.42' , buyhalf_precentage = '4.42' , buypart_precentage = '4.42',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.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='4.82',meanbuyprice_withTax='4.82',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.82',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '388';
UPDATE buybilldetail SET  lastbuyprice = 4.82 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.82, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.82, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.82
                where buybilldetailid = 25;
UPDATE productunit SET proUnitBuyPrice  = 4.82 * productnumber WHERE productid = 388;
UPDATE storedetail SET  productquantity = '1945', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '1920', '0', '9', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '1945', '1', '2026-09-17 17:05:47','0','0'); -- id=746
UPDATE supplier SET  suppliercurrentDebt = '185321.4',suppliercurrentDebtInCurrency= '185321.4' , userid = '1', supplierdate = '2026-09-17 17:08:27'   WHERE supplierid = '9';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('9', '176067.00', '9254.4', '0', 'اضافة فاتورة مشتريات', '9', '185321.4', '2026-09-17 17:05:47', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9254.4','1','176067','9254.4','185321.4','0',''); -- id=24
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9254.4', '9254.4', '2026-09-17', '1', '0', '0', '2026-09-17 17:08:29','اضافة فاتورة مشتريات رقم 9','1','0',null,'0','9','buyBillController.php?do=details&id=9'); -- id=522
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('522', '382', '9254.4', '','0'); -- id=522
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2200253.65', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('522', '432', '9254.4', '','0'); -- id=522
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '185321.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
update buybill set dailyentryid='522,0' where buybillid=9;
COMMIT;
UPDATE product SET overAllAveragePrice = 4.82 WHERE productId = 388;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:38:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:08:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:08:30', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=9'); -- id=1396
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:38:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:08:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:08:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=1397
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:09:00', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=1398
BEGIN;
CALL supplierInUse(9,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('9', '185321.40', '22000', '1', 'ايصال دفع لمورد', '1', '163321.4', '2026-09-17 17:08:47', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','22000','1','0','0','0','6',''); -- id=25
UPDATE supplierdebtchange SET supplierid = '9', supplierdebtchangebefore = '185321.40', supplierdebtchangeamount = '22000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '163321.4', supplierdebtchangedate = '2026-09-17 17:08:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='22000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='185321.4',debtchangamountInSupplierCurrency='22000',debtchangafterInSupplierCurrency='163321.4', paySerialNo='6',tagids='' WHERE supplierdebtchangeid = '25';
UPDATE supplier SET  suppliercurrentDebt = '163321.4',suppliercurrentDebtInCurrency= '163321.4' , userid = '1', supplierdate = '2026-09-17 17:09:00'   WHERE supplierid = '9';
UPDATE supplier SET  inUse = 0 where supplierid = 9;
UPDATE save SET  savecurrentvalue = '-280458.48',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-258458.48','22000', '1', '1', 'ايصال دفع لمورد', '25', '-280458.48', '2026-09-17 17:09:01', '1',  'supplierPayedDeptController.php','0','','0'); -- id=39
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '22000', '22000', '2026-09-17', '1', '0', '0', '2026-09-17 17:09:01','ايصال دفع لمورد ( شركه باندا حساب نشات  ) ','1','0','0','0','25','supplierReportsController.php?do=show&id=25'); -- id=523
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('523', '432', '22000', '','0'); -- id=523
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '163321.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('523', '383', '22000', '','0'); -- id=523
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-233766.48', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '9', supplierdebtchangebefore = '185321.40', supplierdebtchangeamount = '22000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '163321.40', supplierdebtchangedate = '2026-09-17 17:08:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '523',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='22000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='185321.4',debtchangamountInSupplierCurrency='22000',debtchangafterInSupplierCurrency='163321.4', paySerialNo='6',tagids='' WHERE supplierdebtchangeid = '25';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:09:02', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=1399
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:09:04', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=1400
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:09:04', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=1401
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:09:23', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1402
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:09:30', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1403
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:09:44', '1', 'details', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=details&id=9'); -- id=1404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:39:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:09:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:09:56', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1405
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:40:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:10:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:10:01', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1406
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:40:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:10:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:10:06', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1407
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:40:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:10:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:10:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=1408
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:11:01', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=1409
BEGIN;
CALL supplierInUse(10,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('10', '33160.00', '5000', '1', 'ايصال دفع لمورد', '1', '28160', '2026-09-17 17:10:47', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','5000','1','0','0','0','7',''); -- id=26
UPDATE supplierdebtchange SET supplierid = '10', supplierdebtchangebefore = '33160.00', supplierdebtchangeamount = '5000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '28160', supplierdebtchangedate = '2026-09-17 17:10:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='5000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='33160',debtchangamountInSupplierCurrency='5000',debtchangafterInSupplierCurrency='28160', paySerialNo='7',tagids='' WHERE supplierdebtchangeid = '26';
UPDATE supplier SET  suppliercurrentDebt = '28160',suppliercurrentDebtInCurrency= '28160' , userid = '1', supplierdate = '2026-09-17 17:11:02'   WHERE supplierid = '10';
UPDATE supplier SET  inUse = 0 where supplierid = 10;
UPDATE save SET  savecurrentvalue = '-285458.48',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-280458.48','5000', '1', '1', 'ايصال دفع لمورد', '26', '-285458.48', '2026-09-17 17:11:02', '1',  'supplierPayedDeptController.php','0','','0'); -- id=40
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5000', '5000', '2026-09-17', '1', '0', '0', '2026-09-17 17:11:02','ايصال دفع لمورد ( شركه باندا حساب محمد ) ','1','0','0','0','26','supplierReportsController.php?do=show&id=26'); -- id=524
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('524', '433', '5000', '','0'); -- id=524
UPDATE accountstree SET name = 'شركه باندا حساب محمد', customName = 'شركه باندا حساب محمد', customNameEn = 'شركه باندا حساب محمد', nameEn = 'شركه باندا حساب محمد', parent = '81', accountNature = '1', theValue = '28160', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:33' WHERE id = '433';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('524', '383', '5000', '','0'); -- id=524
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-238766.48', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '10', supplierdebtchangebefore = '33160.00', supplierdebtchangeamount = '5000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '28160.00', supplierdebtchangedate = '2026-09-17 17:10:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '524',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='5000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='33160',debtchangamountInSupplierCurrency='5000',debtchangafterInSupplierCurrency='28160', paySerialNo='7',tagids='' WHERE supplierdebtchangeid = '26';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:11:03', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=1410
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:11:05', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=1411
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:11:06', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=1412
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:11:08', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1413
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:11:32', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1414

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aac030d49278
-- ----------------------------------------------------------------------------------------------------

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-09-17 17:11:33', '06aac030d49278', '1', '0.00', '0', '0', '1', '3780.00', '3780', '3780', '0', '1', '2026-09-17 17:11:33', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '720' ,'0','','','','','-1','0','0','0','0','0','3780','0','','0','0','3780','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=38
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','اضافة فاتورة مبيعات','38', '0', '2026-09-17 17:11:33', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3780', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 17:11:33','0','0','',''); -- id=62
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+720 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.82','00388', '38', '20', '388', '720', '5.25', '3780', '0', '', '1', '2026-09-17 17:11:33', '388', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','25-720,','1','1','0','0','5.25','3780','0','','0','0.00','0','0','0','0'); -- id=222
UPDATE sellbilldetail SET  lastbuyprice = 4.82 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.82, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.82, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.82
                where sellbilldetailid = 222;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (388, '2026-09-17', 3780, 3470.4, 3470.4
                    , 3470.4, 3470.4, 3470.4, 3470.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 720, 0, 3470.4, 3470.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3470.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3470.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3470.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3470.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3470.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3470.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3470.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3470.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+720
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 3780, 3470.4, 3470.4
                    , 3470.4, 3470.4, 3470.4, 3470.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3470.4, 3470.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3470.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3470.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3470.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3470.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3470.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3470.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3470.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3470.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 = '1225', userid = '1', storedetaildate = '2026-09-17 17:11:34' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '720', '1', '38', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1945', '1225', '1', '2026-09-17 17:11:34','0','0'); -- id=747
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-281678.46875',  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 ('-285458.46875','3780', '0', '1', 'اضافة فاتورة مبيعات', '38', '-281678.46875', '2026-09-17 17:11:34', '1',  'sellbillController.php','1','','0'); -- id=41
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3780', '3780', '2026-09-17', '1', '0', '0', '2026-09-17 17:11:34','اضافة فاتورة مبيعات رقم 38','1','0',null,'0','38','sellbillController.php?do=showDetail&sellbillid=38'); -- id=525
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('525', '383', '3780', '','0'); -- id=525
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-234986.48', 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 ('525', '143', '3780', '','0'); -- id=525
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '82734.29', 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 ( '3470.4', '3470.4', '2026-09-17', '1', '0', '0', '2026-09-17 17:11:34','اضافة فاتورة مبيعات رقم 38 - صرف البضاعة من المخزن','1','0',null,'0','38','sellbillController.php?do=showDetail&sellbillid=38'); -- id=526
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('526', '402', '3470.4', '','0'); -- id=526
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '79027.32', 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 ('526', '382', '3470.4', '','0'); -- id=526
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2196783.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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='525,0,526' where sellbillid=38;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 3780, 3470.4, 3470.4
                    , 3470.4, 3470.4, 3470.4, 3470.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3470.4, 3470.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3470.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3470.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3470.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3470.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3470.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3470.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3470.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3470.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;
 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-09-17', 3780, 3470.4, 3470.4
                    , 3470.4, 3470.4, 3470.4, 3470.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3470.4, 3470.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3470.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3470.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3470.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3470.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3470.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3470.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3470.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3470.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3780, 3470.4, 3470.4
                    , 3470.4, 3470.4, 3470.4, 3470.4, 3470.4, 3470.4)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3780, netSellCostBuyPrice = netSellCostBuyPrice+3470.4
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3470.4
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3470.4
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3470.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3470.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3470.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3470.4
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3470.4;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:11:35', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1415
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:41:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:11:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:11:49', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1416
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:43:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:13:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:13:44', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=1417
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 ('06aac03360fbb8', '2026-09-17 17:11:50', '8', '5580.00', '14765', '0', '0', '9185.00',  '9185.00', '0', '9185', '1', '2026-09-17 17:13:44', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=10
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00168', '10', '2', '168', '100', '21.5', '2150.00', '0', '', '2026-09-17 17:13:44', '168','','','0','0','0','0','0',null,'21.5','2150','0','0','0','0','0','0','0','0','1'); -- id=26
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:11:50', 1, 168, 0, 0
                    , 21.5, 100, 0, 0, 1, '2026-09-17 17:13:45')
                ON DUPLICATE KEY UPDATE buyprice = 21.5,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:13:45' ; -- id=26
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('168', '21.5', '100', '0', 'buyBillController.php', '26', '', '0', '0'); -- id=26
UPDATE product SET  productBuyPrice = "21.5" WHERE productId = 168 ;
UPDATE buybilldetail SET  quantitybefore = 238 WHERE buybilldetailid = 26 ;
UPDATE product SET productName = 'لمبه 13 وات كينو قلاوظ ', productDescription = '', productCatId = '2', productBuyPrice = '21.50', productSellAllPrice = '24.50', productSellUnitPrice = '30.00', productSellHalfPrice = '25.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00168',type ='0', expireDate = '0' , dailyentryId = '192',isService = '0',isOptic = '0',lastbuyprice = '21.5',lastbuyprice_withDiscount = '21.5',meanbuyprice = '21.5',meanbuyprice_withDiscount = '21.5' , productbuypricereal = '21.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.95' , buyhalf_precentage = '16.28' , buypart_precentage = '39.53',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='21.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='21.5',meanbuyprice_withTax='21.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='21.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 = '168';
UPDATE buybilldetail SET  lastbuyprice = 21.5 , meanbuyprice = 21.5, lastbuyprice_withDiscount = 21.5, meanbuyprice_withDiscount = 21.5
        , lastbuyprice_withTax = 21.5, meanbuyprice_withTax = 21.5, lastbuyprice_withDiscountAndTax = 21.5
                where buybilldetailid = 26;
UPDATE productunit SET proUnitBuyPrice  = 21.5 * productnumber WHERE productid = 168;
UPDATE storedetail SET  productquantity = '338', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '168';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('168', '1', '100', '0', '10', 'اضافة فاتورة مشتريات', 'buyBillController.php', '238', '338', '1', '2026-09-17 17:11:50','0','0'); -- id=748
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00167', '10', '2', '167', '50', '21.5', '1075.00', '0', '', '2026-09-17 17:13:44', '167','','','0','0','0','0','0',null,'21.5','1075','0','0','0','0','0','0','0','0','1'); -- id=27
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:11:50', 1, 167, 0, 0
                    , 21.5, 50, 0, 0, 1, '2026-09-17 17:13:46')
                ON DUPLICATE KEY UPDATE buyprice = 21.5,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:13:46' ; -- id=27
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('167', '21.5', '50', '0', 'buyBillController.php', '27', '', '0', '0'); -- id=27
UPDATE product SET  productBuyPrice = "21.5" WHERE productId = 167 ;
UPDATE buybilldetail SET  quantitybefore = 46 WHERE buybilldetailid = 27 ;
UPDATE product SET productName = 'لمبه 13 وات كينو مسمار ', productDescription = '', productCatId = '2', productBuyPrice = '21.50', productSellAllPrice = '25.00', productSellUnitPrice = '30.00', productSellHalfPrice = '25.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00167',type ='0', expireDate = '0' , dailyentryId = '185',isService = '0',isOptic = '0',lastbuyprice = '21.5',lastbuyprice_withDiscount = '21.5',meanbuyprice = '21.5',meanbuyprice_withDiscount = '21.5' , productbuypricereal = '21.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '16.28' , buyhalf_precentage = '16.28' , buypart_precentage = '39.53',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='21.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='21.5',meanbuyprice_withTax='21.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='21.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 = '167';
UPDATE buybilldetail SET  lastbuyprice = 21.5 , meanbuyprice = 21.5, lastbuyprice_withDiscount = 21.5, meanbuyprice_withDiscount = 21.5
        , lastbuyprice_withTax = 21.5, meanbuyprice_withTax = 21.5, lastbuyprice_withDiscountAndTax = 21.5
                where buybilldetailid = 27;
UPDATE productunit SET proUnitBuyPrice  = 21.5 * productnumber WHERE productid = 167;
UPDATE storedetail SET  productquantity = '96', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '167';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('167', '1', '50', '0', '10', 'اضافة فاتورة مشتريات', 'buyBillController.php', '46', '96', '1', '2026-09-17 17:11:50','0','0'); -- id=749
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00170', '10', '2', '170', '40', '64', '2560.00', '0', '', '2026-09-17 17:13:44', '170','','','0','0','0','0','0',null,'64','2560','0','0','0','0','0','0','0','0','1'); -- id=28
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:11:50', 1, 170, 0, 0
                    , 64, 40, 0, 0, 1, '2026-09-17 17:13:46')
                ON DUPLICATE KEY UPDATE buyprice = 64,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:13:46' ; -- id=28
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('170', '64', '40', '0', 'buyBillController.php', '28', '', '0', '0'); -- id=28
UPDATE product SET  productBuyPrice = "64" WHERE productId = 170 ;
UPDATE buybilldetail SET  quantitybefore = 73 WHERE buybilldetailid = 28 ;
UPDATE product SET productName = 'لمبه 48 وات كينو قلاوظ', productDescription = '', productCatId = '2', productBuyPrice = '64.00', productSellAllPrice = '74.00', productSellUnitPrice = '80.00', productSellHalfPrice = '75.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00170',type ='0', expireDate = '0' , dailyentryId = '194',isService = '0',isOptic = '0',lastbuyprice = '64',lastbuyprice_withDiscount = '64',meanbuyprice = '64',meanbuyprice_withDiscount = '64' , productbuypricereal = '64.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '17.19' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='64',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='64',meanbuyprice_withTax='64',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='64',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '170';
UPDATE buybilldetail SET  lastbuyprice = 64 , meanbuyprice = 64, lastbuyprice_withDiscount = 64, meanbuyprice_withDiscount = 64
        , lastbuyprice_withTax = 64, meanbuyprice_withTax = 64, lastbuyprice_withDiscountAndTax = 64
                where buybilldetailid = 28;
UPDATE productunit SET proUnitBuyPrice  = 64 * productnumber WHERE productid = 170;
UPDATE storedetail SET  productquantity = '113', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('170', '1', '40', '0', '10', 'اضافة فاتورة مشتريات', 'buyBillController.php', '73', '113', '1', '2026-09-17 17:11:50','0','0'); -- id=750
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00169', '10', '2', '169', '100', '34', '3400.00', '0', '', '2026-09-17 17:13:44', '169','','','0','0','0','0','0',null,'34','3400','0','0','0','0','0','0','0','0','1'); -- id=29
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-17 17:11:50', 1, 169, 0, 0
                    , 34, 100, 0, 0, 1, '2026-09-17 17:13:47')
                ON DUPLICATE KEY UPDATE buyprice = 34,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-17 17:13:47' ; -- id=29
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('169', '34', '100', '0', 'buyBillController.php', '29', '', '0', '0'); -- id=29
UPDATE product SET  productBuyPrice = "34" WHERE productId = 169 ;
UPDATE buybilldetail SET  quantitybefore = 86 WHERE buybilldetailid = 29 ;
UPDATE product SET productName = 'لمبه 20 وات كينو قلاوظ', productDescription = '', productCatId = '2', productBuyPrice = '34.00', productSellAllPrice = '38.50', productSellUnitPrice = '50.00', productSellHalfPrice = '42.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00169',type ='0', expireDate = '0' , dailyentryId = '193',isService = '0',isOptic = '0',lastbuyprice = '34',lastbuyprice_withDiscount = '34',meanbuyprice = '34',meanbuyprice_withDiscount = '34' , productbuypricereal = '34.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.24' , buyhalf_precentage = '23.53' , buypart_precentage = '47.06',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34',meanbuyprice_withTax='34',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '169';
UPDATE buybilldetail SET  lastbuyprice = 34 , meanbuyprice = 34, lastbuyprice_withDiscount = 34, meanbuyprice_withDiscount = 34
        , lastbuyprice_withTax = 34, meanbuyprice_withTax = 34, lastbuyprice_withDiscountAndTax = 34
                where buybilldetailid = 29;
UPDATE productunit SET proUnitBuyPrice  = 34 * productnumber WHERE productid = 169;
UPDATE storedetail SET  productquantity = '186', userid = '1', storedetaildate = '2026-09-17' WHERE storedetailid = '169';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('169', '1', '100', '0', '10', 'اضافة فاتورة مشتريات', 'buyBillController.php', '86', '186', '1', '2026-09-17 17:11:50','0','0'); -- id=751
UPDATE supplier SET  suppliercurrentDebt = '14765',suppliercurrentDebtInCurrency= '14765' , userid = '1', supplierdate = '2026-09-17 17:13:44'   WHERE supplierid = '8';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('8', '5580.00', '9185', '0', 'اضافة فاتورة مشتريات', '10', '14765', '2026-09-17 17:11:50', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','9185','1','5580','9185','14765','0',''); -- id=27
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9185', '9185', '2026-09-17', '1', '0', '0', '2026-09-17 17:13:48','اضافة فاتورة مشتريات رقم 10','1','0',null,'0','10','buyBillController.php?do=details&id=10'); -- id=527
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('527', '382', '9185', '','0'); -- id=527
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2205968.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('527', '429', '9185', '','0'); -- id=527
UPDATE accountstree SET name = 'محمد الفرسان ', customName = 'محمد الفرسان ', customNameEn = 'محمد الفرسان ', nameEn = 'محمد الفرسان ', parent = '81', accountNature = '1', theValue = '14765', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 10:36:58' WHERE id = '429';
update buybill set dailyentryid='527,0' where buybillid=10;
COMMIT;
UPDATE product SET overAllAveragePrice = 21.5 WHERE productId = 167;UPDATE product SET overAllAveragePrice = 21.5 WHERE productId = 168;UPDATE product SET overAllAveragePrice = 34 WHERE productId = 169;UPDATE product SET overAllAveragePrice = 64 WHERE productId = 170;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:43:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:13:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-17 17:13:49', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=10'); -- id=1418
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:43:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:13:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:13:54', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=1419
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:44:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:14:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:14:33', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=1420
BEGIN;
CALL supplierInUse(8,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('8', '14765.00', '8765', '1', 'ايصال دفع لمورد', '1', '6000', '2026-09-17 17:13:54', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','8765','1','0','0','0','8',''); -- id=28
UPDATE supplierdebtchange SET supplierid = '8', supplierdebtchangebefore = '14765.00', supplierdebtchangeamount = '8765', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '6000', supplierdebtchangedate = '2026-09-17 17:13:54', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='8765',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='14765',debtchangamountInSupplierCurrency='8765',debtchangafterInSupplierCurrency='6000', paySerialNo='8',tagids='' WHERE supplierdebtchangeid = '28';
UPDATE supplier SET  suppliercurrentDebt = '6000',suppliercurrentDebtInCurrency= '6000' , userid = '1', supplierdate = '2026-09-17 17:14:34'   WHERE supplierid = '8';
UPDATE supplier SET  inUse = 0 where supplierid = 8;
UPDATE save SET  savecurrentvalue = '-290443.47',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-281678.47','8765', '1', '1', 'ايصال دفع لمورد', '28', '-290443.47', '2026-09-17 17:14:34', '1',  'supplierPayedDeptController.php','0','','0'); -- id=42
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8765', '8765', '2026-09-17', '1', '0', '0', '2026-09-17 17:14:34','ايصال دفع لمورد ( محمد الفرسان  ) ','1','0','0','0','28','supplierReportsController.php?do=show&id=28'); -- id=528
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('528', '429', '8765', '','0'); -- id=528
UPDATE accountstree SET name = 'محمد الفرسان ', customName = 'محمد الفرسان ', customNameEn = 'محمد الفرسان ', nameEn = 'محمد الفرسان ', parent = '81', accountNature = '1', theValue = '6000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 10:36:58' WHERE id = '429';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('528', '383', '8765', '','0'); -- id=528
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-243751.48', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '8', supplierdebtchangebefore = '14765.00', supplierdebtchangeamount = '8765.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '6000.00', supplierdebtchangedate = '2026-09-17 17:13:54', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '528',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='8765',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='14765',debtchangamountInSupplierCurrency='8765',debtchangafterInSupplierCurrency='6000', paySerialNo='8',tagids='' WHERE supplierdebtchangeid = '28';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:44:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:14:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:14:35', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=1421
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:44:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:14:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-17 17:14:37', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=1422
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:44:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:14:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-17 17:14:38', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=1423
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:45:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:15:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:15:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1424
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:46:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:16:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:16:41', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1425
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:48:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:18:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:18:51', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1426
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 ('وصله بالسلك ','','7','4.5','5','5','5','2026-09-17','0','1','0','','0','0','0','0','0','4.5','4.5','4.5','4.5','4.5','0','11.11','11.11','11.11','.','0','0','0','4.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','4.5','4.5','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','4.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=392
UPDATE product SET productName = 'وصله بالسلك ', productDescription = '', productCatId = '7', productBuyPrice = '4.5', productSellAllPrice = '5', productSellUnitPrice = '5', productSellHalfPrice = '5', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00392',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4.5',lastbuyprice_withDiscount = '4.5',meanbuyprice = '4.5',meanbuyprice_withDiscount = '4.5' , productbuypricereal = '4.5' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.5',meanbuyprice_withTax='4.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '392';
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', '392', '1.00', '2026-09-17', '1', '0','0039201','5','5','5','4.5','','0','0','0','0','0','0','0','0','0','0'); -- id=392
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('392', '1', '80', '1', '2026-09-17'); -- id=392
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('392', '1', '80', '0', '392', 'إضافة منتج', 'productController.php', '0', '80', '1', '2026-09-17','0','0'); -- id=752
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (392, 1,'2026-09-17 17:18:53',1)
                ON DUPLICATE KEY UPDATE productid = 392, edited = 1, sysdate = '2026-09-17 17:18:53', userid = 1; -- id=463
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '360', '360', '2026-09-17', '1', '0', '0', '2026-09-17 17:18:53','إضافة منتج وصله بالسلك  الكمية 80','1','0','0','0','392','productController.php?do=edit&id=392'); -- id=529
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('529', '382', '360', '','0'); -- id=529
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2206328.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('529', '121', '360', '','0'); -- id=529
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1115442.87', 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 = '7', productBuyPrice = '4.50', productSellAllPrice = '5.00', productSellUnitPrice = '5.00', productSellHalfPrice = '5.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00392',type ='0', expireDate = '0' , dailyentryId = '529',isService = '0',isOptic = '0',lastbuyprice = '4.5',lastbuyprice_withDiscount = '4.5',meanbuyprice = '4.5',meanbuyprice_withDiscount = '4.5' , productbuypricereal = '4.5' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.5',meanbuyprice_withTax='4.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '392';
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 ('وصله بدون سلك ','','7','4','5','5','5','2026-09-17','0','1','0','','0','0','0','0','0','4','4','4','4','4','0','25','25','25','.','0','0','0','4','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','4','4','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','4','0','0','0','0','0','0','','','0','0','0','0'); -- id=393
UPDATE product SET productName = 'وصله بدون سلك ', productDescription = '', productCatId = '7', productBuyPrice = '4', productSellAllPrice = '5', productSellUnitPrice = '5', productSellHalfPrice = '5', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00393',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '4',lastbuyprice_withDiscount = '4',meanbuyprice = '4',meanbuyprice_withDiscount = '4' , productbuypricereal = '4' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '25' , buypart_precentage = '25',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4',meanbuyprice_withTax='4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '393';
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', '393', '1.00', '2026-09-17', '1', '0','0039301','5','5','5','4','','0','0','0','0','0','0','0','0','0','0'); -- id=393
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('393', '1', '300', '1', '2026-09-17'); -- id=393
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('393', '1', '300', '0', '393', 'إضافة منتج', 'productController.php', '0', '300', '1', '2026-09-17','0','0'); -- id=753
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (393, 1,'2026-09-17 17:18:55',1)
                ON DUPLICATE KEY UPDATE productid = 393, edited = 1, sysdate = '2026-09-17 17:18:55', userid = 1; -- id=464
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1200', '1200', '2026-09-17', '1', '0', '0', '2026-09-17 17:18:55','إضافة منتج وصله بدون سلك  الكمية 300','1','0','0','0','393','productController.php?do=edit&id=393'); -- id=530
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('530', '382', '1200', '','0'); -- id=530
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2207528.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('530', '121', '1200', '','0'); -- id=530
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1116642.87', 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 = '7', productBuyPrice = '4.00', productSellAllPrice = '5.00', productSellUnitPrice = '5.00', productSellHalfPrice = '5.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00393',type ='0', expireDate = '0' , dailyentryId = '530',isService = '0',isOptic = '0',lastbuyprice = '4',lastbuyprice_withDiscount = '4',meanbuyprice = '4',meanbuyprice_withDiscount = '4' , productbuypricereal = '4' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '25' , buypart_precentage = '25',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4',meanbuyprice_withTax='4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '393';
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 ('وصله زاويه ','','7','6','8','8','8','2026-09-17','0','1','0','','0','0','0','0','0','6','6','6','6','6','0','33.33','33.33','33.33','.','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=394
UPDATE product SET productName = 'وصله زاويه ', productDescription = '', productCatId = '7', productBuyPrice = '6', productSellAllPrice = '8', productSellUnitPrice = '8', productSellHalfPrice = '8', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00394',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 = '33.33' , buyhalf_precentage = '33.33' , buypart_precentage = '33.33',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 = '394';
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', '394', '1.00', '2026-09-17', '1', '0','0039401','8','8','8','6','','0','0','0','0','0','0','0','0','0','0'); -- id=394
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('394', '1', '100', '1', '2026-09-17'); -- id=394
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('394', '1', '100', '0', '394', 'إضافة منتج', 'productController.php', '0', '100', '1', '2026-09-17','0','0'); -- id=754
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (394, 1,'2026-09-17 17:18:57',1)
                ON DUPLICATE KEY UPDATE productid = 394, edited = 1, sysdate = '2026-09-17 17:18:57', userid = 1; -- id=465
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2026-09-17', '1', '0', '0', '2026-09-17 17:18:57','إضافة منتج وصله زاويه  الكمية 100','1','0','0','0','394','productController.php?do=edit&id=394'); -- id=531
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('531', '382', '600', '','0'); -- id=531
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2208128.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('531', '121', '600', '','0'); -- id=531
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1117242.87', 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 = '7', productBuyPrice = '6.00', productSellAllPrice = '8.00', productSellUnitPrice = '8.00', productSellHalfPrice = '8.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00394',type ='0', expireDate = '0' , dailyentryId = '531',isService = '0',isOptic = '0',lastbuyprice = '6',lastbuyprice_withDiscount = '6',meanbuyprice = '6',meanbuyprice_withDiscount = '6' , productbuypricereal = '6' , buypricereal_precentage = '0' , buytotal_precentage = '33.33' , buyhalf_precentage = '33.33' , buypart_precentage = '33.33',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 = '394';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:48:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:18:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:18:59', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1427
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:53:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:23:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 17:23:05', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=1428
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:53:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:23:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 17:23:22', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php?do=add'); -- id=1429
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('ابراهيم صلاح ' , '', '', '', '490', '', '0', '2026-09-17 17:23:22', '1', '0','13','0','','-10','13','10000',',','-1','0','','0','0','.','2026-09-17','0','13','','0','0','0','','','0','0','','','','','','','','','','-1','','.','.','0','','','0','0',''); -- id=13
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('13', '0', '0', '', ''); -- id=13
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 ('13','0','490','0','إضافة عميل جديد','13', '490', '2026-09-17 17:23:22', '1', 'clientController.php', '', '490', '0', null, '0', null, null,'', '0','1','1','490','1','','0','0','',''); -- id=63
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ابراهيم صلاح ', 'ابراهيم صلاح ', 'ابراهيم صلاح ', 'ابراهيم صلاح ', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-17 17:23:23'); -- id=441
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '490', '490', '2026-09-17', '1', '0', '0', '2026-09-17 17:23:23','تم اضافة عميل ابراهيم صلاح ','1','0','0','0','13','clientController.php?do=edit&id=13'); -- id=532
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('532', '441', '490', '','0'); -- id=532
UPDATE accountstree SET name = 'ابراهيم صلاح ', customName = 'ابراهيم صلاح ', customNameEn = 'ابراهيم صلاح ', nameEn = 'ابراهيم صلاح ', parent = '58', accountNature = '0', theValue = '490', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 17:23:23' WHERE id = '441';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('532', '121', '490', '','0'); -- id=532
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1117732.87', 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';
COMMIT;
UPDATE client SET clientname = 'ابراهيم صلاح ', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '490.00', clientdetails = '', conditions = '0', clientdate = '2026-09-17', userid = '1'  , clientareaid = '0'  ,clientcode = '13',dailyentryid = '532' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '13' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='13' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='441',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='.',fileimg='.',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '13';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:53:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:23:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-17 17:23:26', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=1430
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:53:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:23:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:23:28', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1431
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:54:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:24:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:24:35', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1432
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 ('لفه سوسته 11 ملي احمر ','','12','26','28','28','28','2026-09-17','0','1','0','','0','0','0','0','0','26','26','26','26','26','0','7.69','7.69','7.69','.','0','0','0','26','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','26','26','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','26','0','0','0','0','0','0','','','0','0','0','0'); -- id=395
UPDATE product SET productName = 'لفه سوسته 11 ملي احمر ', productDescription = '', productCatId = '12', productBuyPrice = '26', productSellAllPrice = '28', productSellUnitPrice = '28', productSellHalfPrice = '28', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00395',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '26',lastbuyprice_withDiscount = '26',meanbuyprice = '26',meanbuyprice_withDiscount = '26' , productbuypricereal = '26' , buypricereal_precentage = '0' , buytotal_precentage = '7.69' , buyhalf_precentage = '7.69' , buypart_precentage = '7.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',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',meanbuyprice_withTax='26',price4='0',price5='0',price6='0',price7='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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '395';
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', '395', '1.00', '2026-09-17', '1', '0','0039501','28','28','28','26','','0','0','0','0','0','0','0','0','0','0'); -- id=395
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('395', '1', '45', '1', '2026-09-17'); -- id=395
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('395', '1', '45', '0', '395', 'إضافة منتج', 'productController.php', '0', '45', '1', '2026-09-17','0','0'); -- id=755
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (395, 1,'2026-09-17 17:24:37',1)
                ON DUPLICATE KEY UPDATE productid = 395, edited = 1, sysdate = '2026-09-17 17:24:37', userid = 1; -- id=466
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1170', '1170', '2026-09-17', '1', '0', '0', '2026-09-17 17:24:37','إضافة منتج لفه سوسته 11 ملي احمر  الكمية 45','1','0','0','0','395','productController.php?do=edit&id=395'); -- id=533
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('533', '382', '1170', '','0'); -- id=533
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2209298.25', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('533', '121', '1170', '','0'); -- id=533
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1118902.87', 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 = 'لفه سوسته 11 ملي احمر ', productDescription = '', productCatId = '12', productBuyPrice = '26.00', productSellAllPrice = '28.00', productSellUnitPrice = '28.00', productSellHalfPrice = '28.00', productDate = '2026-09-17', conditions = '0', userId = '1', limitamount = '0', parcode = '00395',type ='0', expireDate = '0' , dailyentryId = '533',isService = '0',isOptic = '0',lastbuyprice = '26',lastbuyprice_withDiscount = '26',meanbuyprice = '26',meanbuyprice_withDiscount = '26' , productbuypricereal = '26' , buypricereal_precentage = '0' , buytotal_precentage = '7.69' , buyhalf_precentage = '7.69' , buypart_precentage = '7.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',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',meanbuyprice_withTax='26',price4='0',price5='0',price6='0',price7='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',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '395';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:54:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:24:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:24:39', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1433
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:54:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:24:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:24:43', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1434
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:57:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:27:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:27:44', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1435

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aac063beed8d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(13,@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-09-17 17:27:44', '06aac063beed8d', '13', '490.00', '4398.2', '0', '1', '3908.20', '3908.2', '0', '3908.2', '1', '2026-09-17 17:27:44', '', '1', '0', 'ابراهيم صلاح ', '1', '1', '3', '0', '13 - ابراهيم صلاح ', '15' ,'0','','','','','-1','0','0','0','0','0','3908','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=39
UPDATE client SET  clientdebt = '4398.2', userid = '1' WHERE clientid = '13';
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 ('13','490.00','3908.2','0','اضافة فاتورة مبيعات','39', '4398.2', '2026-09-17 17:27:45', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3908.2', '0', null, '0', null, null,'', '0','1','1','3908.2','1','2026-09-17 17:27:44','0','0','',''); -- id=64
UPDATE client SET  inUse = 0 where clientid = 13;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00395', '39', '12', '395', '2', '28', '56', '0', '', '1', '2026-09-17 17:27:45', '395', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','28','56','0','','0','0.00','0','0','0','0'); -- id=223
UPDATE sellbilldetail SET  lastbuyprice = 26.00 , meanbuyprice = 26.00, lastbuyprice_withDiscount = 26.00, meanbuyprice_withDiscount = 26.00
        , lastbuyprice_withTax = 26, meanbuyprice_withTax = 26, lastbuyprice_withDiscountAndTax = 26
                where sellbilldetailid = 223;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (395, '2026-09-17', 56, 52, 52
                    , 52, 52, 52, 52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 52, 52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+56, sellCostBuyPrice =sellCostBuyPrice+52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 56, 52, 52
                    , 52, 52, 52, 52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 52, 52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+56, sellCostBuyPrice =sellCostBuyPrice+52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '43', userid = '1', storedetaildate = '2026-09-17 17:27:45' WHERE storedetailid = '395';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('395', '1', '2', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '43', '1', '2026-09-17 17:27:45','0','0'); -- id=756
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1020','00208', '39', '10', '208', '3', '1210', '3630', '0', '', '1', '2026-09-17 17:27:46', '208', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1210','3630','0','','0','0.00','0','0','0','0'); -- id=224
UPDATE sellbilldetail SET  lastbuyprice = 1020.00 , meanbuyprice = 1020.00, lastbuyprice_withDiscount = 1020.00, meanbuyprice_withDiscount = 1020.00
        , lastbuyprice_withTax = 1020, meanbuyprice_withTax = 1020, lastbuyprice_withDiscountAndTax = 1020
                where sellbilldetailid = 224;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (208, '2026-09-17', 3630, 3060, 3060
                    , 3060, 3060, 3060, 3060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3630, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 3630, 3060, 3060
                    , 3060, 3060, 3060, 3060
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3630, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3060, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3060
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3060
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '58', userid = '1', storedetaildate = '2026-09-17 17:27:46' WHERE storedetailid = '208';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('208', '1', '3', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '61', '58', '1', '2026-09-17 17:27:46','0','0'); -- id=757
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('30.8','00082', '39', '12', '82', '2', '34', '68', '0', '', '1', '2026-09-17 17:27:46', '82', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','34','68','0','','0','0.00','0','0','0','0'); -- id=225
UPDATE sellbilldetail SET  lastbuyprice = 30.80 , meanbuyprice = 30.80, lastbuyprice_withDiscount = 30.80, meanbuyprice_withDiscount = 30.80
        , lastbuyprice_withTax = 30.8, meanbuyprice_withTax = 30.8, lastbuyprice_withDiscountAndTax = 30.8
                where sellbilldetailid = 225;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (82, '2026-09-17', 68, 61.6, 61.6
                    , 61.6, 61.6, 61.6, 61.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 61.6, 61.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68, sellCostBuyPrice =sellCostBuyPrice+61.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+61.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+61.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+61.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+61.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+61.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+61.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61.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+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-09-17', 68, 61.6, 61.6
                    , 61.6, 61.6, 61.6, 61.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 61.6, 61.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68, sellCostBuyPrice =sellCostBuyPrice+61.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+61.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+61.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+61.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+61.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+61.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+61.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61.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 = '98', userid = '1', storedetaildate = '2026-09-17 17:27:46' WHERE storedetailid = '82';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('82', '1', '2', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '100', '98', '1', '2026-09-17 17:27:46','0','0'); -- id=758
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '39', '14', '81', '1', '19', '19', '0', '', '1', '2026-09-17 17:27:46', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0'); -- id=226
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 226;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '636', userid = '1', storedetaildate = '2026-09-17 17:27:46' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '1', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '637', '636', '1', '2026-09-17 17:27:46','0','0'); -- id=759
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.82','00388', '39', '20', '388', '4', '5.25', '21', '0', '', '1', '2026-09-17 17:27:47', '388', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','25-4,','1','1','0','0','5.25','21','0','','0','0.00','0','0','0','0'); -- id=227
UPDATE sellbilldetail SET  lastbuyprice = 4.82 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.82, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.82, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.82
                where sellbilldetailid = 227;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (388, '2026-09-17', 21, 19.28, 19.28
                    , 19.28, 19.28, 19.28, 19.28
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 19.28, 19.28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21, sellCostBuyPrice =sellCostBuyPrice+19.28
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19.28, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19.28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19.28, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19.28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19.28
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19.28
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19.28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-09-17', 21, 19.28, 19.28
                    , 19.28, 19.28, 19.28, 19.28
                    , 0, 0, 0, 0
                    , 0, 0, 0, 19.28, 19.28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21, sellCostBuyPrice =sellCostBuyPrice+19.28
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+19.28, sellCostMeanBuyPrice = sellCostMeanBuyPrice+19.28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+19.28, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+19.28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+19.28
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+19.28
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+19.28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1221', userid = '1', storedetaildate = '2026-09-17 17:27:47' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '4', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1225', '1221', '1', '2026-09-17 17:27:47','0','0'); -- id=760
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '39', '4', '279', '2', '14.6', '29.2', '0', '', '1', '2026-09-17 17:27:47', '279', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','14.6','29.2','0','','0','0.00','0','0','0','0'); -- id=228
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 = 228;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (279, '2026-09-17', 29.2, 28, 28
                    , 28, 28, 28, 28
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 28, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29.2, sellCostBuyPrice =sellCostBuyPrice+28
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-09-17', 29.2, 28, 28
                    , 28, 28, 28, 28
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28, 28, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29.2, sellCostBuyPrice =sellCostBuyPrice+28
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '180', userid = '1', storedetaildate = '2026-09-17 17:27:47' WHERE storedetailid = '279';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('279', '1', '2', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '182', '180', '1', '2026-09-17 17:27:47','0','0'); -- id=761
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('77','00211', '39', '6', '211', '1', '85', '85', '0', '', '1', '2026-09-17 17:27:47', '211', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','85','85','0','','0','0.00','0','0','0','0'); -- id=229
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 = 229;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (211, '2026-09-17', 85, 77, 77
                    , 77, 77, 77, 77
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 77, 77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+77
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+77, sellCostMeanBuyPrice = sellCostMeanBuyPrice+77
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+77, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+77
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+77
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+77
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-09-17', 85, 77, 77
                    , 77, 77, 77, 77
                    , 0, 0, 0, 0
                    , 0, 0, 0, 77, 77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+77
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+77, sellCostMeanBuyPrice = sellCostMeanBuyPrice+77
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+77, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+77
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+77
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+77
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-09-17 17:27:47' WHERE storedetailid = '211';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('211', '1', '1', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '1', '2026-09-17 17:27:48','0','0'); -- id=762
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3908.2', '3908.2', '2026-09-17', '1', '0', '0', '2026-09-17 17:27:48','اضافة فاتورة مبيعات رقم 39','1','0',null,'0','39','sellbillController.php?do=showDetail&sellbillid=39'); -- id=534
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('534', '441', '3908.2', '','0'); -- id=534
UPDATE accountstree SET name = 'ابراهيم صلاح ', customName = 'ابراهيم صلاح ', customNameEn = 'ابراهيم صلاح ', nameEn = 'ابراهيم صلاح ', parent = '58', accountNature = '0', theValue = '4398.2', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 17:23:23' WHERE id = '441';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('534', '143', '3908.2', '','0'); -- id=534
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '86642.49', 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 ( '3315.88', '3315.88', '2026-09-17', '1', '0', '0', '2026-09-17 17:27:48','اضافة فاتورة مبيعات رقم 39 - صرف البضاعة من المخزن','1','0',null,'0','39','sellbillController.php?do=showDetail&sellbillid=39'); -- id=535
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('535', '402', '3315.88', '','0'); -- id=535
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '82343.2', 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 ('535', '382', '3315.88', '','0'); -- id=535
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2205982.37', theOrder = '0', layingOrder = '120202', reportid = '1', 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='534,0,535' where sellbillid=39;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 3908.2, 3315.88, 3315.88
                    , 3315.88, 3315.88, 3315.88, 3315.88
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3315.88, 3315.88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3908.2, sellCostBuyPrice =sellCostBuyPrice+3315.88
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3315.88, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3315.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3315.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3315.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3315.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3315.88
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3315.88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (13, '2026-09-17', 3908.2, 3315.88, 3315.88
                    , 3315.88, 3315.88, 3315.88, 3315.88
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3315.88, 3315.88, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3908.2, sellCostBuyPrice =sellCostBuyPrice+3315.88
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3315.88, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3315.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3315.88, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3315.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3315.88
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3315.88
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3315.88
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 3908.2, 3315.88, 3315.88
                    , 3315.88, 3315.88, 3315.88, 3315.88, 3315.88, 3315.88)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3908.2, netSellCostBuyPrice = netSellCostBuyPrice+3315.88
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3315.88
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3315.88
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3315.88
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3315.88
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3315.88
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3315.88
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3315.88;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:57:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:27:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:27:49', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1436
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 13:58:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:28:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 17:28:01', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1437
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 14:09:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:39:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:39:44', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1438
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 14:09:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 17:39:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 17:39:51', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1439
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 14:38:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 18:08:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 18:08:13', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1440
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 14:39:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 18:09:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 18:09:40', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1441

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aac106ded79c
-- ----------------------------------------------------------------------------------------------------

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-09-17 18:09:41', '06aac106ded79c', '1', '0.00', '0', '0', '1', '2605.75', '2605.75', '2605.75', '0', '1', '2026-09-17 18:09:41', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '61' ,'0','','','','','-1','0','0','0','0','0','2605','0','','0','0','2605.75','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=40
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','اضافة فاتورة مبيعات','40', '0', '2026-09-17 18:09:42', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2605.75', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-17 18:09:41','0','0','',''); -- id=65
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '40', '12', '70', '7', '340', '2380', '0', '', '1', '2026-09-17 18:09:42', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','340','2380','0','','0','0.00','0','0','0','0'); -- id=230
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 230;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 2380, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2380, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 2380, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2380, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '59', userid = '1', storedetaildate = '2026-09-17 18:09:42' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '7', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '59', '1', '2026-09-17 18:09:42','0','0'); -- id=763
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('2.75','00074', '40', '12', '74', '25', '2.95', '73.75', '0', '', '1', '2026-09-17 18:09:42', '74', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2.95','73.75','0','','0','0.00','0','0','0','0'); -- id=231
UPDATE sellbilldetail SET  lastbuyprice = 2.75 , meanbuyprice = 2.75, lastbuyprice_withDiscount = 2.75, meanbuyprice_withDiscount = 2.75
        , lastbuyprice_withTax = 2.75, meanbuyprice_withTax = 2.75, lastbuyprice_withDiscountAndTax = 2.75
                where sellbilldetailid = 231;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (74, '2026-09-17', 73.75, 68.75, 68.75
                    , 68.75, 68.75, 68.75, 68.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 68.75, 68.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+73.75, sellCostBuyPrice =sellCostBuyPrice+68.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+68.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+68.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+68.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+68.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+68.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+68.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+68.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+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-09-17', 73.75, 68.75, 68.75
                    , 68.75, 68.75, 68.75, 68.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 68.75, 68.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+73.75, sellCostBuyPrice =sellCostBuyPrice+68.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+68.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+68.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+68.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+68.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+68.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+68.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+68.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 = '445', userid = '1', storedetaildate = '2026-09-17 18:09:42' WHERE storedetailid = '74';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('74', '1', '25', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '470', '445', '1', '2026-09-17 18:09:42','0','0'); -- id=764
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.25','00076', '40', '12', '76', '28', '4.75', '133', '0', '', '1', '2026-09-17 18:09:42', '76', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4.75','133','0','','0','0.00','0','0','0','0'); -- id=232
UPDATE sellbilldetail SET  lastbuyprice = 4.25 , meanbuyprice = 4.25, lastbuyprice_withDiscount = 4.25, meanbuyprice_withDiscount = 4.25
        , lastbuyprice_withTax = 4.25, meanbuyprice_withTax = 4.25, lastbuyprice_withDiscountAndTax = 4.25
                where sellbilldetailid = 232;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (76, '2026-09-17', 133, 119, 119
                    , 119, 119, 119, 119
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28, 0, 119, 119, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+133, sellCostBuyPrice =sellCostBuyPrice+119
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+119
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 133, 119, 119
                    , 119, 119, 119, 119
                    , 0, 0, 0, 0
                    , 0, 0, 0, 119, 119, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+133, sellCostBuyPrice =sellCostBuyPrice+119
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+119, sellCostMeanBuyPrice = sellCostMeanBuyPrice+119
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+119, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+119
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+119
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+119
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+119
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '82', userid = '1', storedetaildate = '2026-09-17 18:09:43' WHERE storedetailid = '76';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('76', '1', '28', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '110', '82', '1', '2026-09-17 18:09:43','0','0'); -- id=765
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '40', '14', '81', '1', '19', '19', '0', '', '1', '2026-09-17 18:09:43', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0'); -- id=233
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 233;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '635', userid = '1', storedetaildate = '2026-09-17 18:09:43' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '1', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '636', '635', '1', '2026-09-17 18:09:43','0','0'); -- id=766
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-287837.71875',  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 ('-290443.46875','2605.75', '0', '1', 'اضافة فاتورة مبيعات', '40', '-287837.71875', '2026-09-17 18:09:43', '1',  'sellbillController.php','1','','0'); -- id=43
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2605.75', '2605.75', '2026-09-17', '1', '0', '0', '2026-09-17 18:09:43','اضافة فاتورة مبيعات رقم 40','1','0',null,'0','40','sellbillController.php?do=showDetail&sellbillid=40'); -- id=536
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('536', '383', '2605.75', '','0'); -- id=536
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-241145.73', 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 ('536', '143', '2605.75', '','0'); -- id=536
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '89248.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 ( '2389.75', '2389.75', '2026-09-17', '1', '0', '0', '2026-09-17 18:09:43','اضافة فاتورة مبيعات رقم 40 - صرف البضاعة من المخزن','1','0',null,'0','40','sellbillController.php?do=showDetail&sellbillid=40'); -- id=537
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('537', '402', '2389.75', '','0'); -- id=537
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '84732.95', 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 ('537', '382', '2389.75', '','0'); -- id=537
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2203592.62', theOrder = '0', layingOrder = '120202', reportid = '1', 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='536,0,537' where sellbillid=40;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 2605.75, 2389.75, 2389.75
                    , 2389.75, 2389.75, 2389.75, 2389.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2389.75, 2389.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2605.75, sellCostBuyPrice =sellCostBuyPrice+2389.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2389.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2389.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2389.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2389.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2389.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2389.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2389.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;
 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-09-17', 2605.75, 2389.75, 2389.75
                    , 2389.75, 2389.75, 2389.75, 2389.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2389.75, 2389.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2605.75, sellCostBuyPrice =sellCostBuyPrice+2389.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2389.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2389.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2389.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2389.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2389.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2389.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2389.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2605.75, 2389.75, 2389.75
                    , 2389.75, 2389.75, 2389.75, 2389.75, 2389.75, 2389.75)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2605.75, netSellCostBuyPrice = netSellCostBuyPrice+2389.75
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2389.75
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2389.75
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2389.75
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2389.75
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2389.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2389.75
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2389.75;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 14:39:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 18:09:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 18:09:45', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1442
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('حماده الشاذلي ' , '', '', '', '0', '', '0', '2026-09-17 21:11:50', '1', '0','','0','','-10','0','10000',',','-1','0','.','0','0','.','2026-09-17','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=14
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('14', '0', '0', '', ''); -- id=14
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 ('14','0','0','0','إضافة عميل جديد','14', '0', '2026-09-17 21:11:50', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=66
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('حماده الشاذلي ', 'حماده الشاذلي ', 'حماده الشاذلي ', 'حماده الشاذلي ', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-17 21:11:51'); -- id=442
UPDATE client SET clientname = 'حماده الشاذلي ', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-17', userid = '1'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='442',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '14';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:42:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:12:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 21:12:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1443
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:42:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:12:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 21:12:15', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1444
UPDATE productunit SET proUnitSellUnitPrice = 352 * productnumber WHERE productid = 70;
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو احمر', productDescription = '', productCatId = '12', productBuyPrice = '312.00', productSellAllPrice = '320.00', productSellUnitPrice = '352', productSellHalfPrice = '320.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '20', parcode = '00070',type ='0', expireDate = '0' , dailyentryId = '82',isService = '0',isOptic = '0',lastbuyprice = '312.00',lastbuyprice_withDiscount = '312',meanbuyprice = '312.00',meanbuyprice_withDiscount = '312' , productbuypricereal = '312.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='312',meanbuyprice_withTax='312',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='312',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '70';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (70, 1,'2026-09-17 21:12:29',1)
                ON DUPLICATE KEY UPDATE productid = 70, edited = 1, sysdate = '2026-09-17 21:12:29', userid = 1; -- id=74
UPDATE productunit SET proUnitSellUnitPrice = 352 * productnumber WHERE productid = 71;
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو اصفر', productDescription = '', productCatId = '12', productBuyPrice = '312.00', productSellAllPrice = '320.00', productSellUnitPrice = '352', productSellHalfPrice = '320.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '5', parcode = '00071',type ='0', expireDate = '0' , dailyentryId = '83',isService = '0',isOptic = '0',lastbuyprice = '312.00',lastbuyprice_withDiscount = '312',meanbuyprice = '312.00',meanbuyprice_withDiscount = '312' , productbuypricereal = '312.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='312',meanbuyprice_withTax='312',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='312',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '71';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (71, 1,'2026-09-17 21:12:32',1)
                ON DUPLICATE KEY UPDATE productid = 71, edited = 1, sysdate = '2026-09-17 21:12:32', userid = 1; -- id=75
UPDATE productunit SET proUnitSellUnitPrice = 352 * productnumber WHERE productid = 72;
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو اخضر', productDescription = '', productCatId = '12', productBuyPrice = '312.00', productSellAllPrice = '320.00', productSellUnitPrice = '352', productSellHalfPrice = '320.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '0', parcode = '00072',type ='0', expireDate = '0' , dailyentryId = '84',isService = '0',isOptic = '0',lastbuyprice = '312.00',lastbuyprice_withDiscount = '312',meanbuyprice = '312.00',meanbuyprice_withDiscount = '312' , productbuypricereal = '312.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '952.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='312',meanbuyprice_withTax='312',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='312',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '72';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (72, 1,'2026-09-17 21:12:34',1)
                ON DUPLICATE KEY UPDATE productid = 72, edited = 1, sysdate = '2026-09-17 21:12:34', userid = 1; -- id=76
UPDATE productunit SET proUnitSellUnitPrice = 440 * productnumber WHERE productid = 73;
UPDATE product SET productName = 'لفه خرطوم 23 ملي مصطفي محمود 5 كيلو', productDescription = '', productCatId = '12', productBuyPrice = '390.00', productSellAllPrice = '460.00', productSellUnitPrice = '440', productSellHalfPrice = '460.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '5', parcode = '00073',type ='0', expireDate = '0' , dailyentryId = '85',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '73';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (73, 1,'2026-09-17 21:12:40',1)
                ON DUPLICATE KEY UPDATE productid = 73, edited = 1, sysdate = '2026-09-17 21:12:40', userid = 1; -- id=77
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:45:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:15:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 21:15:41', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1445

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aac10c9ee7c1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(14,@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-09-17 21:15:41', '06aac10c9ee7c1', '14', '0.00', '4510.25', '0', '1', '4510.25', '4510.25', '0', '4510.25', '1', '2026-09-17 21:15:41', '', '1', '0', 'حماده الشاذلي ', '1', '1', '3', '0', 'حماده الشاذلي ', '67.25' ,'0','','','','','-1','0','0','0','0','0','4510','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=41
UPDATE client SET  clientdebt = '4510.25', userid = '1' WHERE clientid = '14';
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 ('14','0.00','4510.25','0','اضافة فاتورة مبيعات','41', '4510.25', '2026-09-17 21:15:42', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4510.25', '0', null, '0', null, null,'', '0','1','1','4510.25','1','2026-09-17 21:15:41','0','0','',''); -- id=67
UPDATE client SET  inUse = 0 where clientid = 14;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '41', '12', '70', '6', '352', '2112', '0', '', '1', '2026-09-17 21:15:42', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','352','2112','0','','0','0.00','0','0','0','0'); -- id=234
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 234;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-17', 2112, 1872, 1872
                    , 1872, 1872, 1872, 1872
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1872, 1872, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2112, sellCostBuyPrice =sellCostBuyPrice+1872
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1872, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1872
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1872, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1872
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1872
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1872
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1872
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 2112, 1872, 1872
                    , 1872, 1872, 1872, 1872
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1872, 1872, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2112, sellCostBuyPrice =sellCostBuyPrice+1872
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1872, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1872
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1872, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1872
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1872
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1872
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1872
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '53', userid = '1', storedetaildate = '2026-09-17 21:15:42' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '6', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '53', '1', '2026-09-17 21:15:42','0','0'); -- id=767
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','00073', '41', '12', '73', '5', '440', '2200', '0', '', '1', '2026-09-17 21:15:42', '73', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','440','2200','0','','0','0.00','0','0','0','0'); -- id=235
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 235;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-17', 2200, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 2200, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, 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 = '7', userid = '1', storedetaildate = '2026-09-17 21:15:43' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '5', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '7', '1', '2026-09-17 21:15:43','0','0'); -- id=768
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.75','00074', '41', '12', '74', '15', '2.95', '44.25', '0', '', '1', '2026-09-17 21:15:43', '74', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2.95','44.25','0','','0','0.00','0','0','0','0'); -- id=236
UPDATE sellbilldetail SET  lastbuyprice = 2.75 , meanbuyprice = 2.75, lastbuyprice_withDiscount = 2.75, meanbuyprice_withDiscount = 2.75
        , lastbuyprice_withTax = 2.75, meanbuyprice_withTax = 2.75, lastbuyprice_withDiscountAndTax = 2.75
                where sellbilldetailid = 236;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (74, '2026-09-17', 44.25, 41.25, 41.25
                    , 41.25, 41.25, 41.25, 41.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 41.25, 41.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+44.25, sellCostBuyPrice =sellCostBuyPrice+41.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41.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+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-09-17', 44.25, 41.25, 41.25
                    , 41.25, 41.25, 41.25, 41.25
                    , 0, 0, 0, 0
                    , 0, 0, 0, 41.25, 41.25, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+44.25, sellCostBuyPrice =sellCostBuyPrice+41.25
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+41.25, sellCostMeanBuyPrice = sellCostMeanBuyPrice+41.25
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+41.25, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+41.25
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+41.25
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+41.25
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+41.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 = '430', userid = '1', storedetaildate = '2026-09-17 21:15:43' WHERE storedetailid = '74';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('74', '1', '15', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '445', '430', '1', '2026-09-17 21:15:43','0','0'); -- id=769
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1.75','00075', '41', '12', '75', '25', '1.95', '48.75', '0', '', '1', '2026-09-17 21:15:43', '75', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1.95','48.75','0','','0','0.00','0','0','0','0'); -- id=237
UPDATE sellbilldetail SET  lastbuyprice = 1.75 , meanbuyprice = 1.75, lastbuyprice_withDiscount = 1.75, meanbuyprice_withDiscount = 1.75
        , lastbuyprice_withTax = 1.75, meanbuyprice_withTax = 1.75, lastbuyprice_withDiscountAndTax = 1.75
                where sellbilldetailid = 237;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (75, '2026-09-17', 48.75, 43.75, 43.75
                    , 43.75, 43.75, 43.75, 43.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 43.75, 43.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+48.75, sellCostBuyPrice =sellCostBuyPrice+43.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+43.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+43.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+43.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+43.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+43.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+43.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+43.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+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-09-17', 48.75, 43.75, 43.75
                    , 43.75, 43.75, 43.75, 43.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 43.75, 43.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+48.75, sellCostBuyPrice =sellCostBuyPrice+43.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+43.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+43.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+43.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+43.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+43.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+43.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+43.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 = '625', userid = '1', storedetaildate = '2026-09-17 21:15:43' WHERE storedetailid = '75';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('75', '1', '25', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '650', '625', '1', '2026-09-17 21:15:43','0','0'); -- id=770
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.25','00076', '41', '12', '76', '15', '4.75', '71.25', '0', '', '1', '2026-09-17 21:15:43', '76', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','4.75','71.25','0','','0','0.00','0','0','0','0'); -- id=238
UPDATE sellbilldetail SET  lastbuyprice = 4.25 , meanbuyprice = 4.25, lastbuyprice_withDiscount = 4.25, meanbuyprice_withDiscount = 4.25
        , lastbuyprice_withTax = 4.25, meanbuyprice_withTax = 4.25, lastbuyprice_withDiscountAndTax = 4.25
                where sellbilldetailid = 238;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (76, '2026-09-17', 71.25, 63.75, 63.75
                    , 63.75, 63.75, 63.75, 63.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 63.75, 63.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+71.25, sellCostBuyPrice =sellCostBuyPrice+63.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63.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+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-09-17', 71.25, 63.75, 63.75
                    , 63.75, 63.75, 63.75, 63.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63.75, 63.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+71.25, sellCostBuyPrice =sellCostBuyPrice+63.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63.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 = '67', userid = '1', storedetaildate = '2026-09-17 21:15:44' WHERE storedetailid = '76';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('76', '1', '15', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '82', '67', '1', '2026-09-17 21:15:44','0','0'); -- id=771
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '41', '14', '81', '1', '19', '19', '0', '', '1', '2026-09-17 21:15:44', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','19','0','','0','0.00','0','0','0','0'); -- id=239
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 239;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 19, 18, 18
                    , 18, 18, 18, 18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19, sellCostBuyPrice =sellCostBuyPrice+18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '634', userid = '1', storedetaildate = '2026-09-17 21:15:44' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '1', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '635', '634', '1', '2026-09-17 21:15:44','0','0'); -- id=772
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('55','00077', '41', '12', '77', '.25', '60', '15', '0', '', '1', '2026-09-17 21:15:44', '77', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','15','0','','0','0.00','0','0','0','0'); -- id=240
UPDATE sellbilldetail SET  lastbuyprice = 55.00 , meanbuyprice = 55.00, lastbuyprice_withDiscount = 55.00, meanbuyprice_withDiscount = 55.00
        , lastbuyprice_withTax = 55, meanbuyprice_withTax = 55, lastbuyprice_withDiscountAndTax = 55
                where sellbilldetailid = 240;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (77, '2026-09-17', 15, 13.75, 13.75
                    , 13.75, 13.75, 13.75, 13.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 13.75, 13.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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+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-09-17', 15, 13.75, 13.75
                    , 13.75, 13.75, 13.75, 13.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 13.75, 13.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+13.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13.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 = '5.5', userid = '1', storedetaildate = '2026-09-17 21:15:44' WHERE storedetailid = '77';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('77', '1', '0.25', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5.75', '5.5', '1', '2026-09-17 21:15:44','0','0'); -- id=773
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4510.25', '4510.25', '2026-09-17', '1', '0', '0', '2026-09-17 21:15:44','اضافة فاتورة مبيعات رقم 41','1','0',null,'0','41','sellbillController.php?do=showDetail&sellbillid=41'); -- id=538
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('538', '442', '4510.25', '','0'); -- id=538
UPDATE accountstree SET name = 'حماده الشاذلي ', customName = 'حماده الشاذلي ', customNameEn = 'حماده الشاذلي ', nameEn = 'حماده الشاذلي ', parent = '58', accountNature = '0', theValue = '4510.25', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-17 21:11:51' WHERE id = '442';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('538', '143', '4510.25', '','0'); -- id=538
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '93758.49', 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 ( '4002.5', '4002.5', '2026-09-17', '1', '0', '0', '2026-09-17 21:15:44','اضافة فاتورة مبيعات رقم 41 - صرف البضاعة من المخزن','1','0',null,'0','41','sellbillController.php?do=showDetail&sellbillid=41'); -- id=539
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('539', '402', '4002.5', '','0'); -- id=539
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '88735.45', 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 ('539', '382', '4002.5', '','0'); -- id=539
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2199590.12', theOrder = '0', layingOrder = '120202', reportid = '1', 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='538,0,539' where sellbillid=41;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 4510.25, 4002.5, 4002.5
                    , 4002.5, 4002.5, 4002.5, 4002.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4002.5, 4002.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4510.25, sellCostBuyPrice =sellCostBuyPrice+4002.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4002.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4002.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4002.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4002.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4002.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4002.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4002.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14, '2026-09-17', 4510.25, 4002.5, 4002.5
                    , 4002.5, 4002.5, 4002.5, 4002.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4002.5, 4002.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4510.25, sellCostBuyPrice =sellCostBuyPrice+4002.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4002.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4002.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4002.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4002.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4002.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4002.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4002.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4510.25, 4002.5, 4002.5
                    , 4002.5, 4002.5, 4002.5, 4002.5, 4002.5, 4002.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4510.25, netSellCostBuyPrice = netSellCostBuyPrice+4002.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4002.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4002.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4002.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4002.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4002.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4002.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4002.5;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:45:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:15:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 21:15:46', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1446
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:46:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:16:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-17 21:16:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php'); -- id=1447
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:46:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:16:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-17 21:16:14', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php?do=show'); -- id=1448
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:46:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:16:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 21:16:21', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=34'); -- id=1449
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:54:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:24:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-17 21:24:56', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=1450
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:55:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:25:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-17 21:25:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php?do=show'); -- id=1451
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:57:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:27:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 21:27:04', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=1452
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:57:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:27:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-17 21:27:09', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php?do=show'); -- id=1453
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:57:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:27:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 21:27:16', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=36'); -- id=1454
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 17:57:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 21:27:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 21:27:28', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1455
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:58:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:28:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 22:28:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:58:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:28:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-17 22:28:13', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1457
UPDATE product SET productName = 'لفه بروفايل علي التيار ورم10 متر ع التيار ', productDescription = '', productCatId = '22', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '305.00', productSellHalfPrice = '295.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00282',type ='0', expireDate = '0' , dailyentryId = '333',isService = '0',isOptic = '0',lastbuyprice = '275.00',lastbuyprice_withDiscount = '275',meanbuyprice = '275.00',meanbuyprice_withDiscount = '275' , productbuypricereal = '275.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.27' , buyhalf_precentage = '7.27' , buypart_precentage = '10.91',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='275',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='275',meanbuyprice_withTax='275',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='275',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '282';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (282, 1,'2026-09-17 22:28:46',1)
                ON DUPLICATE KEY UPDATE productid = 282, edited = 1, sysdate = '2026-09-17 22:28:46', userid = 1; -- id=299
UPDATE product SET productName = 'لفه بروفايل علي التيار ورم 10 متر ع التيار ', productDescription = '', productCatId = '22', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '305.00', productSellHalfPrice = '295.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00282',type ='0', expireDate = '0' , dailyentryId = '333',isService = '0',isOptic = '0',lastbuyprice = '275.00',lastbuyprice_withDiscount = '275',meanbuyprice = '275.00',meanbuyprice_withDiscount = '275' , productbuypricereal = '275.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.27' , buyhalf_precentage = '7.27' , buypart_precentage = '10.91',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='275',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='275',meanbuyprice_withTax='275',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='275',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '282';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (282, 1,'2026-09-17 22:28:51',1)
                ON DUPLICATE KEY UPDATE productid = 282, edited = 1, sysdate = '2026-09-17 22:28:51', userid = 1; -- id=299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:59:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:29:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 22:29:16', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1458
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 29;
UPDATE sellbill SET  sellbillsysdate = '2026-09-17 22:29:17', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '29';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 9;
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 = 158;
 INSERT INTO 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-09-17', 96, 94, 94
                    , 94, 94, 94, 94
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 94, 94, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-96, sellCostBuyPrice =sellCostBuyPrice-94
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-94, sellCostMeanBuyPrice = sellCostMeanBuyPrice-94
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-94, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-94
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-94
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-94
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-94
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 96, 94, 94
                    , 94, 94, 94, 94
                    , 0, 0, 0, 0
                    , 0, 0, 0, 94, 94, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-96, sellCostBuyPrice =sellCostBuyPrice-94
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-94, sellCostMeanBuyPrice = sellCostMeanBuyPrice-94
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-94, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-94
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-94
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-94
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-94
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 22:29:17' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '8', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1942', '1950', '1', '2026-09-16 22:19:56','0','0'); -- id=774
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 = 159;
 INSERT INTO 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-09-17', 159.75, 158.4, 158.4
                    , 158.4, 158.4, 158.4, 158.4
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 158.4, 158.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-159.75, sellCostBuyPrice =sellCostBuyPrice-158.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-158.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice-158.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-158.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-158.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-158.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-158.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-158.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-9
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 159.75, 158.4, 158.4
                    , 158.4, 158.4, 158.4, 158.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 158.4, 158.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-159.75, sellCostBuyPrice =sellCostBuyPrice-158.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-158.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice-158.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-158.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-158.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-158.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-158.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-158.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 = '636', userid = '1', storedetaildate = '2026-09-17 22:29:17' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '9', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '627', '636', '1', '2026-09-16 22:19:56','0','0'); -- id=775
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 = 160;
 INSERT INTO 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-09-17', 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-09-17', 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 = '728', userid = '1', storedetaildate = '2026-09-17 22:29:17' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '6', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '722', '728', '1', '2026-09-16 22:19:56','0','0'); -- id=776
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 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 = 161;
 INSERT INTO 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-09-17', 49.5, 40.5, 40.5
                    , 40.5, 40.5, 40.5, 40.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 40.5, 40.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-49.5, sellCostBuyPrice =sellCostBuyPrice-40.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-40.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-40.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-40.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-40.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-40.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-40.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-40.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-9
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 49.5, 40.5, 40.5
                    , 40.5, 40.5, 40.5, 40.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40.5, 40.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-49.5, sellCostBuyPrice =sellCostBuyPrice-40.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-40.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-40.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-40.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-40.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-40.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-40.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-40.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 = '2680', userid = '1', storedetaildate = '2026-09-17 22:29:17' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '9', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2671', '2680', '1', '2026-09-16 22:19:56','0','0'); -- id=777
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 162;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 38, 36, 36
                    , 36, 36, 36, 36
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 36, 36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-38, sellCostBuyPrice =sellCostBuyPrice-36
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-36, sellCostMeanBuyPrice = sellCostMeanBuyPrice-36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-36, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-36
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-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-09-17', 38, 36, 36
                    , 36, 36, 36, 36
                    , 0, 0, 0, 0
                    , 0, 0, 0, 36, 36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-38, sellCostBuyPrice =sellCostBuyPrice-36
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-36, sellCostMeanBuyPrice = sellCostMeanBuyPrice-36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-36, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-36
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-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 = '636', userid = '1', storedetaildate = '2026-09-17 22:29:17' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '2', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '634', '636', '1', '2026-09-16 22:19:56','0','0'); -- id=778
UPDATE sellbilldetail SET  lastbuyprice = 173.25 , meanbuyprice = 173.25, lastbuyprice_withDiscount = 173.25, meanbuyprice_withDiscount = 173.25
        , lastbuyprice_withTax = 173.25, meanbuyprice_withTax = 173.25, lastbuyprice_withDiscountAndTax = 173.25
                where sellbilldetailid = 163;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (146, '2026-09-17', 350, 346.5, 346.5
                    , 346.5, 346.5, 346.5, 346.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,2,0, 346.5, 346.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-346.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-346.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-346.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-346.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-346.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-346.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-346.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-346.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-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-09-17', 350, 346.5, 346.5
                    , 346.5, 346.5, 346.5, 346.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 346.5, 346.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-346.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-346.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-346.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-346.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-346.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-346.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-346.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-346.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-09-17 22:29:17' WHERE storedetailid = '146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('146', '1', '2', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '10', '1', '2026-09-16 22:19:56','0','0'); -- id=779
UPDATE sellbilldetail SET  lastbuyprice = 263.00 , meanbuyprice = 263.00, lastbuyprice_withDiscount = 263.00, meanbuyprice_withDiscount = 263.00
        , lastbuyprice_withTax = 263, meanbuyprice_withTax = 263, lastbuyprice_withDiscountAndTax = 263
                where sellbilldetailid = 164;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (290, '2026-09-17', 266, 263, 263
                    , 263, 263, 263, 263
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 263, 263, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-266, sellCostBuyPrice =sellCostBuyPrice-263
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-263, sellCostMeanBuyPrice = sellCostMeanBuyPrice-263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-263, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-263
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-263
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-263
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-09-17', 266, 263, 263
                    , 263, 263, 263, 263
                    , 0, 0, 0, 0
                    , 0, 0, 0, 263, 263, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-266, sellCostBuyPrice =sellCostBuyPrice-263
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-263, sellCostMeanBuyPrice = sellCostMeanBuyPrice-263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-263, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-263
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-263
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-263
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 22:29:17' WHERE storedetailid = '290';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('290', '1', '1', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '9', '10', '1', '2026-09-16 22:19:56','0','0'); -- id=780
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 165;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (289, '2026-09-17', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-350, sellCostBuyPrice =sellCostBuyPrice-300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-300, sellCostMeanBuyPrice = sellCostMeanBuyPrice-300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-300
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '289';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('289', '1', '1', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '11', '12', '1', '2026-09-16 22:19:56','0','0'); -- id=781
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 = 166;
 INSERT INTO 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-09-17', 200, 164, 164
                    , 164, 164, 164, 164
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 164, 164, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-164
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-164, sellCostMeanBuyPrice = sellCostMeanBuyPrice-164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-164, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-164
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-164
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-164
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 200, 164, 164
                    , 164, 164, 164, 164
                    , 0, 0, 0, 0
                    , 0, 0, 0, 164, 164, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200, sellCostBuyPrice =sellCostBuyPrice-164
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-164, sellCostMeanBuyPrice = sellCostMeanBuyPrice-164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-164, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-164
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-164
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-164
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-09-17 22:29:18' WHERE storedetailid = '188';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('188', '1', '8', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '29', '37', '1', '2026-09-16 22:19:56','0','0'); -- id=782
UPDATE sellbilldetail SET  lastbuyprice = 76.50 , meanbuyprice = 76.50, lastbuyprice_withDiscount = 76.50, meanbuyprice_withDiscount = 76.50
        , lastbuyprice_withTax = 76.5, meanbuyprice_withTax = 76.5, lastbuyprice_withDiscountAndTax = 76.5
                where sellbilldetailid = 167;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (320, '2026-09-17', 85, 76.5, 76.5
                    , 76.5, 76.5, 76.5, 76.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 76.5, 76.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-85, sellCostBuyPrice =sellCostBuyPrice-76.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-76.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-76.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-76.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-76.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-76.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-76.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-76.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-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-09-17', 85, 76.5, 76.5
                    , 76.5, 76.5, 76.5, 76.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 76.5, 76.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-85, sellCostBuyPrice =sellCostBuyPrice-76.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-76.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-76.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-76.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-76.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-76.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-76.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-76.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 = '26', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '320';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('320', '1', '1', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '26', '1', '2026-09-16 22:19:56','0','0'); -- id=783
UPDATE sellbilldetail SET  lastbuyprice = 35.00 , meanbuyprice = 35.00, lastbuyprice_withDiscount = 35.00, meanbuyprice_withDiscount = 35.00
        , lastbuyprice_withTax = 35, meanbuyprice_withTax = 35, lastbuyprice_withDiscountAndTax = 35
                where sellbilldetailid = 168;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (79, '2026-09-17', 39, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-39, sellCostBuyPrice =sellCostBuyPrice-35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-35, sellCostMeanBuyPrice = sellCostMeanBuyPrice-35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-35
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 39, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-39, sellCostBuyPrice =sellCostBuyPrice-35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-35, sellCostMeanBuyPrice = sellCostMeanBuyPrice-35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-35
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '79';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('79', '1', '1', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '19', '20', '1', '2026-09-16 22:19:56','0','0'); -- id=784
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 = 169;
 INSERT INTO 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-09-17', 120, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, sellCostBuyPrice =sellCostBuyPrice-120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-120
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 120, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-120, sellCostBuyPrice =sellCostBuyPrice-120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-120
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '870', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '8', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '862', '870', '1', '2026-09-16 22:19:56','0','0'); -- id=785
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 = 170;
 INSERT INTO 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-09-17', 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-09-17', 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 = '149', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '1', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '148', '149', '1', '2026-09-16 22:19:56','0','0'); -- id=786
UPDATE sellbilldetail SET  lastbuyprice = 39.90 , meanbuyprice = 39.90, lastbuyprice_withDiscount = 39.90, meanbuyprice_withDiscount = 39.90
        , lastbuyprice_withTax = 39.9, meanbuyprice_withTax = 39.9, lastbuyprice_withDiscountAndTax = 39.9
                where sellbilldetailid = 171;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (135, '2026-09-17', 159.6, 159.6, 159.6
                    , 159.6, 159.6, 159.6, 159.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 159.6, 159.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-159.6, sellCostBuyPrice =sellCostBuyPrice-159.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-159.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-159.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-159.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-159.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-159.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-159.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-159.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-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-09-17', 159.6, 159.6, 159.6
                    , 159.6, 159.6, 159.6, 159.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 159.6, 159.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-159.6, sellCostBuyPrice =sellCostBuyPrice-159.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-159.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice-159.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-159.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-159.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-159.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-159.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-159.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 = '58', userid = '1', storedetaildate = '2026-09-17 22:29:18' WHERE storedetailid = '135';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('135', '1', '4', '0', '29', 'تعديل فاتورة مبيعات', 'sellbillController.php', '54', '58', '1', '2026-09-16 22:19:56','0','0'); -- id=787
CALL clientInUse(11,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '11';
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 ('11','0.35','0.35','1','تعديل فاتورة مبيعات','29', '0', '2026-09-16 22:19:56', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '2034.35', '0', null, '0', null, null,'', '0','1','1','0.35','1','2026-09-16 22:19:56','0','0','',''); -- id=68
UPDATE client SET  inUse = 0 where clientid = 11;
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-289871.71875',  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 ('-287837.71875','2034', '1', '1', 'تعديل فاتورة مبيعات', '29', '-289871.71875', '2026-09-17 22:29:18', '1',  'sellbillController.php','11','','0'); -- id=44
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 2034.35, 1910.1, 1910.1
                    , 1910.1, 1910.1, 1910.1, 1910.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1910.1, 1910.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2034.35, sellCostBuyPrice =sellCostBuyPrice-1910.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1910.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1910.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1910.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1910.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1910.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1910.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1910.1
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-09-17', 2034.35, 1910.1, 1910.1
                    , 1910.1, 1910.1, 1910.1, 1910.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1910.1, 1910.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2034.35, sellCostBuyPrice =sellCostBuyPrice-1910.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1910.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1910.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1910.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1910.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1910.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1910.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1910.1
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2034.35, 1910.1, 1910.1
                    , 1910.1, 1910.1, 1910.1, 1910.1, 1910.1, 1910.1)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2034.35, netSellCostBuyPrice = netSellCostBuyPrice-1910.1
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-1910.1
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-1910.1
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-1910.1
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-1910.1
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-1910.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-1910.1
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-1910.1;

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


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

COMMIT;
BEGIN;
CALL clientInUse(11,@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-09-16 22:19:56', '06aaacae144262', '11', '0.00', '0', '0', '1', '2284.35', '2284.35', '2284.35', '0', '1', '2026-09-16 22:19:56', '', '1', '0', 'خالد ابوجبل ', '1', '1', '3', '0', 'خالد ابوجبل ', '62', '29', 'sellbillController', '0','','','','','-1','0','0','2284.35','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-16','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=42
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '11';
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 ('11','0.00','0','0','اضافة فاتورة مبيعات (معدله)','42', '0', '2026-09-17 22:29:19', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '2284.35', '0', null, '0', null, null,'', '0','1','1','0.35','1','2026-09-16 22:19:56','0','0','',''); -- id=69
UPDATE client SET  inUse = 0 where clientid = 11;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 9;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '3', '102', '8.00', '12', '96', '0', '', '1', '2026-09-17 22:29:19', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','9-8,','1','1','0','0','12','96','0','','0','0.00','0','0','0','0'); -- id=241
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 = 241;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-09-17', 96, 94, 94
                    , 94, 94, 94, 94
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 94, 94, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+96, sellCostBuyPrice =sellCostBuyPrice+94
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+94, sellCostMeanBuyPrice = sellCostMeanBuyPrice+94
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+94, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+94
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+94
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+94
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+94
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 96, 94, 94
                    , 94, 94, 94, 94
                    , 0, 0, 0, 0
                    , 0, 0, 0, 94, 94, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+96, sellCostBuyPrice =sellCostBuyPrice+94
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+94, sellCostMeanBuyPrice = sellCostMeanBuyPrice+94
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+94, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+94
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+94
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+94
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+94
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1942', userid = '1', storedetaildate = '2026-09-17 22:29:20' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '8', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1950', '1942', '1', '2026-09-17 22:29:20','0','0'); -- id=788
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 13;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '3', '100', '9.00', '17.75', '159.75', '0', '', '1', '2026-09-17 22:29:20', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','13-9,','1','1','0','0','17.75','159.75','0','','0','0.00','0','0','0','0'); -- id=242
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 = 242;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-09-17', 159.75, 158.4, 158.4
                    , 158.4, 158.4, 158.4, 158.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 158.4, 158.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+159.75, sellCostBuyPrice =sellCostBuyPrice+158.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+158.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+158.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+158.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+158.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+158.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+158.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+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 159.75, 158.4, 158.4
                    , 158.4, 158.4, 158.4, 158.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 158.4, 158.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+159.75, sellCostBuyPrice =sellCostBuyPrice+158.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+158.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+158.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+158.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+158.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+158.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+158.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+158.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 = '627', userid = '1', storedetaildate = '2026-09-17 22:29:20' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '9', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '636', '627', '1', '2026-09-17 22:29:20','0','0'); -- id=789
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 14;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '3', '101', '6.00', '17.75', '106.5', '0', '', '1', '2026-09-17 22:29:20', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','14-6,','1','1','0','0','17.75','106.5','0','','0','0.00','0','0','0','0'); -- id=243
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 = 243;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-09-17', 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-09-17', 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 = '722', userid = '1', storedetaildate = '2026-09-17 22:29:20' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '6', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '728', '722', '1', '2026-09-17 22:29:20','0','0'); -- id=790
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 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', '42', '3', '103', '9.00', '5.5', '49.5', '0', '', '1', '2026-09-17 22:29:20', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-9,','1','1','0','0','5.5','49.5','0','','0','0.00','0','0','0','0'); -- id=244
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 = 244;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-09-17', 49.5, 40.5, 40.5
                    , 40.5, 40.5, 40.5, 40.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 40.5, 40.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+49.5, sellCostBuyPrice =sellCostBuyPrice+40.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+40.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+40.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+40.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+40.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+40.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40.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+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 49.5, 40.5, 40.5
                    , 40.5, 40.5, 40.5, 40.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 40.5, 40.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+49.5, sellCostBuyPrice =sellCostBuyPrice+40.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+40.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+40.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+40.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+40.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+40.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40.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 = '2671', userid = '1', storedetaildate = '2026-09-17 22:29:21' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '9', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2680', '2671', '1', '2026-09-17 22:29:21','0','0'); -- id=791
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('18','00081', '42', '14', '81', '2.00', '19', '38', '0', '', '1', '2026-09-17 22:29:21', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','38','0','','0','0.00','0','0','0','0'); -- id=245
UPDATE sellbilldetail SET  lastbuyprice = 18.00 , meanbuyprice = 18.00, lastbuyprice_withDiscount = 18.00, meanbuyprice_withDiscount = 18.00
        , lastbuyprice_withTax = 18, meanbuyprice_withTax = 18, lastbuyprice_withDiscountAndTax = 18
                where sellbilldetailid = 245;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (81, '2026-09-17', 38, 36, 36
                    , 36, 36, 36, 36
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 36, 36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+38, sellCostBuyPrice =sellCostBuyPrice+36
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+36, sellCostMeanBuyPrice = sellCostMeanBuyPrice+36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+36, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+36
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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-09-17', 38, 36, 36
                    , 36, 36, 36, 36
                    , 0, 0, 0, 0
                    , 0, 0, 0, 36, 36, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+38, sellCostBuyPrice =sellCostBuyPrice+36
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+36, sellCostMeanBuyPrice = sellCostMeanBuyPrice+36
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+36, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+36
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+36
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+36
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+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 = '634', userid = '1', storedetaildate = '2026-09-17 22:29:21' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '2', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '636', '634', '1', '2026-09-17 22:29:21','0','0'); -- id=792
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('173.25','00146', '42', '21', '146', '2.00', '175', '350', '0', '', '1', '2026-09-17 22:29:21', '146', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','175','350','0','','0','0.00','0','0','0','0'); -- id=246
UPDATE sellbilldetail SET  lastbuyprice = 173.25 , meanbuyprice = 173.25, lastbuyprice_withDiscount = 173.25, meanbuyprice_withDiscount = 173.25
        , lastbuyprice_withTax = 173.25, meanbuyprice_withTax = 173.25, lastbuyprice_withDiscountAndTax = 173.25
                where sellbilldetailid = 246;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (146, '2026-09-17', 350, 346.5, 346.5
                    , 346.5, 346.5, 346.5, 346.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 346.5, 346.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+346.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+346.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+346.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+346.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+346.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+346.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+346.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+346.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+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-09-17', 350, 346.5, 346.5
                    , 346.5, 346.5, 346.5, 346.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 346.5, 346.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+346.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+346.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+346.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+346.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+346.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+346.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+346.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+346.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 = '8', userid = '1', storedetaildate = '2026-09-17 22:29:21' WHERE storedetailid = '146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('146', '1', '2', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '8', '1', '2026-09-17 22:29:21','0','0'); -- id=793
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('263','00290', '42', '24', '290', '1.00', '266', '266', '0', '', '1', '2026-09-17 22:29:21', '290', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','266','266','0','','0','0.00','0','0','0','0'); -- id=247
UPDATE sellbilldetail SET  lastbuyprice = 263.00 , meanbuyprice = 263.00, lastbuyprice_withDiscount = 263.00, meanbuyprice_withDiscount = 263.00
        , lastbuyprice_withTax = 263, meanbuyprice_withTax = 263, lastbuyprice_withDiscountAndTax = 263
                where sellbilldetailid = 247;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (290, '2026-09-17', 266, 263, 263
                    , 263, 263, 263, 263
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 263, 263, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+266, sellCostBuyPrice =sellCostBuyPrice+263
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 266, 263, 263
                    , 263, 263, 263, 263
                    , 0, 0, 0, 0
                    , 0, 0, 0, 263, 263, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+266, sellCostBuyPrice =sellCostBuyPrice+263
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-09-17 22:29:22' WHERE storedetailid = '290';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('290', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '9', '1', '2026-09-17 22:29:22','0','0'); -- id=794
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','00289', '42', '7', '289', '1.00', '350', '350', '0', '', '1', '2026-09-17 22:29:22', '289', '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=248
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 248;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (289, '2026-09-17', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 350, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+350, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2026-09-17 22:29:22' WHERE storedetailid = '289';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('289', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '11', '1', '2026-09-17 22:29:22','0','0'); -- id=795
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '20', '188', '8.00', '25', '200', '0', '', '1', '2026-09-17 22:29:22', '188', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','25','200','0','','0','0.00','0','0','0','0'); -- id=249
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 = 249;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (188, '2026-09-17', 200, 164, 164
                    , 164, 164, 164, 164
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 164, 164, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+164
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+164, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+164, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+164
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+164
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+164
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 200, 164, 164
                    , 164, 164, 164, 164
                    , 0, 0, 0, 0
                    , 0, 0, 0, 164, 164, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+164
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+164, sellCostMeanBuyPrice = sellCostMeanBuyPrice+164
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+164, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+164
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+164
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+164
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+164
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2026-09-17 22:29:22' WHERE storedetailid = '188';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('188', '1', '8', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '37', '29', '1', '2026-09-17 22:29:22','0','0'); -- id=796
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('76.5','00320', '42', '7', '320', '1.00', '85', '85', '0', '', '1', '2026-09-17 22:29:23', '320', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','85','85','0','','0','0.00','0','0','0','0'); -- id=250
UPDATE sellbilldetail SET  lastbuyprice = 76.50 , meanbuyprice = 76.50, lastbuyprice_withDiscount = 76.50, meanbuyprice_withDiscount = 76.50
        , lastbuyprice_withTax = 76.5, meanbuyprice_withTax = 76.5, lastbuyprice_withDiscountAndTax = 76.5
                where sellbilldetailid = 250;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (320, '2026-09-17', 85, 76.5, 76.5
                    , 76.5, 76.5, 76.5, 76.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 76.5, 76.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+76.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+76.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+76.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+76.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+76.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+76.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+76.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76.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+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-09-17', 85, 76.5, 76.5
                    , 76.5, 76.5, 76.5, 76.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 76.5, 76.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+85, sellCostBuyPrice =sellCostBuyPrice+76.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+76.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+76.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+76.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+76.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+76.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+76.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+76.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 = '25', userid = '1', storedetaildate = '2026-09-17 22:29:23' WHERE storedetailid = '320';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('320', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '26', '25', '1', '2026-09-17 22:29:23','0','0'); -- id=797
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('35','00079', '42', '22', '79', '1.00', '39', '39', '0', '', '1', '2026-09-17 22:29:23', '79', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','39','39','0','','0','0.00','0','0','0','0'); -- id=251
UPDATE sellbilldetail SET  lastbuyprice = 35.00 , meanbuyprice = 35.00, lastbuyprice_withDiscount = 35.00, meanbuyprice_withDiscount = 35.00
        , lastbuyprice_withTax = 35, meanbuyprice_withTax = 35, lastbuyprice_withDiscountAndTax = 35
                where sellbilldetailid = 251;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (79, '2026-09-17', 39, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+39, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 39, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+39, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-09-17 22:29:23' WHERE storedetailid = '79';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('79', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '19', '1', '2026-09-17 22:29:23','0','0'); -- id=798
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 12;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '3', '105', '8.00', '15', '120', '0', '', '1', '2026-09-17 22:29:23', '105', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','12-8,','1','1','0','0','15','120','0','','0','0.00','0','0','0','0'); -- id=252
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 = 252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (105, '2026-09-17', 120, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 120, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '862', userid = '1', storedetaildate = '2026-09-17 22:29:23' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '8', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '870', '862', '1', '2026-09-17 22:29:23','0','0'); -- id=799
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '42', '6', '207', '1.00', '15', '15', '0', '', '1', '2026-09-17 22:29:24', '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=253
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 = 253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-09-17', 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-09-17', 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 = '148', userid = '1', storedetaildate = '2026-09-17 22:29:24' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '149', '148', '1', '2026-09-17 22:29:24','0','0'); -- id=800
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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.9','00135', '42', '21', '135', '4.00', '39.9', '159.6', '0', '', '1', '2026-09-17 22:29:24', '135', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','39.9','159.6','0','','0','0.00','0','0','0','0'); -- id=254
UPDATE sellbilldetail SET  lastbuyprice = 39.90 , meanbuyprice = 39.90, lastbuyprice_withDiscount = 39.90, meanbuyprice_withDiscount = 39.90
        , lastbuyprice_withTax = 39.9, meanbuyprice_withTax = 39.9, lastbuyprice_withDiscountAndTax = 39.9
                where sellbilldetailid = 254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (135, '2026-09-17', 159.6, 159.6, 159.6
                    , 159.6, 159.6, 159.6, 159.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 159.6, 159.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+159.6, sellCostBuyPrice =sellCostBuyPrice+159.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+159.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+159.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+159.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+159.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159.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+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-09-17', 159.6, 159.6, 159.6
                    , 159.6, 159.6, 159.6, 159.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 159.6, 159.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+159.6, sellCostBuyPrice =sellCostBuyPrice+159.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+159.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+159.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+159.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+159.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+159.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+159.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+159.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 = '54', userid = '1', storedetaildate = '2026-09-17 22:29:24' WHERE storedetailid = '135';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('135', '1', '4', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '58', '54', '1', '2026-09-17 22:29:24','0','0'); -- id=801
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00348', '42', '25', '348', '1', '250', '250', '0', '', '1', '2026-09-17 22:29:24', '348', '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=255
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 = 255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (348, '2026-09-17', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 250, 200, 200
                    , 200, 200, 200, 200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 200, 200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-17 22:29:25' WHERE storedetailid = '348';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('348', '1', '1', '1', '42', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '3', '1', '2026-09-17 22:29:25','0','0'); -- id=802
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-287587.36875',  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 ('-289871.71875','2284.35', '0', '1', 'اضافة فاتورة مبيعات (معدله)', '42', '-287587.36875', '2026-09-17 22:29:25', '1',  'sellbillController.php','11','','0'); -- id=45
UPDATE dailyentry SET totalcreditor = '2034.35', totaldebtor = '2034.35', thedate = '2026-09-16', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-16 22:20:03', entryComment = 'اضافة فاتورة مبيعات رقم 29', fromFlag = '1',related='0',isopeningentry='0',operationId='29',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=29' WHERE id = '467';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2034.35', '2034.35', '2026-09-17', '1', '0', '467', '2026-09-17 22:29:25','تم عكس القيد رقم 467 ','1','0','0','0','0',''); -- id=540
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('540', '438', '2034.35', '','0'); -- id=540
UPDATE accountstree SET name = 'خالد ابوجبل ', customName = 'خالد ابوجبل ', customNameEn = 'خالد ابوجبل ', nameEn = 'خالد ابوجبل ', parent = '58', accountNature = '0', theValue = '-2034', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-16 19:27:51' WHERE id = '438';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('540', '143', '2034.35', '','0'); -- id=540
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '91724.14', 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 = '2034.00', totaldebtor = '2034.00', thedate = '2026-09-16', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-16 22:20:03', entryComment = 'اضافة فاتورة مبيعات رقم 29 - تحصيل الفاتورة من العميل', fromFlag = '1',related='0',isopeningentry='0',operationId='29',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=29' WHERE id = '468';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2034.00', '2034.00', '2026-09-17', '1', '0', '468', '2026-09-17 22:29:25','تم عكس القيد رقم 468 ','1','0','0','0','0',''); -- id=541
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('541', '383', '2034.00', '','0'); -- id=541
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-243179.73', 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 ('541', '438', '2034.00', '','0'); -- id=541
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-16 19:27:51' WHERE id = '438';
UPDATE dailyentry SET totalcreditor = '1910.10', totaldebtor = '1910.10', thedate = '2026-09-16', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-16 22:20:03', entryComment = 'اضافة فاتورة مبيعات رقم 29 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='29',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=29' WHERE id = '469';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1910.10', '1910.10', '2026-09-17', '1', '0', '469', '2026-09-17 22:29:26','تم عكس القيد رقم 469 ','1','0','0','0','0',''); -- id=542
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('542', '402', '1910.10', '','0'); -- id=542
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '86825.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('542', '382', '1910.10', '','0'); -- id=542
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2201500.22', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '2284.35', '2284.35', '2026-09-17', '1', '0', '0', '2026-09-17 22:29:26','اضافة فاتورة مبيعات رقم 42','1','0',null,'0','42','sellbillController.php?do=showDetail&sellbillid=42'); -- id=543
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('543', '438', '2284.35', '','0'); -- id=543
UPDATE accountstree SET name = 'خالد ابوجبل ', customName = 'خالد ابوجبل ', customNameEn = 'خالد ابوجبل ', nameEn = 'خالد ابوجبل ', parent = '58', accountNature = '0', theValue = '2284.35', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-16 19:27:51' WHERE id = '438';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('543', '143', '2284.35', '','0'); -- id=543
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '94008.49', 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 ( '2284.35', '2284.35', '2026-09-17', '1', '0', '0', '2026-09-17 22:29:26','اضافة فاتورة مبيعات رقم 42 - تحصيل الفاتورة من العميل','1','0',null,'0','42','sellbillController.php?do=showDetail&sellbillid=42'); -- id=544
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('544', '383', '2284.35', '','0'); -- id=544
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-240895.38', 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 ('544', '438', '2284.35', '','0'); -- id=544
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-16 19:27:51' WHERE id = '438';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2110.1', '2110.1', '2026-09-17', '1', '0', '0', '2026-09-17 22:29:26','اضافة فاتورة مبيعات رقم 42 - صرف البضاعة من المخزن','1','0',null,'0','42','sellbillController.php?do=showDetail&sellbillid=42'); -- id=545
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('545', '402', '2110.1', '','0'); -- id=545
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '88935.45', 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 ('545', '382', '2110.1', '','0'); -- id=545
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2199390.12', theOrder = '0', layingOrder = '120202', reportid = '1', 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='543,544,545' where sellbillid=42;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 2284.35, 2110.1, 2110.1
                    , 2110.1, 2110.1, 2110.1, 2110.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2110.1, 2110.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2284.35, sellCostBuyPrice =sellCostBuyPrice+2110.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2110.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2110.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2110.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2110.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2110.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2110.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2110.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-09-17', 2284.35, 2110.1, 2110.1
                    , 2110.1, 2110.1, 2110.1, 2110.1
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2110.1, 2110.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2284.35, sellCostBuyPrice =sellCostBuyPrice+2110.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2110.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2110.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2110.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2110.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2110.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2110.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2110.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2284.35, 2110.1, 2110.1
                    , 2110.1, 2110.1, 2110.1, 2110.1, 2110.1, 2110.1)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2284.35, netSellCostBuyPrice = netSellCostBuyPrice+2110.1
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2110.1
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2110.1
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2110.1
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2110.1
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2110.1
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2110.1
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2110.1;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 29 and newid=42 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:59:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:29:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 22:29:28', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=42'); -- id=1459
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:59:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:29:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-17 22:29:48', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=1460
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 18:59:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:29:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-17 22:29:52', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=1461
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 19:00:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:30:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-17 22:30:00', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=1462
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 19:00:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:30:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-17 22:30:27', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=1463
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 19:00:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:30:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-09-17 22:30:50', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/savedailyController.php'); -- id=1464
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 19:11:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:41:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 22:41:36', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1465
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-17 19:14:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-17 22:44:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-17 22:44:18', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1466

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aac5080e769d
-- ----------------------------------------------------------------------------------------------------

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-09-17 22:44:18', '06aac5080e769d', '12', '700.00', '24995', '0', '1', '24295.00', '24295', '0', '24295', '1', '2026-09-17 22:44:18', '', '1', '0', 'بيتر', '1', '1', '3', '0', '12 - بيتر', '1950' ,'0','','','','','-1','0','0','0','0','0','24295','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-17','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=43
UPDATE client SET  clientdebt = '24995', 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','700.00','24295','0','اضافة فاتورة مبيعات','43', '24995', '2026-09-17 22:44:19', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '24295', '0', null, '0', null, null,'', '0','1','1','24295','1','2026-09-17 22:44:18','0','0','',''); -- id=70
UPDATE client SET  inUse = 0 where clientid = 12;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+292 where id = 9;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+198 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', '43', '3', '102', '490', '12', '5880', '0', '', '1', '2026-09-17 22:44:19', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','9-292,11-198,','1','1','0','0','12','5880','0','','0','0.00','0','0','0','0'); -- id=256
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 = 256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-09-17', 5880, 5757.5, 5757.5
                    , 5757.5, 5757.5, 5757.5, 5757.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 490, 0, 5757.5, 5757.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5880, sellCostBuyPrice =sellCostBuyPrice+5757.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5757.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5757.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5757.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5757.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5757.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5757.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5757.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+490
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 5880, 5757.5, 5757.5
                    , 5757.5, 5757.5, 5757.5, 5757.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5757.5, 5757.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5880, sellCostBuyPrice =sellCostBuyPrice+5757.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5757.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5757.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5757.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5757.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5757.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5757.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5757.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 = '1452', userid = '1', storedetaildate = '2026-09-17 22:44:19' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '490', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1942', '1452', '1', '2026-09-17 22:44:19','0','0'); -- id=803
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+492 where id = 12;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '43', '3', '105', '500', '15', '7500', '0', '', '1', '2026-09-17 22:44:19', '105', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','12-492,','1','1','0','0','15','7500','0','','0','0.00','0','0','0','0'); -- id=257
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 = 257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (105, '2026-09-17', 7500, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 0, 7500, 7500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 7500, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 7500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '362', userid = '1', storedetaildate = '2026-09-17 22:44:20' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '500', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '862', '362', '1', '2026-09-17 22:44:20','0','0'); -- id=804
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+500 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', '43', '3', '103', '500', '5.5', '2750', '0', '', '1', '2026-09-17 22:44:20', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-500,','1','1','0','0','5.5','2750','0','','0','0.00','0','0','0','0'); -- id=258
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 = 258;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-09-17', 2750, 2250, 2250
                    , 2250, 2250, 2250, 2250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 500, 0, 2250, 2250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-09-17', 2750, 2250, 2250
                    , 2250, 2250, 2250, 2250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2250, 2250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2171', userid = '1', storedetaildate = '2026-09-17 22:44:20' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '500', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2671', '2171', '1', '2026-09-17 22:44:20','0','0'); -- id=805
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+240 where id = 14;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '43', '3', '101', '240', '17.75', '4260', '0', '', '1', '2026-09-17 22:44:20', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','14-240,','1','1','0','0','17.75','4260','0','','0','0.00','0','0','0','0'); -- id=259
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 = 259;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-09-17', 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-09-17', 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 = '482', userid = '1', storedetaildate = '2026-09-17 22:44:20' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '240', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '722', '482', '1', '2026-09-17 22:44:20','0','0'); -- id=806
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+220 where id = 13;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '43', '3', '100', '220', '17.75', '3905', '0', '', '1', '2026-09-17 22:44:20', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','13-220,','1','1','0','0','17.75','3905','0','','0','0.00','0','0','0','0'); -- id=260
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 = 260;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-09-17', 3905, 3872, 3872
                    , 3872, 3872, 3872, 3872
                    , 0, 0, 0, 0
                    , 0, 0, 0, 220, 0, 3872, 3872, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3905, sellCostBuyPrice =sellCostBuyPrice+3872
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3872, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3872
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3872, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3872
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3872
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3872
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3872
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+220
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-17', 3905, 3872, 3872
                    , 3872, 3872, 3872, 3872
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3872, 3872, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3905, sellCostBuyPrice =sellCostBuyPrice+3872
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3872, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3872
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3872, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3872
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3872
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3872
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3872
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '407', userid = '1', storedetaildate = '2026-09-17 22:44:21' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '220', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '627', '407', '1', '2026-09-17 22:44:21','0','0'); -- id=807
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '24295', '24295', '2026-09-17', '1', '0', '0', '2026-09-17 22:44:21','اضافة فاتورة مبيعات رقم 43','1','0',null,'0','43','sellbillController.php?do=showDetail&sellbillid=43'); -- id=546
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('546', '439', '24295', '','0'); -- id=546
UPDATE accountstree SET name = 'بيتر', customName = 'بيتر', customNameEn = 'بيتر', nameEn = 'بيتر', parent = '58', accountNature = '0', theValue = '24995', 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 ('546', '143', '24295', '','0'); -- id=546
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '118303.49', 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 ( '23603.5', '23603.5', '2026-09-17', '1', '0', '0', '2026-09-17 22:44:21','اضافة فاتورة مبيعات رقم 43 - صرف البضاعة من المخزن','1','0',null,'0','43','sellbillController.php?do=showDetail&sellbillid=43'); -- id=547
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('547', '402', '23603.5', '','0'); -- id=547
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '112538.95', 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 ('547', '382', '23603.5', '','0'); -- id=547
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2175786.62', theOrder = '0', layingOrder = '120202', reportid = '1', 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='546,0,547' where sellbillid=43;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-17', 24295, 23603.5, 23603.5
                    , 23603.5, 23603.5, 23603.5, 23603.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,23603.5, 23603.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+24295, sellCostBuyPrice =sellCostBuyPrice+23603.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+23603.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+23603.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+23603.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+23603.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+23603.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+23603.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+23603.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12, '2026-09-17', 24295, 23603.5, 23603.5
                    , 23603.5, 23603.5, 23603.5, 23603.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,23603.5, 23603.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+24295, sellCostBuyPrice =sellCostBuyPrice+23603.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+23603.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+23603.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+23603.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+23603.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+23603.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+23603.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+23603.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 24295, 23603.5, 23603.5
                    , 23603.5, 23603.5, 23603.5, 23603.5, 23603.5, 23603.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+24295, netSellCostBuyPrice = netSellCostBuyPrice+23603.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+23603.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+23603.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+23603.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+23603.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+23603.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+23603.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+23603.5;
COMMIT;

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

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