UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 09:58:39";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 09:58:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 13:28:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-18 13:28:49', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=1468
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-18',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-18 09:58:55";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-18 13:28:55', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1469
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 09:59:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 13:29:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 13:29:14', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1470
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:10:55";
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-18 11:11:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:41:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-18 14:41:04', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=1471
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-18 11:11:11";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-18 14:41:11', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1472
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:11:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:41:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 14:41:33', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1473
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:11:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:41:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 14:41:44', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=43'); -- id=1474
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:11:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:41:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 14:41:55', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1475
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:15:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:45:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 14:45:55', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1476

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aad319407cef
-- ----------------------------------------------------------------------------------------------------

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-18 14:45:55', '06aad319407cef', '1', '0.00', '0', '0', '1', '26117.00', '26117', '26117', '0', '1', '2026-09-18 14:45:55', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '415' ,'0','','','','','-1','0','0','0','0','0','26117','0','','0','0','26117','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-18','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=44
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','اضافة فاتورة مبيعات','44', '0', '2026-09-18 14:45:56', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '26117', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-18 14:45:55','0','0','',''); -- id=71
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('52.75','00001', '44', '1', '1', '65', '54.78', '3560.7000000000003', '0', '', '1', '2026-09-18 14:45:56', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','54.78','3560.7','0','','0','0.00','0','0','0','0'); -- id=261
UPDATE sellbilldetail SET  lastbuyprice = 52.75 , meanbuyprice = 52.75, lastbuyprice_withDiscount = 52.75, meanbuyprice_withDiscount = 52.75
        , lastbuyprice_withTax = 52.75, meanbuyprice_withTax = 52.75, lastbuyprice_withDiscountAndTax = 52.75
                where sellbilldetailid = 261;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 3560.7, 3428.75, 3428.75
                    , 3428.75, 3428.75, 3428.75, 3428.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 65, 0, 3428.75, 3428.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3560.7, sellCostBuyPrice =sellCostBuyPrice+3428.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3428.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3428.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3428.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3428.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3428.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3428.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3428.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+65
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 3560.7, 3428.75, 3428.75
                    , 3428.75, 3428.75, 3428.75, 3428.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3428.75, 3428.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3560.7, sellCostBuyPrice =sellCostBuyPrice+3428.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3428.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3428.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3428.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3428.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3428.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3428.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3428.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 = '830', userid = '1', storedetaildate = '2026-09-18 14:45:56' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '65', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '895', '830', '1', '2026-09-18 14:45:56','0','0'); -- id=808
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34.8','00003', '44', '1', '3', '65', '36', '2340', '0', '', '1', '2026-09-18 14:45:56', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','2340','0','','0','0.00','0','0','0','0'); -- id=262
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 262;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2026-09-18', 2340, 2262, 2262
                    , 2262, 2262, 2262, 2262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 65, 0, 2262, 2262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+65
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 2340, 2262, 2262
                    , 2262, 2262, 2262, 2262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2262, 2262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1680', userid = '1', storedetaildate = '2026-09-18 14:45:57' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '65', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1745', '1680', '1', '2026-09-18 14:45:57','0','0'); -- id=809
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34.8','00004', '44', '1', '4', '65', '36', '2340', '0', '', '1', '2026-09-18 14:45:57', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','2340','0','','0','0.00','0','0','0','0'); -- id=263
UPDATE sellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where sellbilldetailid = 263;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2026-09-18', 2340, 2262, 2262
                    , 2262, 2262, 2262, 2262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 65, 0, 2262, 2262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+65
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 2340, 2262, 2262
                    , 2262, 2262, 2262, 2262
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2262, 2262, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2262
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2262, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2262
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2262, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2262
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2262
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2262
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2262
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2037', userid = '1', storedetaildate = '2026-09-18 14:45:57' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '65', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2102', '2037', '1', '2026-09-18 14:45:57','0','0'); -- id=810
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00006', '44', '1', '6', '10', '109', '1090', '0', '', '1', '2026-09-18 14:45:57', '6', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','109','1090','0','','0','0.00','0','0','0','0'); -- id=264
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 264;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-09-18', 1090, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1090, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 1090, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1090, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '172', userid = '1', storedetaildate = '2026-09-18 14:45:57' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '10', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '182', '172', '1', '2026-09-18 14:45:57','0','0'); -- id=811
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('237','00010', '44', '1', '10', '5', '246.5', '1232.5', '0', '', '1', '2026-09-18 14:45:58', '10', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','246.5','1232.5','0','','0','0.00','0','0','0','0'); -- id=265
UPDATE sellbilldetail SET  lastbuyprice = 237.00 , meanbuyprice = 237.00, lastbuyprice_withDiscount = 237.00, meanbuyprice_withDiscount = 237.00
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where sellbilldetailid = 265;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (10, '2026-09-18', 1232.5, 1185, 1185
                    , 1185, 1185, 1185, 1185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1185, 1185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1232.5, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 1232.5, 1185, 1185
                    , 1185, 1185, 1185, 1185
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1185, 1185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1232.5, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1185
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '53', userid = '1', storedetaildate = '2026-09-18 14:45:58' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '5', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '58', '53', '1', '2026-09-18 14:45:58','0','0'); -- id=812
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('10.55','00005', '44', '1', '5', '150', '10.95', '1642.5', '0', '', '1', '2026-09-18 14:45:58', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10.95','1642.5','0','','0','0.00','0','0','0','0'); -- id=266
UPDATE sellbilldetail SET  lastbuyprice = 10.55 , meanbuyprice = 10.55, lastbuyprice_withDiscount = 10.55, meanbuyprice_withDiscount = 10.55
        , lastbuyprice_withTax = 10.55, meanbuyprice_withTax = 10.55, lastbuyprice_withDiscountAndTax = 10.55
                where sellbilldetailid = 266;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-09-18', 1642.5, 1582.5, 1582.5
                    , 1582.5, 1582.5, 1582.5, 1582.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 150, 0, 1582.5, 1582.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1642.5, sellCostBuyPrice =sellCostBuyPrice+1582.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1582.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1582.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1582.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1582.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1582.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1582.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1582.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+150
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 1642.5, 1582.5, 1582.5
                    , 1582.5, 1582.5, 1582.5, 1582.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1582.5, 1582.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1642.5, sellCostBuyPrice =sellCostBuyPrice+1582.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1582.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1582.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1582.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1582.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1582.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1582.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1582.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 = '1760', userid = '1', storedetaildate = '2026-09-18 14:45:58' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '150', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1910', '1760', '1', '2026-09-18 14:45:58','0','0'); -- id=813
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('84.46','00007', '44', '1', '7', '4', '87', '348', '0', '', '1', '2026-09-18 14:45:58', '7', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','87','348','0','','0','0.00','0','0','0','0'); -- id=267
UPDATE sellbilldetail SET  lastbuyprice = 84.46 , meanbuyprice = 84.46, lastbuyprice_withDiscount = 84.46, meanbuyprice_withDiscount = 84.46
        , lastbuyprice_withTax = 84.46, meanbuyprice_withTax = 84.46, lastbuyprice_withDiscountAndTax = 84.46
                where sellbilldetailid = 267;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7, '2026-09-18', 348, 337.84, 337.84
                    , 337.84, 337.84, 337.84, 337.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 337.84, 337.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348, sellCostBuyPrice =sellCostBuyPrice+337.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+337.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+337.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+337.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+337.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+337.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+337.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+337.84
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 348, 337.84, 337.84
                    , 337.84, 337.84, 337.84, 337.84
                    , 0, 0, 0, 0
                    , 0, 0, 0, 337.84, 337.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+348, sellCostBuyPrice =sellCostBuyPrice+337.84
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+337.84, sellCostMeanBuyPrice = sellCostMeanBuyPrice+337.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+337.84, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+337.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+337.84
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+337.84
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+337.84
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '147', userid = '1', storedetaildate = '2026-09-18 14:45:58' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '4', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '151', '147', '1', '2026-09-18 14:45:59','0','0'); -- id=814
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('47','00014', '44', '1', '14', '4', '49.9', '199.6', '0', '', '1', '2026-09-18 14:45:59', '14', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','49.9','199.6','0','','0','0.00','0','0','0','0'); -- id=268
UPDATE sellbilldetail SET  lastbuyprice = 47.00 , meanbuyprice = 47.00, lastbuyprice_withDiscount = 47.00, meanbuyprice_withDiscount = 47.00
        , lastbuyprice_withTax = 47, meanbuyprice_withTax = 47, lastbuyprice_withDiscountAndTax = 47
                where sellbilldetailid = 268;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (14, '2026-09-18', 199.6, 188, 188
                    , 188, 188, 188, 188
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 188, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+199.6, sellCostBuyPrice =sellCostBuyPrice+188
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+188, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+188, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+188
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 199.6, 188, 188
                    , 188, 188, 188, 188
                    , 0, 0, 0, 0
                    , 0, 0, 0, 188, 188, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+199.6, sellCostBuyPrice =sellCostBuyPrice+188
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+188, sellCostMeanBuyPrice = sellCostMeanBuyPrice+188
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+188, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+188
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+188
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+188
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+188
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '97', userid = '1', storedetaildate = '2026-09-18 14:45:59' WHERE storedetailid = '14';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '4', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '101', '97', '1', '2026-09-18 14:45:59','0','0'); -- id=815
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('63','00016', '44', '1', '16', '1', '67', '67', '0', '', '1', '2026-09-18 14:45:59', '16', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','67','67','0','','0','0.00','0','0','0','0'); -- id=269
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 269;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-09-18', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 67, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+67, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '58', userid = '1', storedetaildate = '2026-09-18 14:45:59' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '58', '1', '2026-09-18 14:45:59','0','0'); -- id=816
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','00013', '44', '1', '13', '1', '317.7', '317.7', '0', '', '1', '2026-09-18 14:45:59', '13', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','317.7','317.7','0','','0','0.00','0','0','0','0'); -- id=270
UPDATE sellbilldetail SET  lastbuyprice = 306.00 , meanbuyprice = 306.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 270;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13, '2026-09-18', 317.7, 306, 306
                    , 306, 306, 306, 306
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 306, 306, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+317.7, sellCostBuyPrice =sellCostBuyPrice+306
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+306, sellCostMeanBuyPrice = sellCostMeanBuyPrice+306
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+306, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+306
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+306
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+306
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+306
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 317.7, 306, 306
                    , 306, 306, 306, 306
                    , 0, 0, 0, 0
                    , 0, 0, 0, 306, 306, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+317.7, sellCostBuyPrice =sellCostBuyPrice+306
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+306, sellCostMeanBuyPrice = sellCostMeanBuyPrice+306
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+306, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+306
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+306
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+306
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+306
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-09-18 14:46:00' WHERE storedetailid = '13';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '1', '1', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '18', '1', '2026-09-18 14:46:00','0','0'); -- id=817
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('63','00012', '44', '1', '12', '4', '66', '264', '0', '', '1', '2026-09-18 14:46:00', '12', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','66','264','0','','0','0.00','0','0','0','0'); -- id=271
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 271;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (12, '2026-09-18', 264, 252, 252
                    , 252, 252, 252, 252
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 252, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+264, sellCostBuyPrice =sellCostBuyPrice+252
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+252, sellCostMeanBuyPrice = sellCostMeanBuyPrice+252
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+252, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+252
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+252
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+252
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 264, 252, 252
                    , 252, 252, 252, 252
                    , 0, 0, 0, 0
                    , 0, 0, 0, 252, 252, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+264, sellCostBuyPrice =sellCostBuyPrice+252
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+252, sellCostMeanBuyPrice = sellCostMeanBuyPrice+252
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+252, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+252
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+252
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+252
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+252
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '97', userid = '1', storedetaildate = '2026-09-18 14:46:00' WHERE storedetailid = '12';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '4', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '101', '97', '1', '2026-09-18 14:46:00','0','0'); -- id=818
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','00009', '44', '1', '9', '8', '319', '2552', '0', '', '1', '2026-09-18 14:46:00', '9', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','319','2552','0','','0','0.00','0','0','0','0'); -- id=272
UPDATE sellbilldetail SET  lastbuyprice = 306.00 , meanbuyprice = 306.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 272;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (9, '2026-09-18', 2552, 2448, 2448
                    , 2448, 2448, 2448, 2448
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2448, 2448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2552, sellCostBuyPrice =sellCostBuyPrice+2448
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2448, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2448
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2448, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2448
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2448
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2448
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 2552, 2448, 2448
                    , 2448, 2448, 2448, 2448
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2448, 2448, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2552, sellCostBuyPrice =sellCostBuyPrice+2448
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2448, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2448
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2448, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2448
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2448
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2448
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2448
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '1', storedetaildate = '2026-09-18 14:46:00' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '8', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '47', '39', '1', '2026-09-18 14:46:00','0','0'); -- id=819
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00283', '44', '22', '283', '4', '335', '1340', '0', '', '1', '2026-09-18 14:46:00', '283', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','335','1340','0','','0','0.00','0','0','0','0'); -- id=273
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 = 273;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (283, '2026-09-18', 1340, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1340, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 1340, 1100, 1100
                    , 1100, 1100, 1100, 1100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1100, 1100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1340, sellCostBuyPrice =sellCostBuyPrice+1100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-09-18 14:46:01' WHERE storedetailid = '283';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '1', '4', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '6', '1', '2026-09-18 14:46:01','0','0'); -- id=820
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('99','00285', '44', '7', '285', '2', '125', '250', '0', '', '1', '2026-09-18 14:46:01', '285', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','125','250','0','','0','0.00','0','0','0','0'); -- id=274
UPDATE sellbilldetail SET  lastbuyprice = 99.00 , meanbuyprice = 99.00, lastbuyprice_withDiscount = 99.00, meanbuyprice_withDiscount = 99.00
        , lastbuyprice_withTax = 99, meanbuyprice_withTax = 99, lastbuyprice_withDiscountAndTax = 99
                where sellbilldetailid = 274;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (285, '2026-09-18', 250, 198, 198
                    , 198, 198, 198, 198
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 198, 198, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+198
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+198, sellCostMeanBuyPrice = sellCostMeanBuyPrice+198
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+198, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+198
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+198
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+198
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+198
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 250, 198, 198
                    , 198, 198, 198, 198
                    , 0, 0, 0, 0
                    , 0, 0, 0, 198, 198, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+198
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+198, sellCostMeanBuyPrice = sellCostMeanBuyPrice+198
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+198, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+198
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+198
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+198
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+198
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-18 14:46:01' WHERE storedetailid = '285';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('285', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '25', '1', '2026-09-18 14:46:01','0','0'); -- id=821
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','00287', '44', '7', '287', '2', '250', '500', '0', '', '1', '2026-09-18 14:46:01', '287', '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=275
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where sellbilldetailid = 275;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (287, '2026-09-18', 500, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 500, 420, 420
                    , 420, 420, 420, 420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 420, 420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+500, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2026-09-18 14:46:01' WHERE storedetailid = '287';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('287', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '7', '1', '2026-09-18 14:46:01','0','0'); -- id=822
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('252','00288', '44', '7', '288', '2', '295', '590', '0', '', '1', '2026-09-18 14:46:01', '288', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','295','590','0','','0','0.00','0','0','0','0'); -- id=276
UPDATE sellbilldetail SET  lastbuyprice = 252.00 , meanbuyprice = 252.00, lastbuyprice_withDiscount = 252.00, meanbuyprice_withDiscount = 252.00
        , lastbuyprice_withTax = 252, meanbuyprice_withTax = 252, lastbuyprice_withDiscountAndTax = 252
                where sellbilldetailid = 276;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (288, '2026-09-18', 590, 504, 504
                    , 504, 504, 504, 504
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 504, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+504
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+504, sellCostMeanBuyPrice = sellCostMeanBuyPrice+504
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+504, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+504
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+504
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+504
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 590, 504, 504
                    , 504, 504, 504, 504
                    , 0, 0, 0, 0
                    , 0, 0, 0, 504, 504, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+590, sellCostBuyPrice =sellCostBuyPrice+504
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+504, sellCostMeanBuyPrice = sellCostMeanBuyPrice+504
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+504, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+504
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+504
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+504
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+504
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-18 14:46:02' WHERE storedetailid = '288';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('288', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '30', '1', '2026-09-18 14:46:02','0','0'); -- id=823
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1400','00380', '44', '16', '380', '2', '1650', '3300', '0', '', '1', '2026-09-18 14:46:02', '380', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1650','3300','0','','0','0.00','0','0','0','0'); -- id=277
UPDATE sellbilldetail SET  lastbuyprice = 1400.00 , meanbuyprice = 1400.00, lastbuyprice_withDiscount = 1400.00, meanbuyprice_withDiscount = 1400.00
        , lastbuyprice_withTax = 1400, meanbuyprice_withTax = 1400, lastbuyprice_withDiscountAndTax = 1400
                where sellbilldetailid = 277;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (380, '2026-09-18', 3300, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 3300, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-18 14:46:02' WHERE storedetailid = '380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('380', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '0', '1', '2026-09-18 14:46:02','0','0'); -- id=824
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('425','00378', '44', '16', '378', '2', '485', '970', '0', '', '1', '2026-09-18 14:46:02', '378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','485','970','0','','0','0.00','0','0','0','0'); -- id=278
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where sellbilldetailid = 278;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (378, '2026-09-18', 970, 850, 850
                    , 850, 850, 850, 850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 850, 850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 970, 850, 850
                    , 850, 850, 850, 850
                    , 0, 0, 0, 0
                    , 0, 0, 0, 850, 850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+970, sellCostBuyPrice =sellCostBuyPrice+850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+850
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+850
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-18 14:46:02' WHERE storedetailid = '378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('378', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '13', '1', '2026-09-18 14:46:02','0','0'); -- id=825
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','00282', '44', '22', '282', '3', '305', '915', '0', '', '1', '2026-09-18 14:46:02', '282', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','305','915','0','','0','0.00','0','0','0','0'); -- id=279
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 = 279;
 INSERT INTO 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-18', 915, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+915, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 915, 825, 825
                    , 825, 825, 825, 825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 825, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+915, sellCostBuyPrice =sellCostBuyPrice+825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2026-09-18 14:46:03' WHERE storedetailid = '282';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('282', '1', '3', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14', '11', '1', '2026-09-18 14:46:03','0','0'); -- id=826
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('210','00196', '44', '20', '196', '6', '245', '1470', '0', '', '1', '2026-09-18 14:46:03', '196', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','245','1470','0','','0','0.00','0','0','0','0'); -- id=280
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
        , lastbuyprice_withTax = 210, meanbuyprice_withTax = 210, lastbuyprice_withDiscountAndTax = 210
                where sellbilldetailid = 280;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (196, '2026-09-18', 1470, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-18', 1470, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '74', userid = '1', storedetaildate = '2026-09-18 14:46:03' WHERE storedetailid = '196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '6', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '80', '74', '1', '2026-09-18 14:46:03','0','0'); -- id=827
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('144.3','00064', '44', '1', '64', '2', '152', '304', '0', '', '1', '2026-09-18 14:46:03', '64', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','152','304','0','','0','0.00','0','0','0','0'); -- id=281
UPDATE sellbilldetail SET  lastbuyprice = 144.30 , meanbuyprice = 144.30, lastbuyprice_withDiscount = 144.30, meanbuyprice_withDiscount = 144.30
        , lastbuyprice_withTax = 144.3, meanbuyprice_withTax = 144.3, lastbuyprice_withDiscountAndTax = 144.3
                where sellbilldetailid = 281;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (64, '2026-09-18', 304, 288.6, 288.6
                    , 288.6, 288.6, 288.6, 288.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 288.6, 288.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+304, sellCostBuyPrice =sellCostBuyPrice+288.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+288.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+288.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+288.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+288.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+288.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+288.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+288.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-18', 304, 288.6, 288.6
                    , 288.6, 288.6, 288.6, 288.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 288.6, 288.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+304, sellCostBuyPrice =sellCostBuyPrice+288.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+288.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+288.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+288.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+288.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+288.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+288.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+288.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 = '31', userid = '1', storedetaildate = '2026-09-18 14:46:03' WHERE storedetailid = '64';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('64', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '31', '1', '2026-09-18 14:46:04','0','0'); -- id=828
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '44', '14', '81', '6', '19', '114', '0', '', '1', '2026-09-18 14:46:04', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','114','0','','0','0.00','0','0','0','0'); -- id=282
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 = 282;
 INSERT INTO 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-18', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 114, 108, 108
                    , 108, 108, 108, 108
                    , 0, 0, 0, 0
                    , 0, 0, 0, 108, 108, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+114, sellCostBuyPrice =sellCostBuyPrice+108
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+108, sellCostMeanBuyPrice = sellCostMeanBuyPrice+108
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+108, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+108
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+108
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+108
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+108
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '628', userid = '1', storedetaildate = '2026-09-18 14:46:04' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '6', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '634', '628', '1', '2026-09-18 14:46:04','0','0'); -- id=829
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('191','00376', '44', '1', '376', '2', '205', '410', '0', '', '1', '2026-09-18 14:46:04', '376', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','205','410','0','','0','0.00','0','0','0','0'); -- id=283
UPDATE sellbilldetail SET  lastbuyprice = 191.00 , meanbuyprice = 191.00, lastbuyprice_withDiscount = 191.00, meanbuyprice_withDiscount = 191.00
        , lastbuyprice_withTax = 191, meanbuyprice_withTax = 191, lastbuyprice_withDiscountAndTax = 191
                where sellbilldetailid = 283;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (376, '2026-09-18', 410, 382, 382
                    , 382, 382, 382, 382
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 382, 382, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+382
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+382, sellCostMeanBuyPrice = sellCostMeanBuyPrice+382
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+382, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+382
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+382
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+382
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 410, 382, 382
                    , 382, 382, 382, 382
                    , 0, 0, 0, 0
                    , 0, 0, 0, 382, 382, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+382
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+382, sellCostMeanBuyPrice = sellCostMeanBuyPrice+382
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+382, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+382
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+382
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+382
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+382
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-18 14:46:04' WHERE storedetailid = '376';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('376', '1', '2', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '8', '1', '2026-09-18 14:46:04','0','0'); -- id=830
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-261470.375',  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 ('-287587.375','26117', '0', '1', 'اضافة فاتورة مبيعات', '44', '-261470.375', '2026-09-18 14:46:04', '1',  'sellbillController.php','1','','0'); -- id=46
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26117', '26117', '2026-09-18', '1', '0', '0', '2026-09-18 14:46:05','اضافة فاتورة مبيعات رقم 44','1','0',null,'0','44','sellbillController.php?do=showDetail&sellbillid=44'); -- id=548
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('548', '383', '26117', '','0'); -- id=548
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-214778.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 ('548', '143', '26117', '','0'); -- id=548
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '144420.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 ( '24100.69', '24100.69', '2026-09-18', '1', '0', '0', '2026-09-18 14:46:05','اضافة فاتورة مبيعات رقم 44 - صرف البضاعة من المخزن','1','0',null,'0','44','sellbillController.php?do=showDetail&sellbillid=44'); -- id=549
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('549', '402', '24100.69', '','0'); -- id=549
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '136639.64', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('549', '382', '24100.69', '','0'); -- id=549
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2151685.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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='548,0,549' where sellbillid=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-18', 26117, 24100.69, 24100.69
                    , 24100.69, 24100.69, 24100.69, 24100.69
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24100.69, 24100.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26117, sellCostBuyPrice =sellCostBuyPrice+24100.69
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24100.69, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24100.69
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24100.69, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24100.69
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24100.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24100.69
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24100.69
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 26117, 24100.69, 24100.69
                    , 24100.69, 24100.69, 24100.69, 24100.69
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24100.69, 24100.69, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26117, sellCostBuyPrice =sellCostBuyPrice+24100.69
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24100.69, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24100.69
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24100.69, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24100.69
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24100.69
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24100.69
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24100.69
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 26117, 24100.69, 24100.69
                    , 24100.69, 24100.69, 24100.69, 24100.69, 24100.69, 24100.69)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+26117, netSellCostBuyPrice = netSellCostBuyPrice+24100.69
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+24100.69
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+24100.69
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+24100.69
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+24100.69
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+24100.69
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+24100.69
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+24100.69;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06aad319407cef and sellbillId = 44 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:16:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 14:46:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 14:46:07', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1477
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:31:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:01:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-18 15:01:25', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=1478
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:31:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:01:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-18 15:01:50', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=1479
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-18' WHERE storedetailid = '391';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('391', '1', '2', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '4', '2', '1', '2026-09-18','0','0'); -- id=831
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10764', '10764', '2026-09-18', '1', '0', '0', '2026-09-18 15:01:51','اعادة جرد للمنتج : (انتركم 4 خط فيرماكس اسباني /اخري) فى مخزن : (المخزن الرئيسي) بالكمية : 2','1','0',null,'0','831','inventoryController.php?do=details&id=831'); -- id=550
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('550', '188', '10764', '','0'); -- id=550
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-71380.75', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('550', '382', '10764', '','0'); -- id=550
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2140921.93', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:31:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:01:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-18 15:01:53', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=1480
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-18' WHERE storedetailid = '390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('390', '1', '2', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '4', '2', '1', '2026-09-18','0','0'); -- id=832
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13524', '13524', '2026-09-18', '1', '0', '0', '2026-09-18 15:01:54','اعادة جرد للمنتج : (انتركم 6 خط فيرماكس اسباني /اخري) فى مخزن : (المخزن الرئيسي) بالكمية : 2','1','0',null,'0','832','inventoryController.php?do=details&id=832'); -- id=551
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('551', '188', '13524', '','0'); -- id=551
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-57856.75', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('551', '382', '13524', '','0'); -- id=551
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2127397.93', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:32:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:02:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-18 15:02:12', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=1481
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-18' WHERE storedetailid = '389';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('389', '1', '3', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '6', '3', '1', '2026-09-18','0','0'); -- id=833
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7050', '7050', '2026-09-18', '1', '0', '0', '2026-09-18 15:02:12','اعادة جرد للمنتج : (كالون كهرباء ايطالي /اخري) فى مخزن : (المخزن الرئيسي) بالكمية : 3','1','0',null,'0','833','inventoryController.php?do=details&id=833'); -- id=552
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('552', '188', '7050', '','0'); -- id=552
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-50806.75', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('552', '382', '7050', '','0'); -- id=552
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2120347.93', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:32:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:02:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 15:02:15', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1482
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:32:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:02:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 15:02:49', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1483
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:32:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:02:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 15:02:56', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1484
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.00',lastbuyprice_withDiscount = '6762',meanbuyprice = '6762.00',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='6762',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';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (390, 1,'2026-09-18 15:03:27',1)
                ON DUPLICATE KEY UPDATE productid = 390, edited = 1, sysdate = '2026-09-18 15:03:27', userid = 1; -- id=461
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.00',lastbuyprice_withDiscount = '5382',meanbuyprice = '5382.00',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='5382',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';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (391, 1,'2026-09-18 15:03:32',1)
                ON DUPLICATE KEY UPDATE productid = 391, edited = 1, sysdate = '2026-09-18 15:03:32', userid = 1; -- id=462
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 11:33:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 15:03:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 15:03:41', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1485
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 13:03:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 16:33:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 16:33:04', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1486
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 13:07:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 16:37:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 16:37:22', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1487
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 ('نجفه ليد موديل k27 مستورد ','','25','1600','1850','1950','1850','2026-09-18','0','1','0','','0','0','0','0','0','1600','1600','1600','1600','1600','0','15.63','15.63','21.88','.','0','0','0','1600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1600','1600','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1600','0','0','0','0','0','0','','','0','0','0','0'); -- id=396
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600', productSellAllPrice = '1850', productSellUnitPrice = '1950', productSellHalfPrice = '1850', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1600',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600' , buypricereal_precentage = '0' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
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', '396', '1.00', '2026-09-18', '1', '0','0039601','1850','1850','1950','1600','','0','0','0','0','0','0','0','0','0','0'); -- id=396
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('396', '1', '3', '1', '2026-09-18'); -- id=396
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('396', '1', '3', '0', '396', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-18','0','0'); -- id=834
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 16:37:24',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 16:37:24', userid = 1; -- id=469
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4800', '4800', '2026-09-18', '1', '0', '0', '2026-09-18 16:37:24','إضافة منتج نجفه ليد موديل k27 مستورد  الكمية 3','1','0','0','0','396','productController.php?do=edit&id=396'); -- id=553
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('553', '382', '4800', '','0'); -- id=553
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2125147.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('553', '121', '4800', '','0'); -- id=553
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1123702.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 = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600' , buypricereal_precentage = '0' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
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 ('نجفه ليد موديل k07 مستورد ','','25','1750','1950','2050','1950','2026-09-18','0','1','0','','0','0','0','0','0','1750','1750','1750','1750','1750','0','11.43','11.43','17.14','.','0','0','0','1750','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1750','1750','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1750','0','0','0','0','0','0','','','0','0','0','0'); -- id=397
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750', productSellAllPrice = '1950', productSellUnitPrice = '2050', productSellHalfPrice = '1950', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1750',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
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', '397', '1.00', '2026-09-18', '1', '0','0039701','1950','1950','2050','1750','','0','0','0','0','0','0','0','0','0','0'); -- id=397
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('397', '1', '3', '1', '2026-09-18'); -- id=397
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('397', '1', '3', '0', '397', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-18','0','0'); -- id=835
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 1,'2026-09-18 16:37:26',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 1, sysdate = '2026-09-18 16:37:26', userid = 1; -- id=470
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5250', '5250', '2026-09-18', '1', '0', '0', '2026-09-18 16:37:26','إضافة منتج نجفه ليد موديل k07 مستورد  الكمية 3','1','0','0','0','397','productController.php?do=edit&id=397'); -- id=554
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('554', '382', '5250', '','0'); -- id=554
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2130397.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('554', '121', '5250', '','0'); -- id=554
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1128952.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 = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '554',isService = '0',isOptic = '0',lastbuyprice = '1750',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
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 ('نجفه ليد موديل 703 مستورد ','','25','1350','1490','1590','1490','2026-09-18','0','1','0','','0','0','0','0','0','1350','1350','1350','1350','1350','0','10.37','10.37','17.78','.','0','0','0','1350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1350','1350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1350','0','0','0','0','0','0','','','0','0','0','0'); -- id=398
UPDATE product SET productName = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350', productSellAllPrice = '1490', productSellUnitPrice = '1590', productSellHalfPrice = '1490', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1350',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350' , buypricereal_precentage = '0' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
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', '398', '1.00', '2026-09-18', '1', '0','0039801','1490','1490','1590','1350','','0','0','0','0','0','0','0','0','0','0'); -- id=398
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('398', '1', '10', '1', '2026-09-18'); -- id=398
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('398', '1', '10', '0', '398', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-18','0','0'); -- id=836
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (398, 1,'2026-09-18 16:37:28',1)
                ON DUPLICATE KEY UPDATE productid = 398, edited = 1, sysdate = '2026-09-18 16:37:28', userid = 1; -- id=471
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13500', '13500', '2026-09-18', '1', '0', '0', '2026-09-18 16:37:28','إضافة منتج نجفه ليد موديل 703 مستورد  الكمية 10','1','0','0','0','398','productController.php?do=edit&id=398'); -- id=555
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('555', '382', '13500', '','0'); -- id=555
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2143897.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('555', '121', '13500', '','0'); -- id=555
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1142452.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 = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '555',isService = '0',isOptic = '0',lastbuyprice = '1350',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350' , buypricereal_precentage = '0' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
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 ('نجفه ليد موديل f008','','25','900','1050','1150','1050','2026-09-18','0','1','0','','0','0','0','0','0','900','900','900','900','900','0','16.67','16.67','27.78','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','900','0','0','0','0','0','0','','','0','0','0','0'); -- id=399
UPDATE product SET productName = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900', productSellAllPrice = '1050', productSellUnitPrice = '1150', productSellHalfPrice = '1050', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
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', '399', '1.00', '2026-09-18', '1', '0','0039901','1050','1050','1150','900','','0','0','0','0','0','0','0','0','0','0'); -- id=399
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('399', '1', '1', '1', '2026-09-18'); -- id=399
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('399', '1', '1', '0', '399', 'إضافة منتج', 'productController.php', '0', '1', '1', '2026-09-18','0','0'); -- id=837
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (399, 1,'2026-09-18 16:37:30',1)
                ON DUPLICATE KEY UPDATE productid = 399, edited = 1, sysdate = '2026-09-18 16:37:30', userid = 1; -- id=472
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900', '900', '2026-09-18', '1', '0', '0', '2026-09-18 16:37:30','إضافة منتج نجفه ليد موديل f008 الكمية 1','1','0','0','0','399','productController.php?do=edit&id=399'); -- id=556
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('556', '382', '900', '','0'); -- id=556
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2144797.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('556', '121', '900', '','0'); -- id=556
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1143352.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 = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '556',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 13:07:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 16:37:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 16:37:32', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1488
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:06:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:36:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:36:46', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1489
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:07:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:37:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:37:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1490
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:07:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:37:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:37:39', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1491
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:08:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:38:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:38:01', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1492
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:08:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:38:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:38:22', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1493

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aad5ad9c9111
-- ----------------------------------------------------------------------------------------------------

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-18 17:38:23', '06aad5ad9c9111', '1', '0.00', '0', '0', '1', '50.00', '50', '50', '0', '1', '2026-09-18 17:38:23', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','50','0','','0','0','50','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-18','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=45
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','اضافة فاتورة مبيعات','45', '0', '2026-09-18 17:38:24', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '50', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-18 17:38:23','0','0','',''); -- id=72
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 29;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34','00169', '45', '2', '169', '1', '50', '50', '0', '', '1', '2026-09-18 17:38:24', '169', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','29-1,','1','1','0','0','50','50','0','','0','0.00','0','0','0','0'); -- id=284
UPDATE sellbilldetail SET  lastbuyprice = 34.00 , meanbuyprice = 34.00, lastbuyprice_withDiscount = 34.00, meanbuyprice_withDiscount = 34.00
        , lastbuyprice_withTax = 34, meanbuyprice_withTax = 34, lastbuyprice_withDiscountAndTax = 34
                where sellbilldetailid = 284;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (169, '2026-09-18', 50, 34, 34
                    , 34, 34, 34, 34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 34, 34, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 50, 34, 34
                    , 34, 34, 34, 34
                    , 0, 0, 0, 0
                    , 0, 0, 0, 34, 34, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '185', userid = '1', storedetaildate = '2026-09-18 17:38:24' WHERE storedetailid = '169';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('169', '1', '1', '1', '45', 'اضافة فاتورة مبيعات', 'sellbillController.php', '186', '185', '1', '2026-09-18 17:38:24','0','0'); -- id=838
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-261420.375',  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 ('-261470.375','50', '0', '1', 'اضافة فاتورة مبيعات', '45', '-261420.375', '2026-09-18 17:38:24', '1',  'sellbillController.php','1','','0'); -- id=47
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50', '50', '2026-09-18', '1', '0', '0', '2026-09-18 17:38:24','اضافة فاتورة مبيعات رقم 45','1','0',null,'0','45','sellbillController.php?do=showDetail&sellbillid=45'); -- id=557
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('557', '383', '50', '','0'); -- id=557
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-214728.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 ('557', '143', '50', '','0'); -- id=557
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '144470.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 ( '34', '34', '2026-09-18', '1', '0', '0', '2026-09-18 17:38:24','اضافة فاتورة مبيعات رقم 45 - صرف البضاعة من المخزن','1','0',null,'0','45','sellbillController.php?do=showDetail&sellbillid=45'); -- id=558
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('558', '402', '34', '','0'); -- id=558
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '136673.64', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('558', '382', '34', '','0'); -- id=558
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2144763.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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='557,0,558' where sellbillid=45;
 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-18', 50, 34, 34
                    , 34, 34, 34, 34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,34, 34, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 50, 34, 34
                    , 34, 34, 34, 34
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,34, 34, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+34
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+34, sellCostMeanBuyPrice = sellCostMeanBuyPrice+34
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+34
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+34
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+34
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 50, 34, 34
                    , 34, 34, 34, 34, 34, 34)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+50, netSellCostBuyPrice = netSellCostBuyPrice+34
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+34
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+34
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+34
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+34
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+34
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+34
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+34;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06aad5ad9c9111 and sellbillId = 45 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:08:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:38:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:38:26', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1494
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:08:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:38:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:38:49', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1495
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:09:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:39:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:39:05', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1496
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:09:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:39:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-18 17:39:22', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php'); -- id=1497
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:09:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:39:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-18 17:39:34', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php?do=show'); -- id=1498
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:09:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:39:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-18 17:39:43', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php?do=show'); -- id=1499
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:09:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:39:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:39:49', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=44'); -- id=1500
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 14:10:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 17:40:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 17:40:05', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1501
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:07:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:37:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:37:17', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1502
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:07:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:37:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:37:27', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1503
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:08:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:38:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:38:47', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1504
UPDATE product SET productName = 'دلايه مفرد لمبه', productDescription = '', productCatId = '25', productBuyPrice = '200.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00348',type ='0', expireDate = '0' , dailyentryId = '427',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '25.00' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='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 = '348';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (348, 1,'2026-09-18 19:39:18',1)
                ON DUPLICATE KEY UPDATE productid = 348, edited = 1, sysdate = '2026-09-18 19:39:18', userid = 1; -- id=374
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:10:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:40:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-18 19:40:54', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productCatController.php'); -- id=1505
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:11:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:41:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:41:17', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1506
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:11:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:41:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:41:46', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1507
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:12:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:42:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:42:11', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1508
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:12:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:42:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:42:38', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1509
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:12:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:42:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:42:52', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1510
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:15:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:45:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:46:00', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1511
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:16:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:46:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:46:36', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1512
UPDATE product SET productName = 'دلايه مفرد لمبه', productDescription = '', productCatId = '25', productBuyPrice = '200.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00348',type ='0', expireDate = '0' , dailyentryId = '427',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '25.00' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='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 = '348';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (348, 1,'2026-09-18 19:46:51',1)
                ON DUPLICATE KEY UPDATE productid = 348, edited = 1, sysdate = '2026-09-18 19:46:51', userid = 1; -- id=374
UPDATE product SET productName = 'دلايه مفرد لمبه', productDescription = '', productCatId = '25', productBuyPrice = '200.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00348',type ='0', expireDate = '0' , dailyentryId = '427',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '25.00' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='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 = '348';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (348, 1,'2026-09-18 19:47:04',1)
                ON DUPLICATE KEY UPDATE productid = 348, edited = 1, sysdate = '2026-09-18 19:47:04', userid = 1; -- id=374
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 19:47:07',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 19:47:07', userid = 1; -- id=469
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 19:47:14',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 19:47:14', userid = 1; -- id=469
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 19:47:21',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 19:47:21', userid = 1; -- id=469
UPDATE productunit SET proUnitBuyPrice  = 1600.00 * productnumber WHERE productid = 396;
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 19:47:22',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 19:47:22', userid = 1; -- id=469
UPDATE productunit SET proUnitBuyPrice  = 1600.00 * productnumber WHERE productid = 396;
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '553',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 1,'2026-09-18 19:47:32',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 1, sysdate = '2026-09-18 19:47:32', userid = 1; -- id=469
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '554',isService = '0',isOptic = '0',lastbuyprice = '1750.00',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750.00',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 1,'2026-09-18 19:47:35',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 1, sysdate = '2026-09-18 19:47:35', userid = 1; -- id=470
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '554',isService = '0',isOptic = '0',lastbuyprice = '1750.00',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750.00',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 1,'2026-09-18 19:47:42',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 1, sysdate = '2026-09-18 19:47:42', userid = 1; -- id=470
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '554',isService = '0',isOptic = '0',lastbuyprice = '1750.00',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750.00',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 1,'2026-09-18 19:47:48',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 1, sysdate = '2026-09-18 19:47:48', userid = 1; -- id=470
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '554',isService = '0',isOptic = '0',lastbuyprice = '1750.00',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750.00',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 1,'2026-09-18 19:47:59',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 1, sysdate = '2026-09-18 19:47:59', userid = 1; -- id=470
UPDATE product SET productName = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '555',isService = '0',isOptic = '0',lastbuyprice = '1350.00',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350.00',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (398, 1,'2026-09-18 19:48:01',1)
                ON DUPLICATE KEY UPDATE productid = 398, edited = 1, sysdate = '2026-09-18 19:48:01', userid = 1; -- id=471
UPDATE product SET productName = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '555',isService = '0',isOptic = '0',lastbuyprice = '1350.00',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350.00',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (398, 1,'2026-09-18 19:48:08',1)
                ON DUPLICATE KEY UPDATE productid = 398, edited = 1, sysdate = '2026-09-18 19:48:08', userid = 1; -- id=471
UPDATE product SET productName = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '555',isService = '0',isOptic = '0',lastbuyprice = '1350.00',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350.00',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (398, 1,'2026-09-18 19:48:20',1)
                ON DUPLICATE KEY UPDATE productid = 398, edited = 1, sysdate = '2026-09-18 19:48:20', userid = 1; -- id=471
UPDATE product SET productName = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '556',isService = '0',isOptic = '0',lastbuyprice = '900.00',lastbuyprice_withDiscount = '900',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (399, 1,'2026-09-18 19:48:25',1)
                ON DUPLICATE KEY UPDATE productid = 399, edited = 1, sysdate = '2026-09-18 19:48:25', userid = 1; -- id=472
UPDATE product SET productName = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '556',isService = '0',isOptic = '0',lastbuyprice = '900.00',lastbuyprice_withDiscount = '900',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (399, 1,'2026-09-18 19:48:35',1)
                ON DUPLICATE KEY UPDATE productid = 399, edited = 1, sysdate = '2026-09-18 19:48:35', userid = 1; -- id=472
UPDATE product SET productName = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '556',isService = '0',isOptic = '0',lastbuyprice = '900.00',lastbuyprice_withDiscount = '900',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (399, 1,'2026-09-18 19:49:01',1)
                ON DUPLICATE KEY UPDATE productid = 399, edited = 1, sysdate = '2026-09-18 19:49:01', userid = 1; -- id=472
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:19:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:49:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:49:02', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1513
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:19:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:49:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-18 19:49:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=1514
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:04', '1', 'executeOperation', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=executeOperation'); -- id=1515
BEGIN;
UPDATE dailyentry SET totalcreditor = '800.00', totaldebtor = '800.00', thedate = '2026-09-16', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-16 19:22:35', entryComment = 'إضافة منتج دلايه مفرد  الكمية 4', fromFlag = '1',related='0',isopeningentry='0',operationId='348',operationDetailLink='productController.php?do=edit&id=348' WHERE id = '427';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '800.00', '800.00', '2026-09-18', '1', '0', '427', '2026-09-18 19:50:05','تم عكس القيد رقم 427 ','1','0','0','0','0',''); -- id=559
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('559', '382', '800.00', '','0'); -- id=559
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2143963.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('559', '121', '800.00', '','0'); -- id=559
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1142552.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 = '25', productBuyPrice = '200.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-09-16', conditions = '2', userId = '1', limitamount = '0', parcode = '00348',type ='0', expireDate = '0' , dailyentryId = '559',isService = '0',isOptic = '0',lastbuyprice = '200.00',lastbuyprice_withDiscount = '200',meanbuyprice = '200.00',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '25.00' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='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 = '348';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (348, 2,'2026-09-18 19:50:05',1)
                ON DUPLICATE KEY UPDATE productid = 348, edited = 2, sysdate = '2026-09-18 19:50:05', userid = 1; -- id=374
DELETE FROM productingredients WHERE productId = '348';
COMMIT;
BEGIN;
UPDATE dailyentry SET totalcreditor = '4800.00', totaldebtor = '4800.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 16:37:24', entryComment = 'إضافة منتج نجفه ليد موديل k27 مستورد  الكمية 3', fromFlag = '1',related='0',isopeningentry='0',operationId='396',operationDetailLink='productController.php?do=edit&id=396' WHERE id = '553';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4800.00', '4800.00', '2026-09-18', '1', '0', '553', '2026-09-18 19:50:06','تم عكس القيد رقم 553 ','1','0','0','0','0',''); -- id=560
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('560', '382', '4800.00', '','0'); -- id=560
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2139163.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('560', '121', '4800.00', '','0'); -- id=560
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1137752.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 = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '2', userId = '1', limitamount = '0', parcode = '00396',type ='0', expireDate = '0' , dailyentryId = '560',isService = '0',isOptic = '0',lastbuyprice = '1600.00',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600.00',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '396';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (396, 2,'2026-09-18 19:50:07',1)
                ON DUPLICATE KEY UPDATE productid = 396, edited = 2, sysdate = '2026-09-18 19:50:07', userid = 1; -- id=469
DELETE FROM productingredients WHERE productId = '396';
COMMIT;
BEGIN;
UPDATE dailyentry SET totalcreditor = '5250.00', totaldebtor = '5250.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 16:37:26', entryComment = 'إضافة منتج نجفه ليد موديل k07 مستورد  الكمية 3', fromFlag = '1',related='0',isopeningentry='0',operationId='397',operationDetailLink='productController.php?do=edit&id=397' WHERE id = '554';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5250.00', '5250.00', '2026-09-18', '1', '0', '554', '2026-09-18 19:50:07','تم عكس القيد رقم 554 ','1','0','0','0','0',''); -- id=561
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('561', '382', '5250.00', '','0'); -- id=561
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2133913.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('561', '121', '5250.00', '','0'); -- id=561
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1132502.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 = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '2', userId = '1', limitamount = '0', parcode = '00397',type ='0', expireDate = '0' , dailyentryId = '561',isService = '0',isOptic = '0',lastbuyprice = '1750.00',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750.00',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '397';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (397, 2,'2026-09-18 19:50:08',1)
                ON DUPLICATE KEY UPDATE productid = 397, edited = 2, sysdate = '2026-09-18 19:50:08', userid = 1; -- id=470
DELETE FROM productingredients WHERE productId = '397';
COMMIT;
BEGIN;
UPDATE dailyentry SET totalcreditor = '13500.00', totaldebtor = '13500.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 16:37:28', entryComment = 'إضافة منتج نجفه ليد موديل 703 مستورد  الكمية 10', fromFlag = '1',related='0',isopeningentry='0',operationId='398',operationDetailLink='productController.php?do=edit&id=398' WHERE id = '555';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13500.00', '13500.00', '2026-09-18', '1', '0', '555', '2026-09-18 19:50:08','تم عكس القيد رقم 555 ','1','0','0','0','0',''); -- id=562
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('562', '382', '13500.00', '','0'); -- id=562
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2120413.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('562', '121', '13500.00', '','0'); -- id=562
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1119002.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 = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '25', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '2', userId = '1', limitamount = '0', parcode = '00398',type ='0', expireDate = '0' , dailyentryId = '562',isService = '0',isOptic = '0',lastbuyprice = '1350.00',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350.00',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '398';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (398, 2,'2026-09-18 19:50:09',1)
                ON DUPLICATE KEY UPDATE productid = 398, edited = 2, sysdate = '2026-09-18 19:50:09', userid = 1; -- id=471
DELETE FROM productingredients WHERE productId = '398';
COMMIT;
BEGIN;
UPDATE dailyentry SET totalcreditor = '900.00', totaldebtor = '900.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 16:37:30', entryComment = 'إضافة منتج نجفه ليد موديل f008 الكمية 1', fromFlag = '1',related='0',isopeningentry='0',operationId='399',operationDetailLink='productController.php?do=edit&id=399' WHERE id = '556';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900.00', '900.00', '2026-09-18', '1', '0', '556', '2026-09-18 19:50:09','تم عكس القيد رقم 556 ','1','0','0','0','0',''); -- id=563
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('563', '382', '900.00', '','0'); -- id=563
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2119513.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('563', '121', '900.00', '','0'); -- id=563
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1118102.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 = 'نجفه ليد موديل f008', productDescription = '', productCatId = '25', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '2', userId = '1', limitamount = '0', parcode = '00399',type ='0', expireDate = '0' , dailyentryId = '563',isService = '0',isOptic = '0',lastbuyprice = '900.00',lastbuyprice_withDiscount = '900',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '399';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (399, 2,'2026-09-18 19:50:10',1)
                ON DUPLICATE KEY UPDATE productid = 399, edited = 2, sysdate = '2026-09-18 19:50:10', userid = 1; -- id=472
DELETE FROM productingredients WHERE productId = '399';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:10', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=sucess'); -- id=1516
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:12', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1517
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1518
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 ('دلايه مفرد لمبه','','16','200','250','250','250','2026-09-18','0','1','0','','0','0','0','0','0','200','200','200','200','200','0','25','0','0','.','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=400
UPDATE product SET productName = 'دلايه مفرد لمبه', productDescription = '', productCatId = '16', productBuyPrice = '200', productSellAllPrice = '250', productSellUnitPrice = '250', productSellHalfPrice = '250', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00400',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 = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',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 = '400';
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', '400', '1.00', '2026-09-18', '1', '0','0040001','250','250','250','200','','0','0','0','0','0','0','0','0','0','0'); -- id=400
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('400', '1', '3', '1', '2026-09-18'); -- id=400
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('400', '1', '3', '0', '400', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-18','0','0'); -- id=839
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (400, 1,'2026-09-18 19:50:16',1)
                ON DUPLICATE KEY UPDATE productid = 400, edited = 1, sysdate = '2026-09-18 19:50:16', userid = 1; -- id=496
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2026-09-18', '1', '0', '0', '2026-09-18 19:50:16','إضافة منتج دلايه مفرد لمبه الكمية 3','1','0','0','0','400','productController.php?do=edit&id=400'); -- id=564
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('564', '382', '600', '','0'); -- id=564
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2120113.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('564', '121', '600', '','0'); -- id=564
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1118702.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 = '16', productBuyPrice = '200.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00400',type ='0', expireDate = '0' , dailyentryId = '564',isService = '0',isOptic = '0',lastbuyprice = '200',lastbuyprice_withDiscount = '200',meanbuyprice = '200',meanbuyprice_withDiscount = '200' , productbuypricereal = '200' , buypricereal_precentage = '0' , buytotal_precentage = '25' , buyhalf_precentage = '0' , buypart_precentage = '0',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 = '400';
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 ('نجفه ليد موديل k27 مستورد ','','16','1600','1850','1950','1850','2026-09-18','0','1','0','','0','0','0','0','0','1600','1600','1600','1600','1600','0','15.63','15.63','21.88','.','0','0','0','1600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1600','1600','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1600','0','0','0','0','0','0','','','0','0','0','0'); -- id=401
UPDATE product SET productName = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1600', productSellAllPrice = '1850', productSellUnitPrice = '1950', productSellHalfPrice = '1850', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00401',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1600',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600' , buypricereal_precentage = '0' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '401';
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', '401', '1.00', '2026-09-18', '1', '0','0040101','1850','1850','1950','1600','','0','0','0','0','0','0','0','0','0','0'); -- id=401
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('401', '1', '3', '1', '2026-09-18'); -- id=401
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('401', '1', '3', '0', '401', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-18','0','0'); -- id=840
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (401, 1,'2026-09-18 19:50:18',1)
                ON DUPLICATE KEY UPDATE productid = 401, edited = 1, sysdate = '2026-09-18 19:50:18', userid = 1; -- id=497
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4800', '4800', '2026-09-18', '1', '0', '0', '2026-09-18 19:50:18','إضافة منتج نجفه ليد موديل k27 مستورد  الكمية 3','1','0','0','0','401','productController.php?do=edit&id=401'); -- id=565
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('565', '382', '4800', '','0'); -- id=565
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2124913.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('565', '121', '4800', '','0'); -- id=565
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1123502.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 = 'نجفه ليد موديل k27 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1600.00', productSellAllPrice = '1850.00', productSellUnitPrice = '1950.00', productSellHalfPrice = '1850.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00401',type ='0', expireDate = '0' , dailyentryId = '565',isService = '0',isOptic = '0',lastbuyprice = '1600',lastbuyprice_withDiscount = '1600',meanbuyprice = '1600',meanbuyprice_withDiscount = '1600' , productbuypricereal = '1600' , buypricereal_precentage = '0' , buytotal_precentage = '15.63' , buyhalf_precentage = '15.63' , buypart_precentage = '21.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1600',meanbuyprice_withTax='1600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '401';
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 ('نجفه ليد موديل k07 مستورد ','','16','1750','1950','2050','1950','2026-09-18','0','1','0','','0','0','0','0','0','1750','1750','1750','1750','1750','0','11.43','11.43','17.14','.','0','0','0','1750','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1750','1750','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1750','0','0','0','0','0','0','','','0','0','0','0'); -- id=402
UPDATE product SET productName = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1750', productSellAllPrice = '1950', productSellUnitPrice = '2050', productSellHalfPrice = '1950', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00402',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1750',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '402';
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', '402', '1.00', '2026-09-18', '1', '0','0040201','1950','1950','2050','1750','','0','0','0','0','0','0','0','0','0','0'); -- id=402
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('402', '1', '3', '1', '2026-09-18'); -- id=402
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('402', '1', '3', '0', '402', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-18','0','0'); -- id=841
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (402, 1,'2026-09-18 19:50:20',1)
                ON DUPLICATE KEY UPDATE productid = 402, edited = 1, sysdate = '2026-09-18 19:50:20', userid = 1; -- id=498
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5250', '5250', '2026-09-18', '1', '0', '0', '2026-09-18 19:50:20','إضافة منتج نجفه ليد موديل k07 مستورد  الكمية 3','1','0','0','0','402','productController.php?do=edit&id=402'); -- id=566
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('566', '382', '5250', '','0'); -- id=566
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2130163.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('566', '121', '5250', '','0'); -- id=566
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1128752.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 = 'نجفه ليد موديل k07 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1750.00', productSellAllPrice = '1950.00', productSellUnitPrice = '2050.00', productSellHalfPrice = '1950.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00402',type ='0', expireDate = '0' , dailyentryId = '566',isService = '0',isOptic = '0',lastbuyprice = '1750',lastbuyprice_withDiscount = '1750',meanbuyprice = '1750',meanbuyprice_withDiscount = '1750' , productbuypricereal = '1750' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '17.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1750',meanbuyprice_withTax='1750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '402';
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 ('نجفه ليد موديل 703 مستورد ','','16','1350','1490','1590','1490','2026-09-18','0','1','0','','0','0','0','0','0','1350','1350','1350','1350','1350','0','10.37','10.37','17.78','.','0','0','0','1350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1350','1350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1350','0','0','0','0','0','0','','','0','0','0','0'); -- id=403
UPDATE product SET productName = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1350', productSellAllPrice = '1490', productSellUnitPrice = '1590', productSellHalfPrice = '1490', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00403',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1350',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350' , buypricereal_precentage = '0' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '403';
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', '403', '1.00', '2026-09-18', '1', '0','0040301','1490','1490','1590','1350','','0','0','0','0','0','0','0','0','0','0'); -- id=403
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('403', '1', '10', '1', '2026-09-18'); -- id=403
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('403', '1', '10', '0', '403', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-18','0','0'); -- id=842
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (403, 1,'2026-09-18 19:50:22',1)
                ON DUPLICATE KEY UPDATE productid = 403, edited = 1, sysdate = '2026-09-18 19:50:22', userid = 1; -- id=499
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13500', '13500', '2026-09-18', '1', '0', '0', '2026-09-18 19:50:22','إضافة منتج نجفه ليد موديل 703 مستورد  الكمية 10','1','0','0','0','403','productController.php?do=edit&id=403'); -- id=567
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('567', '382', '13500', '','0'); -- id=567
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2143663.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('567', '121', '13500', '','0'); -- id=567
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1142252.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 = 'نجفه ليد موديل 703 مستورد ', productDescription = '', productCatId = '16', productBuyPrice = '1350.00', productSellAllPrice = '1490.00', productSellUnitPrice = '1590.00', productSellHalfPrice = '1490.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00403',type ='0', expireDate = '0' , dailyentryId = '567',isService = '0',isOptic = '0',lastbuyprice = '1350',lastbuyprice_withDiscount = '1350',meanbuyprice = '1350',meanbuyprice_withDiscount = '1350' , productbuypricereal = '1350' , buypricereal_precentage = '0' , buytotal_precentage = '10.37' , buyhalf_precentage = '10.37' , buypart_precentage = '17.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1350',meanbuyprice_withTax='1350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '403';
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 ('نجفه ليد موديل f008','','16','900','1050','1150','1050','2026-09-18','0','1','0','','0','0','0','0','0','900','900','900','900','900','0','16.67','16.67','27.78','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','900','0','0','0','0','0','0','','','0','0','0','0'); -- id=404
UPDATE product SET productName = 'نجفه ليد موديل f008', productDescription = '', productCatId = '16', productBuyPrice = '900', productSellAllPrice = '1050', productSellUnitPrice = '1150', productSellHalfPrice = '1050', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00404',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '404';
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', '404', '1.00', '2026-09-18', '1', '0','0040401','1050','1050','1150','900','','0','0','0','0','0','0','0','0','0','0'); -- id=404
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('404', '1', '1', '1', '2026-09-18'); -- id=404
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('404', '1', '1', '0', '404', 'إضافة منتج', 'productController.php', '0', '1', '1', '2026-09-18','0','0'); -- id=843
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (404, 1,'2026-09-18 19:50:25',1)
                ON DUPLICATE KEY UPDATE productid = 404, edited = 1, sysdate = '2026-09-18 19:50:25', userid = 1; -- id=500
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '900', '900', '2026-09-18', '1', '0', '0', '2026-09-18 19:50:25','إضافة منتج نجفه ليد موديل f008 الكمية 1','1','0','0','0','404','productController.php?do=edit&id=404'); -- id=568
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('568', '382', '900', '','0'); -- id=568
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2144563.93', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ('568', '121', '900', '','0'); -- id=568
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1143152.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 = 'نجفه ليد موديل f008', productDescription = '', productCatId = '16', productBuyPrice = '900.00', productSellAllPrice = '1050.00', productSellUnitPrice = '1150.00', productSellHalfPrice = '1050.00', productDate = '2026-09-18', conditions = '0', userId = '1', limitamount = '0', parcode = '00404',type ='0', expireDate = '0' , dailyentryId = '568',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '16.67' , buyhalf_precentage = '16.67' , buypart_precentage = '27.78',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '404';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:27', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1519
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:47', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1520
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:20:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:50:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:50:54', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1521
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:21:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:51:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 19:51:31', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1522
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:21:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:51:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-18 19:51:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=1523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 16:22:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 19:52:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 19:52:07', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1524
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 17:23:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 20:53:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 20:53:04', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1525

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06aad7a487eb91
-- ----------------------------------------------------------------------------------------------------

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-18 20:53:04', '06aad7a487eb91', '1', '0.00', '0', '0', '1', '115.00', '115', '115', '0', '1', '2026-09-18 20:53:04', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','115','0','','0','0','115','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-18','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=46
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','اضافة فاتورة مبيعات','46', '0', '2026-09-18 20:53:05', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '115', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-18 20:53:04','0','0','',''); -- id=73
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('107.52','00184', '46', '20', '184', '1', '115', '115', '0', '', '1', '2026-09-18 20:53:05', '184', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','115','115','0','','0','0.00','0','0','0','0'); -- id=285
UPDATE sellbilldetail SET  lastbuyprice = 107.52 , meanbuyprice = 107.52, lastbuyprice_withDiscount = 107.52, meanbuyprice_withDiscount = 107.52
        , lastbuyprice_withTax = 107.52, meanbuyprice_withTax = 107.52, lastbuyprice_withDiscountAndTax = 107.52
                where sellbilldetailid = 285;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (184, '2026-09-18', 115, 107.52, 107.52
                    , 107.52, 107.52, 107.52, 107.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 107.52, 107.52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+115, sellCostBuyPrice =sellCostBuyPrice+107.52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+107.52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+107.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+107.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+107.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+107.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+107.52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+107.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+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-18', 115, 107.52, 107.52
                    , 107.52, 107.52, 107.52, 107.52
                    , 0, 0, 0, 0
                    , 0, 0, 0, 107.52, 107.52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+115, sellCostBuyPrice =sellCostBuyPrice+107.52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+107.52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+107.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+107.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+107.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+107.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+107.52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+107.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 = '207', userid = '1', storedetaildate = '2026-09-18 20:53:05' WHERE storedetailid = '184';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('184', '1', '1', '1', '46', 'اضافة فاتورة مبيعات', 'sellbillController.php', '208', '207', '1', '2026-09-18 20:53:05','0','0'); -- id=844
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-261305.375',  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 ('-261420.375','115', '0', '1', 'اضافة فاتورة مبيعات', '46', '-261305.375', '2026-09-18 20:53:05', '1',  'sellbillController.php','1','','0'); -- id=48
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '115', '115', '2026-09-18', '1', '0', '0', '2026-09-18 20:53:06','اضافة فاتورة مبيعات رقم 46','1','0',null,'0','46','sellbillController.php?do=showDetail&sellbillid=46'); -- id=569
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('569', '383', '115', '','0'); -- id=569
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-214613.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 ('569', '143', '115', '','0'); -- id=569
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '144585.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 ( '107.52', '107.52', '2026-09-18', '1', '0', '0', '2026-09-18 20:53:06','اضافة فاتورة مبيعات رقم 46 - صرف البضاعة من المخزن','1','0',null,'0','46','sellbillController.php?do=showDetail&sellbillid=46'); -- id=570
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('570', '402', '107.52', '','0'); -- id=570
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '136781.16', 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 ('570', '382', '107.52', '','0'); -- id=570
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2144456.41', theOrder = '0', layingOrder = '120202', reportid = '1', 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='569,0,570' where sellbillid=46;
 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-18', 115, 107.52, 107.52
                    , 107.52, 107.52, 107.52, 107.52
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,107.52, 107.52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+115, sellCostBuyPrice =sellCostBuyPrice+107.52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+107.52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+107.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+107.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+107.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+107.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+107.52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+107.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;
 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-18', 115, 107.52, 107.52
                    , 107.52, 107.52, 107.52, 107.52
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,107.52, 107.52, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+115, sellCostBuyPrice =sellCostBuyPrice+107.52
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+107.52, sellCostMeanBuyPrice = sellCostMeanBuyPrice+107.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+107.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+107.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+107.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+107.52
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+107.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 115, 107.52, 107.52
                    , 107.52, 107.52, 107.52, 107.52, 107.52, 107.52)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+115, netSellCostBuyPrice = netSellCostBuyPrice+107.52
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+107.52
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+107.52
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+107.52
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+107.52
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+107.52
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+107.52
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+107.52;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06aad7a487eb91 and sellbillId = 46 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 17:23:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 20:53:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 20:53:07', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1526
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:24:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:54:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:54:18', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1527
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:24:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:54:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:54:26', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1528
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:24:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:54:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:54:51', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=43'); -- id=1529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:28:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:58:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:58:59', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1530
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 43;
UPDATE sellbill SET  sellbillsysdate = '2026-09-18 22:59:00', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '43';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-292 where id = 9;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-198 where id = 11;
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 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-18', 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-18', 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 = '1942', userid = '1', storedetaildate = '2026-09-18 22:59:00' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '490', '0', '43', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1452', '1942', '1', '2026-09-17 22:44:18','0','0'); -- id=845
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-492 where id = 12;
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-18', 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-18', 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 = '862', userid = '1', storedetaildate = '2026-09-18 22:59:00' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '500', '0', '43', 'تعديل فاتورة مبيعات', 'sellbillController.php', '362', '862', '1', '2026-09-17 22:44:18','0','0'); -- id=846
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-500 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 = 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-18', 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-18', 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 = '2671', userid = '1', storedetaildate = '2026-09-18 22:59:00' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '500', '0', '43', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2171', '2671', '1', '2026-09-17 22:44:18','0','0'); -- id=847
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-240 where id = 14;
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-18', 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-18', 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 = '722', userid = '1', storedetaildate = '2026-09-18 22:59:00' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '240', '0', '43', 'تعديل فاتورة مبيعات', 'sellbillController.php', '482', '722', '1', '2026-09-17 22:44:18','0','0'); -- id=848
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-220 where id = 13;
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-18', 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-18', 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 = '627', userid = '1', storedetaildate = '2026-09-18 22:59:00' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '220', '0', '43', 'تعديل فاتورة مبيعات', 'sellbillController.php', '407', '627', '1', '2026-09-17 22:44:18','0','0'); -- id=849
CALL clientInUse(12,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '700', 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','24995.00','24295.00','1','تعديل فاتورة مبيعات','43', '700', '2026-09-17 22:44:18', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '24295', '0', null, '0', null, null,'', '0','1','1','24295','1','2026-09-17 22:44:18','0','0','',''); -- id=74
UPDATE client SET  inUse = 0 where clientid = 12;
 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-18', 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-18', 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;

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


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

COMMIT;
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,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 22:44:18', '06aac5080e769d', '12', '700.00', '29900', '0', '1', '29200', '29200', '0', '29200', '1', '2026-09-17 22:44:18', '', '1', '0', 'بيتر', '1', '1', '3', '0', '12 - بيتر', '2340', '43', 'sellbillController', '0','','','','','-1','0','0','0','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=47
UPDATE client SET  clientdebt = '29900', 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','29200','0','اضافة فاتورة مبيعات (معدله)','47', '29900', '2026-09-18 22:59:01', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '29200', '0', null, '0', null, null,'', '0','1','1','24295','1','2026-09-17 22:44:18','0','0','',''); -- id=75
UPDATE client SET  inUse = 0 where clientid = 12;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+292 where id = 9;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+288 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', '47', '3', '102', '580', '12', '6960', '0', '', '1', '2026-09-18 22:59:02', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','9-292,11-288,','1','1','0','0','12','6960','0','','0','0.00','0','0','0','0'); -- id=286
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 = 286;
 INSERT INTO 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-18', 6960, 6815, 6815
                    , 6815, 6815, 6815, 6815
                    , 0, 0, 0, 0
                    , 0, 0, 0, 580, 0, 6815, 6815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6960, sellCostBuyPrice =sellCostBuyPrice+6815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6815
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6815
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+580
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 6960, 6815, 6815
                    , 6815, 6815, 6815, 6815
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6815, 6815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6960, sellCostBuyPrice =sellCostBuyPrice+6815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6815, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6815
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6815
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1362', userid = '1', storedetaildate = '2026-09-18 22:59:02' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '580', '1', '47', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1942', '1362', '1', '2026-09-18 22:59:02','0','0'); -- id=850
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', '47', '3', '105', '600', '15', '9000', '0', '', '1', '2026-09-18 22:59:02', '105', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','12-492,','1','1','0','0','15','9000','0','','0','0.00','0','0','0','0'); -- id=287
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 = 287;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+600
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '262', userid = '1', storedetaildate = '2026-09-18 22:59:02' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '600', '1', '47', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '862', '262', '1', '2026-09-18 22:59:02','0','0'); -- id=851
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+600 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', '47', '3', '103', '600', '5.5', '3300', '0', '', '1', '2026-09-18 22:59:02', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-600,','1','1','0','0','5.5','3300','0','','0','0.00','0','0','0','0'); -- id=288
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 = 288;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+600
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2071', userid = '1', storedetaildate = '2026-09-18 22:59:03' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '600', '1', '47', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2671', '2071', '1', '2026-09-18 22:59:03','0','0'); -- id=852
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+294 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', '47', '3', '101', '300', '17.75', '5325', '0', '', '1', '2026-09-18 22:59:03', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','14-294,','1','1','0','0','17.75','5325','0','','0','0.00','0','0','0','0'); -- id=289
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 = 289;
 INSERT INTO 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-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+300
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '422', userid = '1', storedetaildate = '2026-09-18 22:59:03' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '300', '1', '47', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '722', '422', '1', '2026-09-18 22:59:03','0','0'); -- id=853
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+260 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', '47', '3', '100', '260', '17.75', '4615', '0', '', '1', '2026-09-18 22:59:03', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','13-260,','1','1','0','0','17.75','4615','0','','0','0.00','0','0','0','0'); -- id=290
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 = 290;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4615, sellCostBuyPrice =sellCostBuyPrice+4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4576
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+260
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4615, sellCostBuyPrice =sellCostBuyPrice+4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4576
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '367', userid = '1', storedetaildate = '2026-09-18 22:59:03' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '260', '1', '47', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '627', '367', '1', '2026-09-18 22:59:03','0','0'); -- id=854
UPDATE dailyentry SET totalcreditor = '24295.00', totaldebtor = '24295.00', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 22:44:21', entryComment = 'اضافة فاتورة مبيعات رقم 43', fromFlag = '1',related='0',isopeningentry='0',operationId='43',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=43' WHERE id = '546';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '24295.00', '24295.00', '2026-09-18', '1', '0', '546', '2026-09-18 22:59:04','تم عكس القيد رقم 546 ','1','0','0','0','0',''); -- id=571
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('571', '439', '24295.00', '','0'); -- id=571
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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('571', '143', '24295.00', '','0'); -- id=571
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '120290.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';
UPDATE dailyentry SET totalcreditor = '23603.50', totaldebtor = '23603.50', thedate = '2026-09-17', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-17 22:44:21', entryComment = 'اضافة فاتورة مبيعات رقم 43 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='43',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=43' WHERE id = '547';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23603.50', '23603.50', '2026-09-18', '1', '0', '547', '2026-09-18 22:59:04','تم عكس القيد رقم 547 ','1','0','0','0','0',''); -- id=572
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('572', '402', '23603.50', '','0'); -- id=572
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '113177.66', 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 ('572', '382', '23603.50', '','0'); -- id=572
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2168059.91', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '29200', '29200', '2026-09-18', '1', '0', '0', '2026-09-18 22:59:05','اضافة فاتورة مبيعات رقم 47','1','0',null,'0','47','sellbillController.php?do=showDetail&sellbillid=47'); -- id=573
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('573', '439', '29200', '','0'); -- id=573
UPDATE accountstree SET name = 'بيتر', customName = 'بيتر', customNameEn = 'بيتر', nameEn = 'بيتر', parent = '58', accountNature = '0', theValue = '29900', 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 ('573', '143', '29200', '','0'); -- id=573
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '149490.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 ( '28371', '28371', '2026-09-18', '1', '0', '0', '2026-09-18 22:59:05','اضافة فاتورة مبيعات رقم 47 - صرف البضاعة من المخزن','1','0',null,'0','47','sellbillController.php?do=showDetail&sellbillid=47'); -- id=574
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('574', '402', '28371', '','0'); -- id=574
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '141548.66', 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 ('574', '382', '28371', '','0'); -- id=574
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2139688.91', theOrder = '0', layingOrder = '120202', reportid = '1', 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='573,0,574' where sellbillid=47;
 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-18', 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28371, 28371, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29200, sellCostBuyPrice =sellCostBuyPrice+28371
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28371, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28371
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28371, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28371
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28371
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28371
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28371
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-18', 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28371, 28371, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29200, sellCostBuyPrice =sellCostBuyPrice+28371
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28371, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28371
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28371, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28371
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28371
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28371
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28371
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371, 28371, 28371)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+29200, netSellCostBuyPrice = netSellCostBuyPrice+28371
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+28371
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+28371
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+28371
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+28371
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+28371
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+28371
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28371;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 43 and newid=47 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:29:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:59:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:59:06', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=47'); -- id=1531
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:29:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:59:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:59:44', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1532
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:29:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:59:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:59:50', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=1533
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:29:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 22:59:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 22:59:56', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=47'); -- id=1534
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:30:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:00:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 23:00:09', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=1535
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 47;
UPDATE sellbill SET  sellbillsysdate = '2026-09-18 23:00:10', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '47';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-292 where id = 9;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-288 where id = 11;
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 286;
 INSERT INTO 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-18', 6960, 6815, 6815
                    , 6815, 6815, 6815, 6815
                    , 0, 0, 0, 0
                    , 0, 0, 0,580,0, 6815, 6815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6960, sellCostBuyPrice =sellCostBuyPrice-6815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6815, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6815
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6815
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-580
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO 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-18', 6960, 6815, 6815
                    , 6815, 6815, 6815, 6815
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6815, 6815, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6960, sellCostBuyPrice =sellCostBuyPrice-6815
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6815, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6815
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6815, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6815
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6815
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6815
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6815
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-18 23:00:10' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '580', '0', '47', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1362', '1942', '1', '2026-09-17 22:44:18','0','0'); -- id=855
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-492 where id = 12;
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 = 287;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0,600,0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-600
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-18 23:00:10' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '600', '0', '47', 'تعديل فاتورة مبيعات', 'sellbillController.php', '262', '862', '1', '2026-09-17 22:44:18','0','0'); -- id=856
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-600 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 = 288;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0,600,0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3300, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-600
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3300, sellCostBuyPrice =sellCostBuyPrice-2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '2671', userid = '1', storedetaildate = '2026-09-18 23:00:10' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '600', '0', '47', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2071', '2671', '1', '2026-09-17 22:44:18','0','0'); -- id=857
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-294 where id = 14;
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 = 289;
 INSERT INTO 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-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0,300,0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5325, sellCostBuyPrice =sellCostBuyPrice-5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5280
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-300
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5325, sellCostBuyPrice =sellCostBuyPrice-5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5280
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '722', userid = '1', storedetaildate = '2026-09-18 23:00:10' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '300', '0', '47', 'تعديل فاتورة مبيعات', 'sellbillController.php', '422', '722', '1', '2026-09-17 22:44:18','0','0'); -- id=858
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-260 where id = 13;
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 = 290;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0,260,0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4615, sellCostBuyPrice =sellCostBuyPrice-4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4576
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-260
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4615, sellCostBuyPrice =sellCostBuyPrice-4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4576
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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-18 23:00:11' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '260', '0', '47', 'تعديل فاتورة مبيعات', 'sellbillController.php', '367', '627', '1', '2026-09-17 22:44:18','0','0'); -- id=859
CALL clientInUse(12,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '700', 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','29900.00','29200.00','1','تعديل فاتورة مبيعات','47', '700', '2026-09-17 22:44:18', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '29200', '0', null, '0', null, null,'', '0','1','1','29200','1','2026-09-17 22:44:18','0','0','',''); -- id=76
UPDATE client SET  inUse = 0 where clientid = 12;
 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-18', 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28371, 28371, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-29200, sellCostBuyPrice =sellCostBuyPrice-28371
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28371, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28371
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28371, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28371
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28371
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28371
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28371
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-18', 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28371, 28371, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-29200, sellCostBuyPrice =sellCostBuyPrice-28371
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28371, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28371
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28371, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28371
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28371
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28371
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28371
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 29200, 28371, 28371
                    , 28371, 28371, 28371, 28371, 28371, 28371)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-29200, netSellCostBuyPrice = netSellCostBuyPrice-28371
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-28371
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-28371
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-28371
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-28371
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-28371
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-28371
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-28371;

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


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

COMMIT;
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,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 22:44:18', '06aac5080e769d', '12', '700.00', '30020', '0', '1', '29320', '29320', '0', '29320', '1', '2026-09-17 22:44:18', '', '1', '0', 'بيتر', '1', '1', '3', '0', '12 - بيتر', '2350', '47', 'sellbillController', '0','','','','','-1','0','0','0','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=48
UPDATE client SET  clientdebt = '30020', 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','29320','0','اضافة فاتورة مبيعات (معدله)','48', '30020', '2026-09-18 23:00:12', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '29320', '0', null, '0', null, null,'', '0','1','1','29200','1','2026-09-17 22:44:18','0','0','',''); -- id=77
UPDATE client SET  inUse = 0 where clientid = 12;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+292 where id = 9;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+298 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', '48', '3', '102', '590', '12', '7080', '0', '', '1', '2026-09-18 23:00:12', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','9-292,11-298,','1','1','0','0','12','7080','0','','0','0.00','0','0','0','0'); -- id=291
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 = 291;
 INSERT INTO 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-18', 7080, 6932.5, 6932.5
                    , 6932.5, 6932.5, 6932.5, 6932.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 590, 0, 6932.5, 6932.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7080, sellCostBuyPrice =sellCostBuyPrice+6932.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6932.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6932.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6932.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6932.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6932.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6932.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6932.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+590
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 7080, 6932.5, 6932.5
                    , 6932.5, 6932.5, 6932.5, 6932.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6932.5, 6932.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7080, sellCostBuyPrice =sellCostBuyPrice+6932.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6932.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6932.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6932.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6932.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6932.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6932.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6932.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 = '1352', userid = '1', storedetaildate = '2026-09-18 23:00:12' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '590', '1', '48', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1942', '1352', '1', '2026-09-18 23:00:12','0','0'); -- id=860
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', '48', '3', '105', '600.00', '15', '9000', '0', '', '1', '2026-09-18 23:00:12', '105', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','12-492,','1','1','0','0','15','9000','0','','0','0.00','0','0','0','0'); -- id=292
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 = 292;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+600
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 9000, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '262', userid = '1', storedetaildate = '2026-09-18 23:00:12' WHERE storedetailid = '105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('105', '1', '600', '1', '48', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '862', '262', '1', '2026-09-18 23:00:12','0','0'); -- id=861
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+600 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', '48', '3', '103', '600.00', '5.5', '3300', '0', '', '1', '2026-09-18 23:00:12', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-600,','1','1','0','0','5.5','3300','0','','0','0.00','0','0','0','0'); -- id=293
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 = 293;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 600, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+600
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 3300, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2071', userid = '1', storedetaildate = '2026-09-18 23:00:13' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '600', '1', '48', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '2671', '2071', '1', '2026-09-18 23:00:13','0','0'); -- id=862
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+294 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', '48', '3', '101', '300.00', '17.75', '5325', '0', '', '1', '2026-09-18 23:00:13', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','14-294,','1','1','0','0','17.75','5325','0','','0','0.00','0','0','0','0'); -- id=294
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 = 294;
 INSERT INTO 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-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+300
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-18', 5325, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5325, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '422', userid = '1', storedetaildate = '2026-09-18 23:00:13' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '300', '1', '48', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '722', '422', '1', '2026-09-18 23:00:13','0','0'); -- id=863
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+260 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', '48', '3', '100', '260.00', '17.75', '4615', '0', '', '1', '2026-09-18 23:00:13', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','13-260,','1','1','0','0','17.75','4615','0','','0','0.00','0','0','0','0'); -- id=295
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 = 295;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4615, sellCostBuyPrice =sellCostBuyPrice+4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4576
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+260
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-18', 4615, 4576, 4576
                    , 4576, 4576, 4576, 4576
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4576, 4576, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4615, sellCostBuyPrice =sellCostBuyPrice+4576
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4576, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4576
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4576, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4576
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4576
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4576
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4576
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '367', userid = '1', storedetaildate = '2026-09-18 23:00:13' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '260', '1', '48', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '627', '367', '1', '2026-09-18 23:00:13','0','0'); -- id=864
UPDATE dailyentry SET totalcreditor = '29200.00', totaldebtor = '29200.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 22:59:05', entryComment = 'اضافة فاتورة مبيعات رقم 47', fromFlag = '1',related='0',isopeningentry='0',operationId='47',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=47' WHERE id = '573';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29200.00', '29200.00', '2026-09-18', '1', '0', '573', '2026-09-18 23:00:13','تم عكس القيد رقم 573 ','1','0','0','0','0',''); -- id=575
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('575', '439', '29200.00', '','0'); -- id=575
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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('575', '143', '29200.00', '','0'); -- id=575
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '120290.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';
UPDATE dailyentry SET totalcreditor = '28371.00', totaldebtor = '28371.00', thedate = '2026-09-18', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-18 22:59:05', entryComment = 'اضافة فاتورة مبيعات رقم 47 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='47',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=47' WHERE id = '574';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28371.00', '28371.00', '2026-09-18', '1', '0', '574', '2026-09-18 23:00:14','تم عكس القيد رقم 574 ','1','0','0','0','0',''); -- id=576
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('576', '402', '28371.00', '','0'); -- id=576
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '113177.66', 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 ('576', '382', '28371.00', '','0'); -- id=576
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2168059.91', theOrder = '0', layingOrder = '120202', reportid = '1', 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 ( '29320', '29320', '2026-09-18', '1', '0', '0', '2026-09-18 23:00:14','اضافة فاتورة مبيعات رقم 48','1','0',null,'0','48','sellbillController.php?do=showDetail&sellbillid=48'); -- id=577
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('577', '439', '29320', '','0'); -- id=577
UPDATE accountstree SET name = 'بيتر', customName = 'بيتر', customNameEn = 'بيتر', nameEn = 'بيتر', parent = '58', accountNature = '0', theValue = '30020', 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 ('577', '143', '29320', '','0'); -- id=577
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '149610.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 ( '28488.5', '28488.5', '2026-09-18', '1', '0', '0', '2026-09-18 23:00:14','اضافة فاتورة مبيعات رقم 48 - صرف البضاعة من المخزن','1','0',null,'0','48','sellbillController.php?do=showDetail&sellbillid=48'); -- id=578
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('578', '402', '28488.5', '','0'); -- id=578
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '141666.16', 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 ('578', '382', '28488.5', '','0'); -- id=578
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2139571.41', theOrder = '0', layingOrder = '120202', reportid = '1', 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='577,0,578' where sellbillid=48;
 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-18', 29320, 28488.5, 28488.5
                    , 28488.5, 28488.5, 28488.5, 28488.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28488.5, 28488.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29320, sellCostBuyPrice =sellCostBuyPrice+28488.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28488.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28488.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28488.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28488.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.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-18', 29320, 28488.5, 28488.5
                    , 28488.5, 28488.5, 28488.5, 28488.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28488.5, 28488.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29320, sellCostBuyPrice =sellCostBuyPrice+28488.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28488.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28488.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28488.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28488.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.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, 29320, 28488.5, 28488.5
                    , 28488.5, 28488.5, 28488.5, 28488.5, 28488.5, 28488.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+29320, netSellCostBuyPrice = netSellCostBuyPrice+28488.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+28488.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+28488.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+28488.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+28488.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+28488.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+28488.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28488.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 47 and newid=48 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:30:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:00:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-18 23:00:16', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=48'); -- id=1536
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:30:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:00:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:00:40', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=1537
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:01', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=1538

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =78
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(12,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-09-18 23:01:01', userid = '1' WHERE clientid = '12';
UPDATE client SET  inUse = 0 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','30020.00','30020','1','ايصال تحصيل (( قبض من عميل ))','78', '0', '2026-09-18 23:00:41', '1', 'clientPayedDeptController.php', '   ', '30020', '0', null, '0', null, null,'', '-1','1','1','30020','1','','5','0','','.'); -- id=78
UPDATE save SET  savecurrentvalue = '-231285.38',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-261305.38','30020', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '78', '-231285.38', '2026-09-18 23:01:01', '1',  'clientPayedDeptController.php','12','','0'); -- id=49
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30020', '30020', '2026-09-18', '1', '0', '0', '2026-09-18 23:01:01','اضافة ايصال سداد للعميل بيتر','1','0','0','0','78','clientPayedDeptController.php?do=show&id=78'); -- id=579
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('579', '383', '30020', '','0'); -- id=579
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-184593.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 ('579', '439', '30020', '','0'); -- id=579
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-17 09:25:00' WHERE id = '439';
UPDATE clientdebtchange SET clientid = '12', clientdebtchangebefore = '30020.000', clientdebtchangeamount = '30020.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '78', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-09-18 23:00:41', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '30020.000',discount='', reciptid='0', dailyentryid = '579',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='30020',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '78';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:02', '1', 'editprint2', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=editprint2&id=%2078'); -- id=1539
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-18 23:01:17', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=1540
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-18 23:01:18', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=1541
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=1542
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:54', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=1543

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =79
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(14,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-09-18 23:01:54', userid = '1' WHERE clientid = '14';
UPDATE client SET  inUse = 0 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','4510.25','4510.25','1','ايصال تحصيل (( قبض من عميل ))','79', '0', '2026-09-18 23:01:35', '1', 'clientPayedDeptController.php', '   ', '4510.25', '0', null, '0', null, null,'', '-1','1','1','4510.25','1','','6','0','','.'); -- id=79
UPDATE save SET  savecurrentvalue = '-226775.13',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-231285.38','4510.25', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '79', '-226775.13', '2026-09-18 23:01:54', '1',  'clientPayedDeptController.php','14','','0'); -- id=50
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4510.25', '4510.25', '2026-09-18', '1', '0', '0', '2026-09-18 23:01:54','اضافة ايصال سداد للعميل حماده الشاذلي ','1','0','0','0','79','clientPayedDeptController.php?do=show&id=79'); -- id=580
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('580', '383', '4510.25', '','0'); -- id=580
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-180083.13', 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 ('580', '442', '4510.25', '','0'); -- id=580
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-17 21:11:51' WHERE id = '442';
UPDATE clientdebtchange SET clientid = '14', clientdebtchangebefore = '4510.250', clientdebtchangeamount = '4510.250', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '79', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-09-18 23:01:35', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4510.250',discount='', reciptid='0', dailyentryid = '580',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4510.25',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '79';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:55', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=1544
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:31:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:01:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-18 23:01:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=1545
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:35:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:05:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-18 23:05:06', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=1546
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-18 19:35:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-18 23:05:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-18 23:05:27', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php?do=show'); -- id=1547
