UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:41:44";
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-23 08:42:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:12:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-23 12:12:01', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=2097
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-23',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-23 08:42:08";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-23 12:12:08', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2098
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:42:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:12:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('settlementstoreController.php', '2026-09-23 12:12:14', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/settlementstoreController.php?do=show'); -- id=2099
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:42:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:12:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 12:12:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2100
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('محمود شلبي' , '', '', '', '0', '', '0', '2026-09-23 12:12:38', '1', '0','','0','','-10','0','10000',',','-1','0','.','0','0','.','2026-09-23','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=34
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('34', '0', '0', '', ''); -- id=34
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 ('34','0','0','0','إضافة عميل جديد','34', '0', '2026-09-23 12:12:38', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=173
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('محمود شلبي', 'محمود شلبي', 'محمود شلبي', 'محمود شلبي', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-23 12:12:39'); -- id=465
UPDATE client SET clientname = 'محمود شلبي', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-23', userid = '1'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='465',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '34';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:43:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:13:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 12:13:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:43:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:13:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 12:13:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2102
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('لمبه 100 وات صيني ','','2','12.5','13.5','13.5','13.5','2026-09-23','0','1','0','','0','0','0','0','0','12.5','12.5','12.5','12.5','12.5','0','8','8','8','.','0','0','0','12.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','12.5','12.5','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','12.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=438
UPDATE product SET productName = 'لمبه 100 وات صيني ', productDescription = '', productCatId = '2', productBuyPrice = '12.5', productSellAllPrice = '13.5', productSellUnitPrice = '13.5', productSellHalfPrice = '13.5', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00438',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '12.5',lastbuyprice_withDiscount = '12.5',meanbuyprice = '12.5',meanbuyprice_withDiscount = '12.5' , productbuypricereal = '12.5' , buypricereal_precentage = '0' , buytotal_precentage = '8' , buyhalf_precentage = '8' , buypart_precentage = '8',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='12.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='12.5',meanbuyprice_withTax='12.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='12.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '438';
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', '438', '1.00', '2026-09-23', '1', '0','0043801','13.5','13.5','13.5','12.5','','0','0','0','0','0','0','0','0','0','0'); -- id=438
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('438', '1', '30', '1', '2026-09-23'); -- id=438
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('438', '1', '30', '0', '438', 'إضافة منتج', 'productController.php', '0', '30', '1', '2026-09-23','0','0'); -- id=1437
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (438, 1,'2026-09-23 12:14:00',1)
                ON DUPLICATE KEY UPDATE productid = 438, edited = 1, sysdate = '2026-09-23 12:14:00', userid = 1; -- id=555
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '375', '375', '2026-09-23', '1', '0', '0', '2026-09-23 12:14:00','إضافة منتج لمبه 100 وات صيني  الكمية 30','1','0','0','0','438','productController.php?do=edit&id=438'); -- id=788
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('788', '382', '375', '','0'); -- id=788
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2121910.45', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('788', '121', '375', '','0'); -- id=788
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1211469.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 = 'لمبه 100 وات صيني ', productDescription = '', productCatId = '2', productBuyPrice = '12.50', productSellAllPrice = '13.50', productSellUnitPrice = '13.50', productSellHalfPrice = '13.50', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00438',type ='0', expireDate = '0' , dailyentryId = '788',isService = '0',isOptic = '0',lastbuyprice = '12.5',lastbuyprice_withDiscount = '12.5',meanbuyprice = '12.5',meanbuyprice_withDiscount = '12.5' , productbuypricereal = '12.5' , buypricereal_precentage = '0' , buytotal_precentage = '8' , buyhalf_precentage = '8' , buypart_precentage = '8',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='12.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='12.5',meanbuyprice_withTax='12.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='12.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '438';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:44:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:14:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 12:14:03', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2103
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:45:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:15:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 12:15:56', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2104

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3a6059432d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(34,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-23 12:15:57', '06ab3a6059432d', '34', '0.00', '7178', '0', '1', '7178.00', '7178', '0', '7178', '1', '2026-09-23 12:15:57', '', '1', '0', 'محمود شلبي', '1', '1', '3', '0', 'محمود شلبي', '223' ,'0','','','','','-1','0','0','0','0','0','7178','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=101
UPDATE client SET  clientdebt = '7178', userid = '1' WHERE clientid = '34';
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 ('34','0.00','7178','0','اضافة فاتورة مبيعات','101', '7178', '2026-09-23 12:15:58', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7178', '0', null, '0', null, null,'', '0','1','1','7178','1','2026-09-23 12:15:57','0','0','',''); -- id=174
UPDATE client SET  inUse = 0 where clientid = 34;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 45;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('332','00070', '101', '12', '70', '10', '380', '3800', '0', '', '0', '2026-09-23 12:15:58', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','45-10,','1','1','0','0','380','3800','0','','0','0.00','0','0','0','0'); -- id=662
UPDATE sellbilldetail SET  lastbuyprice = 332.00 , meanbuyprice = 321.76, lastbuyprice_withDiscount = 332.00, meanbuyprice_withDiscount = 321.76
        , lastbuyprice_withTax = 332, meanbuyprice_withTax = 321.76, lastbuyprice_withDiscountAndTax = 332
                where sellbilldetailid = 662;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (70, '2026-09-23', 3800, 3320, 3320
                    , 3217.6, 3320, 3217.6, 3320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3320, 3217.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3800, sellCostBuyPrice =sellCostBuyPrice+3320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3217.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3217.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3217.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+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-23', 3800, 3320, 3320
                    , 3217.6, 3320, 3217.6, 3320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3320, 3217.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3800, sellCostBuyPrice =sellCostBuyPrice+3320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3217.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3217.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3217.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 = '72', userid = '1', storedetaildate = '2026-09-23 12:15:58' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '10', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '82', '72', '1', '2026-09-23 12:15:58','0','0'); -- id=1438
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('415','00073', '101', '12', '73', '1', '475', '475', '0', '', '0', '2026-09-23 12:15:58', '73', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','46-1,','1','1','0','0','475','475','0','','0','0.00','0','0','0','0'); -- id=663
UPDATE sellbilldetail SET  lastbuyprice = 415.00 , meanbuyprice = 407.05, lastbuyprice_withDiscount = 415.00, meanbuyprice_withDiscount = 407.05
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 407.05, lastbuyprice_withDiscountAndTax = 415
                where sellbilldetailid = 663;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (73, '2026-09-23', 475, 415, 415
                    , 407.05, 415, 407.05, 415
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 415, 407.05, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475, sellCostBuyPrice =sellCostBuyPrice+415
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+415, sellCostMeanBuyPrice = sellCostMeanBuyPrice+407.05
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+415, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+407.05
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+415
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+415
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407.05
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 475, 415, 415
                    , 407.05, 415, 407.05, 415
                    , 0, 0, 0, 0
                    , 0, 0, 0, 415, 407.05, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+475, sellCostBuyPrice =sellCostBuyPrice+415
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+415, sellCostMeanBuyPrice = sellCostMeanBuyPrice+407.05
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+415, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+407.05
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+415
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+415
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+407.05
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2026-09-23 12:15:58' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '1', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '21', '1', '2026-09-23 12:15:58','0','0'); -- id=1439
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 15;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('24.8','00291', '101', '24', '291', '10', '25.8', '258', '0', '', '0', '2026-09-23 12:15:59', '291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','15-10,','1','1','0','0','25.8','258','0','','0','0.00','0','0','0','0'); -- id=664
UPDATE sellbilldetail SET  lastbuyprice = 24.80 , meanbuyprice = 24.80, lastbuyprice_withDiscount = 24.80, meanbuyprice_withDiscount = 24.80
        , lastbuyprice_withTax = 24.8, meanbuyprice_withTax = 24.8, lastbuyprice_withDiscountAndTax = 24.8
                where sellbilldetailid = 664;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (291, '2026-09-23', 258, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 258, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0, 248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+258, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '103', userid = '1', storedetaildate = '2026-09-23 12:15:59' WHERE storedetailid = '291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('291', '1', '10', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '113', '103', '1', '2026-09-23 12:15:59','0','0'); -- id=1440
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '101', '14', '81', '10', '18.5', '185', '0', '', '0', '2026-09-23 12:15:59', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','18.5','185','0','','0','0.00','0','0','0','0'); -- id=665
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 = 665;
 INSERT INTO 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-23', 185, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 185, 180, 180
                    , 180, 180, 180, 180
                    , 0, 0, 0, 0
                    , 0, 0, 0, 180, 180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185, sellCostBuyPrice =sellCostBuyPrice+180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+180, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+180
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '601', userid = '1', storedetaildate = '2026-09-23 12:15:59' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '10', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '611', '601', '1', '2026-09-23 12:15:59','0','0'); -- id=1441
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('12.5','00438', '101', '2', '438', '20', '13.5', '270', '0', '', '0', '2026-09-23 12:15:59', '438', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','13.5','270','0','','0','0.00','0','0','0','0'); -- id=666
UPDATE sellbilldetail SET  lastbuyprice = 12.50 , meanbuyprice = 12.50, lastbuyprice_withDiscount = 12.50, meanbuyprice_withDiscount = 12.50
        , lastbuyprice_withTax = 12.5, meanbuyprice_withTax = 12.5, lastbuyprice_withDiscountAndTax = 12.5
                where sellbilldetailid = 666;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (438, '2026-09-23', 270, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 270, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+270, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-23 12:16:00' WHERE storedetailid = '438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('438', '1', '20', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '10', '1', '2026-09-23 12:16:00','0','0'); -- id=1442
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('26.25','00240', '101', '2', '240', '20', '27', '540', '0', '', '0', '2026-09-23 12:16:00', '240', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','27','540','0','','0','0.00','0','0','0','0'); -- id=667
UPDATE sellbilldetail SET  lastbuyprice = 26.25 , meanbuyprice = 26.25, lastbuyprice_withDiscount = 26.25, meanbuyprice_withDiscount = 26.25
        , lastbuyprice_withTax = 26.25, meanbuyprice_withTax = 26.25, lastbuyprice_withDiscountAndTax = 26.25
                where sellbilldetailid = 667;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (240, '2026-09-23', 540, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 540, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '255', userid = '1', storedetaildate = '2026-09-23 12:16:00' WHERE storedetailid = '240';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('240', '1', '20', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '275', '255', '1', '2026-09-23 12:16:00','0','0'); -- id=1443
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','00262', '101', '10', '262', '1', '620', '620', '0', '', '0', '2026-09-23 12:16:00', '262', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','620','620','0','','0','0.00','0','0','0','0'); -- id=668
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 668;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (262, '2026-09-23', 620, 580, 580
                    , 580, 580, 580, 580
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 580, 580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 620, 580, 580
                    , 580, 580, 580, 580
                    , 0, 0, 0, 0
                    , 0, 0, 0, 580, 580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+620, sellCostBuyPrice =sellCostBuyPrice+580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-23 12:16:00' WHERE storedetailid = '262';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('262', '1', '1', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '3', '1', '2026-09-23 12:16:00','0','0'); -- id=1444
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('21.5','00168', '101', '2', '168', '10', '25', '250', '0', '', '0', '2026-09-23 12:16:00', '168', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','26-10,','1','1','0','0','25','250','0','','0','0.00','0','0','0','0'); -- id=669
UPDATE sellbilldetail SET  lastbuyprice = 21.50 , meanbuyprice = 21.50, lastbuyprice_withDiscount = 21.50, meanbuyprice_withDiscount = 21.50
        , lastbuyprice_withTax = 21.5, meanbuyprice_withTax = 21.5, lastbuyprice_withDiscountAndTax = 21.5
                where sellbilldetailid = 669;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (168, '2026-09-23', 250, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 250, 215, 215
                    , 215, 215, 215, 215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 215, 215, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+215
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+215
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '308', userid = '1', storedetaildate = '2026-09-23 12:16:01' WHERE storedetailid = '168';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('168', '1', '10', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '318', '308', '1', '2026-09-23 12:16:01','0','0'); -- id=1445
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00346', '101', '6', '346', '1', '220', '220', '0', '', '0', '2026-09-23 12:16:01', '346', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','220','220','0','','0','0.00','0','0','0','0'); -- id=670
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 = 670;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (346, '2026-09-23', 220, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 220, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+210
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+210
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-23 12:16:01' WHERE storedetailid = '346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('346', '1', '1', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '1', '2026-09-23 12:16:01','0','0'); -- id=1446
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00190', '101', '20', '190', '10', '14', '140', '0', '', '0', '2026-09-23 12:16:01', '190', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','14','140','0','','0','0.00','0','0','0','0'); -- id=671
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 671;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (190, '2026-09-23', 140, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 140, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '243', userid = '1', storedetaildate = '2026-09-23 12:16:01' WHERE storedetailid = '190';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('190', '1', '10', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '253', '243', '1', '2026-09-23 12:16:01','0','0'); -- id=1447
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 42;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.25','00076', '101', '12', '76', '30', '4.5', '135', '0', '', '0', '2026-09-23 12:16:01', '76', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','42-30,','1','1','0','0','4.5','135','0','','0','0.00','0','0','0','0'); -- id=672
UPDATE sellbilldetail SET  lastbuyprice = 4.25 , meanbuyprice = 4.25, lastbuyprice_withDiscount = 4.25, meanbuyprice_withDiscount = 4.25
        , lastbuyprice_withTax = 4.25, meanbuyprice_withTax = 4.25, lastbuyprice_withDiscountAndTax = 4.25
                where sellbilldetailid = 672;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (76, '2026-09-23', 135, 127.5, 127.5
                    , 127.5, 127.5, 127.5, 127.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 127.5, 127.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+127.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+127.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+127.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+127.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+127.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+127.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+127.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+127.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+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 135, 127.5, 127.5
                    , 127.5, 127.5, 127.5, 127.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 127.5, 127.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+135, sellCostBuyPrice =sellCostBuyPrice+127.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+127.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+127.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+127.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+127.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+127.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+127.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+127.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 = '1527', userid = '1', storedetaildate = '2026-09-23 12:16:02' WHERE storedetailid = '76';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('76', '1', '30', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1557', '1527', '1', '2026-09-23 12:16:02','0','0'); -- id=1448
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('2.75','00074', '101', '12', '74', '100', '2.85', '285', '0', '', '0', '2026-09-23 12:16:02', '74', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','2.85','285','0','','0','0.00','0','0','0','0'); -- id=673
UPDATE sellbilldetail SET  lastbuyprice = 2.75 , meanbuyprice = 2.75, lastbuyprice_withDiscount = 2.75, meanbuyprice_withDiscount = 2.75
        , lastbuyprice_withTax = 2.75, meanbuyprice_withTax = 2.75, lastbuyprice_withDiscountAndTax = 2.75
                where sellbilldetailid = 673;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (74, '2026-09-23', 285, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 100, 0, 275, 275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+100
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 285, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 275, 275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '320', userid = '1', storedetaildate = '2026-09-23 12:16:02' WHERE storedetailid = '74';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('74', '1', '100', '1', '101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '420', '320', '1', '2026-09-23 12:16:02','0','0'); -- id=1449
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7178', '7178', '2026-09-23', '1', '0', '0', '2026-09-23 12:16:02','اضافة فاتورة مبيعات رقم 101','1','0',null,'0','101','sellbillController.php?do=showDetail&sellbillid=101'); -- id=789
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('789', '465', '7178', '','0'); -- id=789
UPDATE accountstree SET name = 'محمود شلبي', customName = 'محمود شلبي', customNameEn = 'محمود شلبي', nameEn = 'محمود شلبي', parent = '58', accountNature = '0', theValue = '7178', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 12:12:39' WHERE id = '465';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('789', '143', '7178', '','0'); -- id=789
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '324275.43', 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 ( '6475.5', '6475.5', '2026-09-23', '1', '0', '0', '2026-09-23 12:16:02','اضافة فاتورة مبيعات رقم 101 - صرف البضاعة من المخزن','1','0',null,'0','101','sellbillController.php?do=showDetail&sellbillid=101'); -- id=790
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('790', '402', '6475.5', '','0'); -- id=790
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '304056.62', 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 ('790', '382', '6475.5', '','0'); -- id=790
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2115434.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='789,0,790' where sellbillid=101;
 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-23', 7178, 6475.5, 6475.5
                    , 6365.15, 6475.5, 6365.15, 6475.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6475.5, 6365.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7178, sellCostBuyPrice =sellCostBuyPrice+6475.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6365.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6365.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6475.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6475.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6365.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (34, '2026-09-23', 7178, 6475.5, 6475.5
                    , 6365.15, 6475.5, 6365.15, 6475.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6475.5, 6365.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7178, sellCostBuyPrice =sellCostBuyPrice+6475.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6365.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6365.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6475.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6475.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6365.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 7178, 6475.5, 6475.5
                    , 6365.15, 6475.5, 6365.15, 6475.5, 6475.5, 6365.15)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7178, netSellCostBuyPrice = netSellCostBuyPrice+6475.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6475.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6365.15
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6475.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6365.15
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6475.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6475.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6365.15;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3a6059432d and sellbillId = 101 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 08:46:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 12:16:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 12:16:04', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2105
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:55:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:25:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 13:25:52', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:56:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:26:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 13:26:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2107
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','285','315','315','315','2026-09-23','0','1','0','','0','0','0','0','0','285','285','285','285','285','0','10.53','0','0','.','0','0','0','285','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','285','285','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','285','0','0','0','0','0','0','','','0','0','0','0'); -- id=439
UPDATE product SET productName = 'ابليك اسمر شعاع ', productDescription = '', productCatId = '16', productBuyPrice = '285', productSellAllPrice = '315', productSellUnitPrice = '315', productSellHalfPrice = '315', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00439',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '285',lastbuyprice_withDiscount = '285',meanbuyprice = '285',meanbuyprice_withDiscount = '285' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='285',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='285',meanbuyprice_withTax='285',price4='0',price5='0',price6='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='285',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '439';
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', '439', '1.00', '2026-09-23', '1', '0','0043901','315','315','315','285','','0','0','0','0','0','0','0','0','0','0'); -- id=439
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('439', '1', '6', '1', '2026-09-23'); -- id=439
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '6', '0', '439', 'إضافة منتج', 'productController.php', '0', '6', '1', '2026-09-23','0','0'); -- id=1450
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (439, 1,'2026-09-23 13:26:17',1)
                ON DUPLICATE KEY UPDATE productid = 439, edited = 1, sysdate = '2026-09-23 13:26:17', userid = 1; -- id=556
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1710', '1710', '2026-09-23', '1', '0', '0', '2026-09-23 13:26:17','إضافة منتج ابليك اسمر شعاع  الكمية 6','1','0','0','0','439','productController.php?do=edit&id=439'); -- id=791
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('791', '382', '1710', '','0'); -- id=791
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2117144.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('791', '121', '1710', '','0'); -- id=791
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1213179.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 = '285.00', productSellAllPrice = '315.00', productSellUnitPrice = '315.00', productSellHalfPrice = '315.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00439',type ='0', expireDate = '0' , dailyentryId = '791',isService = '0',isOptic = '0',lastbuyprice = '285',lastbuyprice_withDiscount = '285',meanbuyprice = '285',meanbuyprice_withDiscount = '285' , productbuypricereal = '285' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='285',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='285',meanbuyprice_withTax='285',price4='0',price5='0',price6='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='285',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '439';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:56:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:26:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 13:26:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:56:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:26:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 13:26:20', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:56:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:26:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 13:26:39', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2110

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3b75bc7898
-- ----------------------------------------------------------------------------------------------------

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-23 13:26:40', '06ab3b75bc7898', '1', '0.00', '0', '0', '1', '2360.00', '2360', '2360', '0', '1', '2026-09-23 13:26:40', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','2360','0','','0','0','2360','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','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=102
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','اضافة فاتورة مبيعات','102', '0', '2026-09-23 13:26:40', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2360', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-23 13:26:40','0','0','',''); -- id=175
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','00174', '102', '19', '174', '4', '275', '1100', '0', '', '1', '2026-09-23 13:26:40', '174', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','275','1100','0','','0','0.00','0','0','0','0'); -- id=674
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 674;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (174, '2026-09-23', 1100, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 1100, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2026-09-23 13:26:41' WHERE storedetailid = '174';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '4', '1', '102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '7', '1', '2026-09-23 13:26:41','0','0'); -- id=1451
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('285','00439', '102', '16', '439', '4', '315', '1260', '0', '', '1', '2026-09-23 13:26:41', '439', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','315','1260','0','','0','0.00','0','0','0','0'); -- id=675
UPDATE sellbilldetail SET  lastbuyprice = 285.00 , meanbuyprice = 285.00, lastbuyprice_withDiscount = 285.00, meanbuyprice_withDiscount = 285.00
        , lastbuyprice_withTax = 285, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 285
                where sellbilldetailid = 675;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (439, '2026-09-23', 1260, 1140, 1140
                    , 1140, 1140, 1140, 1140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1140, 1140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 1260, 1140, 1140
                    , 1140, 1140, 1140, 1140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1140, 1140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-23 13:26:41' WHERE storedetailid = '439';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '4', '1', '102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '2', '1', '2026-09-23 13:26:41','0','0'); -- id=1452
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-259773.84375',  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 ('-262133.84375','2360', '0', '1', 'اضافة فاتورة مبيعات', '102', '-259773.84375', '2026-09-23 13:26:41', '1',  'sellbillController.php','1','','0'); -- id=97
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2360', '2360', '2026-09-23', '1', '0', '0', '2026-09-23 13:26:41','اضافة فاتورة مبيعات رقم 102','1','0',null,'0','102','sellbillController.php?do=showDetail&sellbillid=102'); -- id=792
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('792', '383', '2360', '','0'); -- id=792
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-212406.82', 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 ('792', '143', '2360', '','0'); -- id=792
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '326635.43', 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 ( '2220', '2220', '2026-09-23', '1', '0', '0', '2026-09-23 13:26:41','اضافة فاتورة مبيعات رقم 102 - صرف البضاعة من المخزن','1','0',null,'0','102','sellbillController.php?do=showDetail&sellbillid=102'); -- id=793
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('793', '402', '2220', '','0'); -- id=793
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '306276.62', 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 ('793', '382', '2220', '','0'); -- id=793
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2114924.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='792,0,793' where sellbillid=102;
 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-23', 2360, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2360, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 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-23', 2360, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2360, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2360, 2220, 2220
                    , 2220, 2220, 2220, 2220, 2220, 2220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2360, netSellCostBuyPrice = netSellCostBuyPrice+2220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3b75bc7898 and sellbillId = 102 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 09:56:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 13:26:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 13:26:43', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:43:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:13:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 14:13:13', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2112
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:44:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:14:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:14:07', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:46:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:16:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:16:41', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2114
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 ('ماسوره 25 ملي pvc','','12','32','34','36','34','2026-09-23','0','1','0','','0','0','0','0','0','32','32','32','32','32','0','6.25','6.25','12.5','.','0','0','0','32','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','32','32','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','32','0','0','0','0','0','0','','','0','0','0','0'); -- id=440
UPDATE product SET productName = 'ماسوره 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '32', productSellAllPrice = '34', productSellUnitPrice = '36', productSellHalfPrice = '34', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00440',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '32',lastbuyprice_withDiscount = '32',meanbuyprice = '32',meanbuyprice_withDiscount = '32' , productbuypricereal = '32' , buypricereal_precentage = '0' , buytotal_precentage = '6.25' , buyhalf_precentage = '6.25' , buypart_precentage = '12.5',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='32',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='32',meanbuyprice_withTax='32',price4='0',price5='0',price6='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='32',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '440';
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', '440', '1.00', '2026-09-23', '1', '0','0044001','34','34','36','32','','0','0','0','0','0','0','0','0','0','0'); -- id=440
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('440', '1', '220', '1', '2026-09-23'); -- id=440
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('440', '1', '220', '0', '440', 'إضافة منتج', 'productController.php', '0', '220', '1', '2026-09-23','0','0'); -- id=1453
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (440, 1,'2026-09-23 14:16:42',1)
                ON DUPLICATE KEY UPDATE productid = 440, edited = 1, sysdate = '2026-09-23 14:16:42', userid = 1; -- id=557
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7040', '7040', '2026-09-23', '1', '0', '0', '2026-09-23 14:16:43','إضافة منتج ماسوره 25 ملي pvc الكمية 220','1','0','0','0','440','productController.php?do=edit&id=440'); -- id=794
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('794', '382', '7040', '','0'); -- id=794
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2121964.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('794', '121', '7040', '','0'); -- id=794
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1220219.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 = 'ماسوره 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '32.00', productSellAllPrice = '34.00', productSellUnitPrice = '36.00', productSellHalfPrice = '34.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00440',type ='0', expireDate = '0' , dailyentryId = '794',isService = '0',isOptic = '0',lastbuyprice = '32',lastbuyprice_withDiscount = '32',meanbuyprice = '32',meanbuyprice_withDiscount = '32' , productbuypricereal = '32' , buypricereal_precentage = '0' , buytotal_precentage = '6.25' , buyhalf_precentage = '6.25' , buypart_precentage = '12.5',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='32',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='32',meanbuyprice_withTax='32',price4='0',price5='0',price6='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='32',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '440';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('ماسوره 20 ملي pvc','','12','27','30','30','30','2026-09-23','0','1','0','','0','0','0','0','0','27','27','27','27','27','0','11.11','11.11','11.11','.','0','0','0','27','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','27','27','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','27','0','0','0','0','0','0','','','0','0','0','0'); -- id=441
UPDATE product SET productName = 'ماسوره 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '27', productSellAllPrice = '30', productSellUnitPrice = '30', productSellHalfPrice = '30', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00441',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '27',lastbuyprice_withDiscount = '27',meanbuyprice = '27',meanbuyprice_withDiscount = '27' , productbuypricereal = '27' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='27',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='27',meanbuyprice_withTax='27',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='27',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '441';
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', '441', '1.00', '2026-09-23', '1', '0','0044101','30','30','30','27','','0','0','0','0','0','0','0','0','0','0'); -- id=441
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('441', '1', '0', '1', '2026-09-23'); -- id=441
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('441', '1', '0', '0', '441', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1454
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (441, 1,'2026-09-23 14:16:45',1)
                ON DUPLICATE KEY UPDATE productid = 441, edited = 1, sysdate = '2026-09-23 14:16:45', userid = 1; -- id=558
UPDATE product SET productName = 'ماسوره 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '27.00', productSellAllPrice = '30.00', productSellUnitPrice = '30.00', productSellHalfPrice = '30.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00441',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '27',lastbuyprice_withDiscount = '27',meanbuyprice = '27',meanbuyprice_withDiscount = '27' , productbuypricereal = '27' , buypricereal_precentage = '0' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='27',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='27',meanbuyprice_withTax='27',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='27',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '441';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:46:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:16:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:16:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2115
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:46:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:16:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:16:53', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:47:02";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:17:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:17:02', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2117
UPDATE productunit SET proUnitBuyPrice  = 27.00 * productnumber WHERE productid = 441;
UPDATE product SET productName = 'ماسوره 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '27.00', productSellAllPrice = '30.00', productSellUnitPrice = '30.00', productSellHalfPrice = '30.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00441',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '27.00',lastbuyprice_withDiscount = '27',meanbuyprice = '27.00',meanbuyprice_withDiscount = '27' , productbuypricereal = '27.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='27',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='27',meanbuyprice_withTax='27',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='27',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '441';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (441, 1,'2026-09-23 14:17:10',1)
                ON DUPLICATE KEY UPDATE productid = 441, edited = 1, sysdate = '2026-09-23 14:17:10', userid = 1; -- id=558
UPDATE productunit SET proUnitSellUnitPrice = 31 * productnumber WHERE productid = 441;
UPDATE product SET productName = 'ماسوره 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '27.00', productSellAllPrice = '30.00', productSellUnitPrice = '31', productSellHalfPrice = '30.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00441',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '27.00',lastbuyprice_withDiscount = '27',meanbuyprice = '27.00',meanbuyprice_withDiscount = '27' , productbuypricereal = '27.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='27',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='27',meanbuyprice_withTax='27',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='27',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '441';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (441, 1,'2026-09-23 14:17:11',1)
                ON DUPLICATE KEY UPDATE productid = 441, edited = 1, sysdate = '2026-09-23 14:17:11', userid = 1; -- id=558
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:47:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:17:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-23 14:17:14', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=2118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:47:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:17:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-23 14:17:43', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=2119
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '441';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('441', '1', '90', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '0', '90', '1', '2026-09-23','0','0'); -- id=1455
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2430', '2430', '2026-09-23', '1', '0', '0', '2026-09-23 14:17:43','اعادة جرد للمنتج : (ماسوره 20 ملي pvc/خراطيم) فى مخزن : (المخزن الرئيسي) بالكمية : 90','1','0',null,'0','1455','inventoryController.php?do=details&id=1455'); -- id=795
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('795', '382', '2430', '','0'); -- id=795
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2124394.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('795', '188', '2430', '','0'); -- id=795
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-51904.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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:47:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:17:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:17:45', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:50:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:20:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:20:51', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2121
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 ('قفيز 25 ملي pvc','','12','1.4','2','2.5','2','2026-09-23','0','1','0','','0','0','0','0','0','1.4','1.4','1.4','1.4','1.4','0','42.86','42.86','78.57','.','0','0','0','1.4','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1.4','1.4','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1.4','0','0','0','0','0','0','','','0','0','0','0'); -- id=442
UPDATE product SET productName = 'قفيز 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.4', productSellAllPrice = '2', productSellUnitPrice = '2.5', productSellHalfPrice = '2', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1.4',lastbuyprice_withDiscount = '1.4',meanbuyprice = '1.4',meanbuyprice_withDiscount = '1.4' , productbuypricereal = '1.4' , buypricereal_precentage = '0' , buytotal_precentage = '42.86' , buyhalf_precentage = '42.86' , buypart_precentage = '78.57',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1.4',meanbuyprice_withTax='1.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '442';
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', '442', '1.00', '2026-09-23', '1', '0','0044201','2','2','2.5','1.4','','0','0','0','0','0','0','0','0','0','0'); -- id=442
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('442', '1', '600', '1', '2026-09-23'); -- id=442
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('442', '1', '600', '0', '442', 'إضافة منتج', 'productController.php', '0', '600', '1', '2026-09-23','0','0'); -- id=1456
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (442, 1,'2026-09-23 14:20:53',1)
                ON DUPLICATE KEY UPDATE productid = 442, edited = 1, sysdate = '2026-09-23 14:20:53', userid = 1; -- id=561
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '840', '840', '2026-09-23', '1', '0', '0', '2026-09-23 14:20:53','إضافة منتج قفيز 25 ملي pvc الكمية 600','1','0','0','0','442','productController.php?do=edit&id=442'); -- id=796
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('796', '382', '840', '','0'); -- id=796
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2125234.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('796', '121', '840', '','0'); -- id=796
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1221059.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 = 'قفيز 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.40', productSellAllPrice = '2.00', productSellUnitPrice = '2.50', productSellHalfPrice = '2.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00442',type ='0', expireDate = '0' , dailyentryId = '796',isService = '0',isOptic = '0',lastbuyprice = '1.4',lastbuyprice_withDiscount = '1.4',meanbuyprice = '1.4',meanbuyprice_withDiscount = '1.4' , productbuypricereal = '1.4' , buypricereal_precentage = '0' , buytotal_precentage = '42.86' , buyhalf_precentage = '42.86' , buypart_precentage = '78.57',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1.4',meanbuyprice_withTax='1.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '442';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('قفيز 20 ملي pvc ','','12','1.2','2','2.5','2','2026-09-23','0','1','0','','0','0','0','0','0','1.2','1.2','1.2','1.2','1.2','0','66.67','66.67','108.33','.','0','0','0','1.2','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1.2','1.2','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1.2','0','0','0','0','0','0','','','0','0','0','0'); -- id=443
UPDATE product SET productName = 'قفيز 20 ملي pvc ', productDescription = '', productCatId = '12', productBuyPrice = '1.2', productSellAllPrice = '2', productSellUnitPrice = '2.5', productSellHalfPrice = '2', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00443',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1.2',lastbuyprice_withDiscount = '1.2',meanbuyprice = '1.2',meanbuyprice_withDiscount = '1.2' , productbuypricereal = '1.2' , buypricereal_precentage = '0' , buytotal_precentage = '66.67' , buyhalf_precentage = '66.67' , buypart_precentage = '108.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.2',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='1.2',meanbuyprice_withTax='1.2',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '443';
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', '443', '1.00', '2026-09-23', '1', '0','0044301','2','2','2.5','1.2','','0','0','0','0','0','0','0','0','0','0'); -- id=443
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('443', '1', '600', '1', '2026-09-23'); -- id=443
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('443', '1', '600', '0', '443', 'إضافة منتج', 'productController.php', '0', '600', '1', '2026-09-23','0','0'); -- id=1457
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (443, 1,'2026-09-23 14:20:55',1)
                ON DUPLICATE KEY UPDATE productid = 443, edited = 1, sysdate = '2026-09-23 14:20:55', userid = 1; -- id=562
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '720', '720', '2026-09-23', '1', '0', '0', '2026-09-23 14:20:55','إضافة منتج قفيز 20 ملي pvc  الكمية 600','1','0','0','0','443','productController.php?do=edit&id=443'); -- id=797
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('797', '382', '720', '','0'); -- id=797
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2125954.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('797', '121', '720', '','0'); -- id=797
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1221779.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 = 'قفيز 20 ملي pvc ', productDescription = '', productCatId = '12', productBuyPrice = '1.20', productSellAllPrice = '2.00', productSellUnitPrice = '2.50', productSellHalfPrice = '2.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00443',type ='0', expireDate = '0' , dailyentryId = '797',isService = '0',isOptic = '0',lastbuyprice = '1.2',lastbuyprice_withDiscount = '1.2',meanbuyprice = '1.2',meanbuyprice_withDiscount = '1.2' , productbuypricereal = '1.2' , buypricereal_precentage = '0' , buytotal_precentage = '66.67' , buyhalf_precentage = '66.67' , buypart_precentage = '108.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.2',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='1.2',meanbuyprice_withTax='1.2',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '443';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('جلبه 20 ملي pvc','','12','1.2','2','2.5','2','2026-09-23','0','1','0','','0','0','0','0','0','1.2','1.2','1.2','1.2','1.2','0','66.67','66.67','108.33','.','0','0','0','1.2','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1.2','1.2','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1.2','0','0','0','0','0','0','','','0','0','0','0'); -- id=444
UPDATE product SET productName = 'جلبه 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.2', productSellAllPrice = '2', productSellUnitPrice = '2.5', productSellHalfPrice = '2', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00444',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1.2',lastbuyprice_withDiscount = '1.2',meanbuyprice = '1.2',meanbuyprice_withDiscount = '1.2' , productbuypricereal = '1.2' , buypricereal_precentage = '0' , buytotal_precentage = '66.67' , buyhalf_precentage = '66.67' , buypart_precentage = '108.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.2',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='1.2',meanbuyprice_withTax='1.2',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '444';
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', '444', '1.00', '2026-09-23', '1', '0','0044401','2','2','2.5','1.2','','0','0','0','0','0','0','0','0','0','0'); -- id=444
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('444', '1', '250', '1', '2026-09-23'); -- id=444
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('444', '1', '250', '0', '444', 'إضافة منتج', 'productController.php', '0', '250', '1', '2026-09-23','0','0'); -- id=1458
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (444, 1,'2026-09-23 14:20:57',1)
                ON DUPLICATE KEY UPDATE productid = 444, edited = 1, sysdate = '2026-09-23 14:20:57', userid = 1; -- id=563
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '300', '300', '2026-09-23', '1', '0', '0', '2026-09-23 14:20:57','إضافة منتج جلبه 20 ملي pvc الكمية 250','1','0','0','0','444','productController.php?do=edit&id=444'); -- id=798
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('798', '382', '300', '','0'); -- id=798
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2126254.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('798', '121', '300', '','0'); -- id=798
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1222079.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 = 'جلبه 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.20', productSellAllPrice = '2.00', productSellUnitPrice = '2.50', productSellHalfPrice = '2.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00444',type ='0', expireDate = '0' , dailyentryId = '798',isService = '0',isOptic = '0',lastbuyprice = '1.2',lastbuyprice_withDiscount = '1.2',meanbuyprice = '1.2',meanbuyprice_withDiscount = '1.2' , productbuypricereal = '1.2' , buypricereal_precentage = '0' , buytotal_precentage = '66.67' , buyhalf_precentage = '66.67' , buypart_precentage = '108.33',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.2',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='1.2',meanbuyprice_withTax='1.2',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '444';
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 ('جلبه 25 ملي pvc','','12','1.4','2','2.5','2','2026-09-23','0','1','0','','0','0','0','0','0','1.4','1.4','1.4','1.4','1.4','0','42.86','42.86','78.57','.','0','0','0','1.4','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1.4','1.4','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','1.4','0','0','0','0','0','0','','','0','0','0','0'); -- id=445
UPDATE product SET productName = 'جلبه 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.4', productSellAllPrice = '2', productSellUnitPrice = '2.5', productSellHalfPrice = '2', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00445',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1.4',lastbuyprice_withDiscount = '1.4',meanbuyprice = '1.4',meanbuyprice_withDiscount = '1.4' , productbuypricereal = '1.4' , buypricereal_precentage = '0' , buytotal_precentage = '42.86' , buyhalf_precentage = '42.86' , buypart_precentage = '78.57',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1.4',meanbuyprice_withTax='1.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '445';
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', '445', '1.00', '2026-09-23', '1', '0','0044501','2','2','2.5','1.4','','0','0','0','0','0','0','0','0','0','0'); -- id=445
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('445', '1', '250', '1', '2026-09-23'); -- id=445
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('445', '1', '250', '0', '445', 'إضافة منتج', 'productController.php', '0', '250', '1', '2026-09-23','0','0'); -- id=1459
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (445, 1,'2026-09-23 14:20:59',1)
                ON DUPLICATE KEY UPDATE productid = 445, edited = 1, sysdate = '2026-09-23 14:20:59', userid = 1; -- id=564
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '350', '350', '2026-09-23', '1', '0', '0', '2026-09-23 14:20:59','إضافة منتج جلبه 25 ملي pvc الكمية 250','1','0','0','0','445','productController.php?do=edit&id=445'); -- id=799
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('799', '382', '350', '','0'); -- id=799
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2126604.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('799', '121', '350', '','0'); -- id=799
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1222429.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 = 'جلبه 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '1.40', productSellAllPrice = '2.00', productSellUnitPrice = '2.50', productSellHalfPrice = '2.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00445',type ='0', expireDate = '0' , dailyentryId = '799',isService = '0',isOptic = '0',lastbuyprice = '1.4',lastbuyprice_withDiscount = '1.4',meanbuyprice = '1.4',meanbuyprice_withDiscount = '1.4' , productbuypricereal = '1.4' , buypricereal_precentage = '0' , buytotal_precentage = '42.86' , buyhalf_precentage = '42.86' , buypart_precentage = '78.57',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1.4',meanbuyprice_withTax='1.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '445';
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 ('كوع 25 ملي pvc','','12','3.5','4','5','4','2026-09-23','0','1','0','','0','0','0','0','0','3.5','3.5','3.5','3.5','3.5','0','14.29','14.29','42.86','.','0','0','0','3.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','3.5','3.5','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','3.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=446
UPDATE product SET productName = 'كوع 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '3.5', productSellAllPrice = '4', productSellUnitPrice = '5', productSellHalfPrice = '4', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00446',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '3.5',lastbuyprice_withDiscount = '3.5',meanbuyprice = '3.5',meanbuyprice_withDiscount = '3.5' , productbuypricereal = '3.5' , buypricereal_precentage = '0' , buytotal_precentage = '14.29' , buyhalf_precentage = '14.29' , buypart_precentage = '42.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='3.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='3.5',meanbuyprice_withTax='3.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='3.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '446';
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', '446', '1.00', '2026-09-23', '1', '0','0044601','4','4','5','3.5','','0','0','0','0','0','0','0','0','0','0'); -- id=446
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('446', '1', '250', '1', '2026-09-23'); -- id=446
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('446', '1', '250', '0', '446', 'إضافة منتج', 'productController.php', '0', '250', '1', '2026-09-23','0','0'); -- id=1460
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (446, 1,'2026-09-23 14:21:01',1)
                ON DUPLICATE KEY UPDATE productid = 446, edited = 1, sysdate = '2026-09-23 14:21:01', userid = 1; -- id=565
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '875', '875', '2026-09-23', '1', '0', '0', '2026-09-23 14:21:01','إضافة منتج كوع 25 ملي pvc الكمية 250','1','0','0','0','446','productController.php?do=edit&id=446'); -- id=800
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('800', '382', '875', '','0'); -- id=800
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2127479.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('800', '121', '875', '','0'); -- id=800
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1223304.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 = 'كوع 25 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '3.50', productSellAllPrice = '4.00', productSellUnitPrice = '5.00', productSellHalfPrice = '4.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00446',type ='0', expireDate = '0' , dailyentryId = '800',isService = '0',isOptic = '0',lastbuyprice = '3.5',lastbuyprice_withDiscount = '3.5',meanbuyprice = '3.5',meanbuyprice_withDiscount = '3.5' , productbuypricereal = '3.5' , buypricereal_precentage = '0' , buytotal_precentage = '14.29' , buyhalf_precentage = '14.29' , buypart_precentage = '42.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='3.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='3.5',meanbuyprice_withTax='3.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='3.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '446';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('كوع 20 ملي pvc','','12','2.5','3.5','4','3.5','2026-09-23','0','1','0','','0','0','0','0','0','2.5','2.5','2.5','2.5','2.5','0','40','40','60','.','0','0','0','2.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','2.5','2.5','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','2.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=447
UPDATE product SET productName = 'كوع 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '2.5', productSellAllPrice = '3.5', productSellUnitPrice = '4', productSellHalfPrice = '3.5', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00447',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '2.5',lastbuyprice_withDiscount = '2.5',meanbuyprice = '2.5',meanbuyprice_withDiscount = '2.5' , productbuypricereal = '2.5' , buypricereal_precentage = '0' , buytotal_precentage = '40' , buyhalf_precentage = '40' , buypart_precentage = '60',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2.5',meanbuyprice_withTax='2.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='2.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '447';
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', '447', '1.00', '2026-09-23', '1', '0','0044701','3.5','3.5','4','2.5','','0','0','0','0','0','0','0','0','0','0'); -- id=447
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('447', '1', '250', '1', '2026-09-23'); -- id=447
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('447', '1', '250', '0', '447', 'إضافة منتج', 'productController.php', '0', '250', '1', '2026-09-23','0','0'); -- id=1461
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (447, 1,'2026-09-23 14:21:03',1)
                ON DUPLICATE KEY UPDATE productid = 447, edited = 1, sysdate = '2026-09-23 14:21:03', userid = 1; -- id=566
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '625', '625', '2026-09-23', '1', '0', '0', '2026-09-23 14:21:03','إضافة منتج كوع 20 ملي pvc الكمية 250','1','0','0','0','447','productController.php?do=edit&id=447'); -- id=801
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('801', '382', '625', '','0'); -- id=801
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2128104.95', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('801', '121', '625', '','0'); -- id=801
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1223929.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 = 'كوع 20 ملي pvc', productDescription = '', productCatId = '12', productBuyPrice = '2.50', productSellAllPrice = '3.50', productSellUnitPrice = '4.00', productSellHalfPrice = '3.50', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00447',type ='0', expireDate = '0' , dailyentryId = '801',isService = '0',isOptic = '0',lastbuyprice = '2.5',lastbuyprice_withDiscount = '2.5',meanbuyprice = '2.5',meanbuyprice_withDiscount = '2.5' , productbuypricereal = '2.5' , buypricereal_precentage = '0' , buytotal_precentage = '40' , buyhalf_precentage = '40' , buypart_precentage = '60',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='2.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='2.5',meanbuyprice_withTax='2.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='2.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '447';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:51:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:21:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 14:21:06', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:51:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:21:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 14:21:11', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:52:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:22:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 14:22:29', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2124

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3c4382eeaf
-- ----------------------------------------------------------------------------------------------------

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-23 14:22:30', '06ab3c4382eeaf', '1', '0.00', '0', '0', '1', '783.50', '783.5', '783.5', '0', '1', '2026-09-23 14:22:30', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '48' ,'0','','','','','-1','0','0','0','0','0','783','0','','0','0','783.5','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','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=103
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','اضافة فاتورة مبيعات','103', '0', '2026-09-23 14:22:30', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '783.5', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-23 14:22:30','0','0','',''); -- id=176
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('32','00440', '103', '12', '440', '11', '36', '396', '0', '', '1', '2026-09-23 14:22:30', '440', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','396','0','','0','0.00','0','0','0','0'); -- id=676
UPDATE sellbilldetail SET  lastbuyprice = 32.00 , meanbuyprice = 32.00, lastbuyprice_withDiscount = 32.00, meanbuyprice_withDiscount = 32.00
        , lastbuyprice_withTax = 32, meanbuyprice_withTax = 32, lastbuyprice_withDiscountAndTax = 32
                where sellbilldetailid = 676;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (440, '2026-09-23', 396, 352, 352
                    , 352, 352, 352, 352
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11, 0, 352, 352, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396, sellCostBuyPrice =sellCostBuyPrice+352
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+352, sellCostMeanBuyPrice = sellCostMeanBuyPrice+352
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+352, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+352
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+352
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+352
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+352
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+11
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO 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-23', 396, 352, 352
                    , 352, 352, 352, 352
                    , 0, 0, 0, 0
                    , 0, 0, 0, 352, 352, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+396, sellCostBuyPrice =sellCostBuyPrice+352
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+352, sellCostMeanBuyPrice = sellCostMeanBuyPrice+352
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+352, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+352
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+352
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+352
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+352
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '209', userid = '1', storedetaildate = '2026-09-23 14:22:30' WHERE storedetailid = '440';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('440', '1', '11', '1', '103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '220', '209', '1', '2026-09-23 14:22:30','0','0'); -- id=1462
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1.4','00442', '103', '12', '442', '25', '2.5', '62.5', '0', '', '1', '2026-09-23 14:22:30', '442', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2.5','62.5','0','','0','0.00','0','0','0','0'); -- id=677
UPDATE sellbilldetail SET  lastbuyprice = 1.40 , meanbuyprice = 1.40, lastbuyprice_withDiscount = 1.40, meanbuyprice_withDiscount = 1.40
        , lastbuyprice_withTax = 1.4, meanbuyprice_withTax = 1.4, lastbuyprice_withDiscountAndTax = 1.4
                where sellbilldetailid = 677;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (442, '2026-09-23', 62.5, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+62.5, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 62.5, 35, 35
                    , 35, 35, 35, 35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 35, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+62.5, sellCostBuyPrice =sellCostBuyPrice+35
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+35, sellCostMeanBuyPrice = sellCostMeanBuyPrice+35
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+35
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+35
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '575', userid = '1', storedetaildate = '2026-09-23 14:22:31' WHERE storedetailid = '442';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('442', '1', '25', '1', '103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '600', '575', '1', '2026-09-23 14:22:31','0','0'); -- id=1463
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('3.5','00446', '103', '12', '446', '5', '5', '25', '0', '', '1', '2026-09-23 14:22:31', '446', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','5','25','0','','0','0.00','0','0','0','0'); -- id=678
UPDATE sellbilldetail SET  lastbuyprice = 3.50 , meanbuyprice = 3.50, lastbuyprice_withDiscount = 3.50, meanbuyprice_withDiscount = 3.50
        , lastbuyprice_withTax = 3.5, meanbuyprice_withTax = 3.5, lastbuyprice_withDiscountAndTax = 3.5
                where sellbilldetailid = 678;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (446, '2026-09-23', 25, 17.5, 17.5
                    , 17.5, 17.5, 17.5, 17.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 17.5, 17.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25, sellCostBuyPrice =sellCostBuyPrice+17.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 25, 17.5, 17.5
                    , 17.5, 17.5, 17.5, 17.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17.5, 17.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25, sellCostBuyPrice =sellCostBuyPrice+17.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.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 = '245', userid = '1', storedetaildate = '2026-09-23 14:22:31' WHERE storedetailid = '446';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('446', '1', '5', '1', '103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '250', '245', '1', '2026-09-23 14:22:31','0','0'); -- id=1464
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1.4','00445', '103', '12', '445', '6', '2.5', '15', '0', '', '1', '2026-09-23 14:22:31', '445', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2.5','15','0','','0','0.00','0','0','0','0'); -- id=679
UPDATE sellbilldetail SET  lastbuyprice = 1.40 , meanbuyprice = 1.40, lastbuyprice_withDiscount = 1.40, meanbuyprice_withDiscount = 1.40
        , lastbuyprice_withTax = 1.4, meanbuyprice_withTax = 1.4, lastbuyprice_withDiscountAndTax = 1.4
                where sellbilldetailid = 679;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (445, '2026-09-23', 15, 8.4, 8.4
                    , 8.4, 8.4, 8.4, 8.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 8.4, 8.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+8.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 15, 8.4, 8.4
                    , 8.4, 8.4, 8.4, 8.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8.4, 8.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+8.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '244', userid = '1', storedetaildate = '2026-09-23 14:22:32' WHERE storedetailid = '445';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('445', '1', '6', '1', '103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '250', '244', '1', '2026-09-23 14:22:32','0','0'); -- id=1465
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','00085', '103', '12', '85', '1', '285', '285', '0', '', '1', '2026-09-23 14:22:32', '85', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','285','285','0','','0','0.00','0','0','0','0'); -- id=680
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 680;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (85, '2026-09-23', 285, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 285, 250, 250
                    , 250, 250, 250, 250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 250, 250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+285, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-09-23 14:22:32' WHERE storedetailid = '85';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('85', '1', '1', '1', '103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '19', '1', '2026-09-23 14:22:32','0','0'); -- id=1466
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-258990.34375',  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 ('-259773.84375','783.5', '0', '1', 'اضافة فاتورة مبيعات', '103', '-258990.34375', '2026-09-23 14:22:32', '1',  'sellbillController.php','1','','0'); -- id=98
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '783.5', '783.5', '2026-09-23', '1', '0', '0', '2026-09-23 14:22:32','اضافة فاتورة مبيعات رقم 103','1','0',null,'0','103','sellbillController.php?do=showDetail&sellbillid=103'); -- id=802
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('802', '383', '783.5', '','0'); -- id=802
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-211623.32', 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 ('802', '143', '783.5', '','0'); -- id=802
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '327418.93', 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 ( '662.9', '662.9', '2026-09-23', '1', '0', '0', '2026-09-23 14:22:32','اضافة فاتورة مبيعات رقم 103 - صرف البضاعة من المخزن','1','0',null,'0','103','sellbillController.php?do=showDetail&sellbillid=103'); -- id=803
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('803', '402', '662.9', '','0'); -- id=803
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '306939.52', 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 ('803', '382', '662.9', '','0'); -- id=803
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2127442.05', 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='802,0,803' where sellbillid=103;
 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-23', 783.5, 662.9, 662.9
                    , 662.9, 662.9, 662.9, 662.9
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,662.9, 662.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+783.5, sellCostBuyPrice =sellCostBuyPrice+662.9
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+662.9, sellCostMeanBuyPrice = sellCostMeanBuyPrice+662.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+662.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+662.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+662.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+662.9
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+662.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 783.5, 662.9, 662.9
                    , 662.9, 662.9, 662.9, 662.9
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,662.9, 662.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+783.5, sellCostBuyPrice =sellCostBuyPrice+662.9
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+662.9, sellCostMeanBuyPrice = sellCostMeanBuyPrice+662.9
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+662.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+662.9
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+662.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+662.9
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+662.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 783.5, 662.9, 662.9
                    , 662.9, 662.9, 662.9, 662.9, 662.9, 662.9)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+783.5, netSellCostBuyPrice = netSellCostBuyPrice+662.9
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+662.9
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+662.9
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+662.9
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+662.9
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+662.9
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+662.9
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+662.9;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3c4382eeaf and sellbillId = 103 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 10:52:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 14:22:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 14:22:34', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2125
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('جمال' , '', '', '', '0', '', '0', '2026-09-23 15:45:34', '1', '0','','0','','-10','0','10000',',','-1','0','.','0','0','.','2026-09-23','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=35
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('35', '0', '0', '', ''); -- id=35
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 ('35','0','0','0','إضافة عميل جديد','35', '0', '2026-09-23 15:45:34', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=177
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('جمال', 'جمال', 'جمال', 'جمال', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-23 15:45:35'); -- id=466
UPDATE client SET clientname = 'جمال', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-23', userid = '1'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='466',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '35';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:16:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 15:46:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 15:46:00', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2126

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3c48ad1182
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(35,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-23 15:46:01', '06ab3c48ad1182', '35', '0.00', '2816.78', '0', '1', '2816.78', '2816.78', '0', '2816.78', '1', '2026-09-23 15:46:01', '', '1', '0', 'جمال', '1', '1', '3', '0', 'جمال', '86' ,'0','','','','','-1','0','0','0','0','0','2816','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','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=104
UPDATE client SET  clientdebt = '2816.78', userid = '1' WHERE clientid = '35';
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 ('35','0.00','2816.78','0','اضافة فاتورة مبيعات','104', '2816.78', '2026-09-23 15:46:01', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2816.78', '0', null, '0', null, null,'', '0','1','1','2816.78','1','2026-09-23 15:46:01','0','0','',''); -- id=178
UPDATE client SET  inUse = 0 where clientid = 35;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','00022', '104', '1', '22', '1', '198', '198', '0', '', '1', '2026-09-23 15:46:02', '22', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','198','198','0','','0','0.00','0','0','0','0'); -- id=681
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 190.00, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 190.00
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 190, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 681;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (22, '2026-09-23', 198, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+198, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 198, 190, 190
                    , 190, 190, 190, 190
                    , 0, 0, 0, 0
                    , 0, 0, 0, 190, 190, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+198, sellCostBuyPrice =sellCostBuyPrice+190
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+190, sellCostMeanBuyPrice = sellCostMeanBuyPrice+190
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+190, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+190
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+190
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+190
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+190
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-23 15:46:02' WHERE storedetailid = '22';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('22', '1', '1', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '1', '2026-09-23 15:46:02','0','0'); -- id=1467
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.82','00388', '104', '20', '388', '8', '5.25', '42', '0', '', '1', '2026-09-23 15:46:02', '388', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','25-8,','1','1','0','0','5.25','42','0','','0','0.00','0','0','0','0'); -- id=682
UPDATE sellbilldetail SET  lastbuyprice = 4.82 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.82, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.82, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.82
                where sellbilldetailid = 682;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (388, '2026-09-23', 42, 38.56, 38.56
                    , 38.56, 38.56, 38.56, 38.56
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 38.56, 38.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42, sellCostBuyPrice =sellCostBuyPrice+38.56
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+38.56, sellCostMeanBuyPrice = sellCostMeanBuyPrice+38.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+38.56, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+38.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+38.56
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+38.56
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+38.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 42, 38.56, 38.56
                    , 38.56, 38.56, 38.56, 38.56
                    , 0, 0, 0, 0
                    , 0, 0, 0, 38.56, 38.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42, sellCostBuyPrice =sellCostBuyPrice+38.56
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+38.56, sellCostMeanBuyPrice = sellCostMeanBuyPrice+38.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+38.56, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+38.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+38.56
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+38.56
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+38.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1213', userid = '1', storedetaildate = '2026-09-23 15:46:02' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '8', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1221', '1213', '1', '2026-09-23 15:46:02','0','0'); -- id=1468
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11.1','00087', '104', '12', '87', '1', '11.3', '11.3', '0', '', '1', '2026-09-23 15:46:02', '87', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','11.3','0','','0','0.00','0','0','0','0'); -- id=683
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 683;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (87, '2026-09-23', 11.3, 11.1, 11.1
                    , 11.1, 11.1, 11.1, 11.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 11.1, 11.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11.3, sellCostBuyPrice =sellCostBuyPrice+11.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 11.3, 11.1, 11.1
                    , 11.1, 11.1, 11.1, 11.1
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11.1, 11.1, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11.3, sellCostBuyPrice =sellCostBuyPrice+11.1
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.1, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.1
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.1, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.1
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.1
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.1
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.1
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '158', userid = '1', storedetaildate = '2026-09-23 15:46:03' WHERE storedetailid = '87';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('87', '1', '1', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '159', '158', '1', '2026-09-23 15:46:03','0','0'); -- id=1469
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '104', '1', '1', '16', '54.78', '876.48', '0', '', '1', '2026-09-23 15:46:03', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','54.78','876.48','0','','0','0.00','0','0','0','0'); -- id=684
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 = 684;
 INSERT INTO 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-23', 876.48, 844, 844
                    , 844, 844, 844, 844
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 844, 844, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876.48, sellCostBuyPrice =sellCostBuyPrice+844
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+844, sellCostMeanBuyPrice = sellCostMeanBuyPrice+844
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+844, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+844
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+844
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+844
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+844
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 876.48, 844, 844
                    , 844, 844, 844, 844
                    , 0, 0, 0, 0
                    , 0, 0, 0, 844, 844, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+876.48, sellCostBuyPrice =sellCostBuyPrice+844
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+844, sellCostMeanBuyPrice = sellCostMeanBuyPrice+844
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+844, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+844
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+844
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+844
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+844
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '662', userid = '1', storedetaildate = '2026-09-23 15:46:03' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '16', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '678', '662', '1', '2026-09-23 15:46:03','0','0'); -- id=1470
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '104', '1', '4', '10', '36', '360', '0', '', '1', '2026-09-23 15:46:03', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','360','0','','0','0.00','0','0','0','0'); -- id=685
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 = 685;
 INSERT INTO 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-23', 360, 348, 348
                    , 348, 348, 348, 348
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 348, 348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+348, sellCostMeanBuyPrice = sellCostMeanBuyPrice+348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+348
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 360, 348, 348
                    , 348, 348, 348, 348
                    , 0, 0, 0, 0
                    , 0, 0, 0, 348, 348, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+348
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+348, sellCostMeanBuyPrice = sellCostMeanBuyPrice+348
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+348, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+348
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+348
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+348
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+348
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1796', userid = '1', storedetaildate = '2026-09-23 15:46:03' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '10', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1806', '1796', '1', '2026-09-23 15:46:03','0','0'); -- id=1471
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '104', '1', '3', '5', '36', '180', '0', '', '1', '2026-09-23 15:46:03', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','36','180','0','','0','0.00','0','0','0','0'); -- id=686
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 = 686;
 INSERT INTO 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-23', 180, 174, 174
                    , 174, 174, 174, 174
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 174, 174, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+180, sellCostBuyPrice =sellCostBuyPrice+174
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+174, sellCostMeanBuyPrice = sellCostMeanBuyPrice+174
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+174, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+174
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+174
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+174
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+174
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 180, 174, 174
                    , 174, 174, 174, 174
                    , 0, 0, 0, 0
                    , 0, 0, 0, 174, 174, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+180, sellCostBuyPrice =sellCostBuyPrice+174
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+174, sellCostMeanBuyPrice = sellCostMeanBuyPrice+174
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+174, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+174
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+174
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+174
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+174
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1570', userid = '1', storedetaildate = '2026-09-23 15:46:04' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '5', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1575', '1570', '1', '2026-09-23 15:46:04','0','0'); -- id=1472
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15.5','00193', '104', '20', '193', '8', '16.5', '132', '0', '', '1', '2026-09-23 15:46:04', '193', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','16.5','132','0','','0','0.00','0','0','0','0'); -- id=687
UPDATE sellbilldetail SET  lastbuyprice = 15.50 , meanbuyprice = 15.50, lastbuyprice_withDiscount = 15.50, meanbuyprice_withDiscount = 15.50
        , lastbuyprice_withTax = 15.5, meanbuyprice_withTax = 15.5, lastbuyprice_withDiscountAndTax = 15.5
                where sellbilldetailid = 687;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (193, '2026-09-23', 132, 124, 124
                    , 124, 124, 124, 124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 124, 124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+132, sellCostBuyPrice =sellCostBuyPrice+124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 132, 124, 124
                    , 124, 124, 124, 124
                    , 0, 0, 0, 0
                    , 0, 0, 0, 124, 124, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+132, sellCostBuyPrice =sellCostBuyPrice+124
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+124
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '182', userid = '1', storedetaildate = '2026-09-23 15:46:04' WHERE storedetailid = '193';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('193', '1', '8', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '190', '182', '1', '2026-09-23 15:46:04','0','0'); -- id=1473
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('41.28','00187', '104', '20', '187', '2', '48', '96', '0', '', '1', '2026-09-23 15:46:04', '187', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','48','96','0','','0','0.00','0','0','0','0'); -- id=688
UPDATE sellbilldetail SET  lastbuyprice = 41.28 , meanbuyprice = 41.28, lastbuyprice_withDiscount = 41.28, meanbuyprice_withDiscount = 41.28
        , lastbuyprice_withTax = 41.28, meanbuyprice_withTax = 41.28, lastbuyprice_withDiscountAndTax = 41.28
                where sellbilldetailid = 688;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (187, '2026-09-23', 96, 82.56, 82.56
                    , 82.56, 82.56, 82.56, 82.56
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 82.56, 82.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+96, sellCostBuyPrice =sellCostBuyPrice+82.56
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+82.56, sellCostMeanBuyPrice = sellCostMeanBuyPrice+82.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+82.56, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+82.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+82.56
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+82.56
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+82.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 96, 82.56, 82.56
                    , 82.56, 82.56, 82.56, 82.56
                    , 0, 0, 0, 0
                    , 0, 0, 0, 82.56, 82.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+96, sellCostBuyPrice =sellCostBuyPrice+82.56
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+82.56, sellCostMeanBuyPrice = sellCostMeanBuyPrice+82.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+82.56, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+82.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+82.56
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+82.56
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+82.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '566', userid = '1', storedetaildate = '2026-09-23 15:46:04' WHERE storedetailid = '187';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('187', '1', '2', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '568', '566', '1', '2026-09-23 15:46:04','0','0'); -- id=1474
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('120','00160', '104', '22', '160', '1', '140', '140', '0', '', '1', '2026-09-23 15:46:04', '160', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','140','140','0','','0','0.00','0','0','0','0'); -- id=689
UPDATE sellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 120.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 120.00
        , lastbuyprice_withTax = 120, meanbuyprice_withTax = 120, lastbuyprice_withDiscountAndTax = 120
                where sellbilldetailid = 689;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (160, '2026-09-23', 140, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 140, 120, 120
                    , 120, 120, 120, 120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 120, 120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140, sellCostBuyPrice =sellCostBuyPrice+120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '1', storedetaildate = '2026-09-23 15:46:05' WHERE storedetailid = '160';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('160', '1', '1', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '58', '57', '1', '2026-09-23 15:46:05','0','0'); -- id=1475
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '104', '1', '5', '20', '10.95', '219', '0', '', '1', '2026-09-23 15:46:05', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10.95','219','0','','0','0.00','0','0','0','0'); -- id=690
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 = 690;
 INSERT INTO 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-23', 219, 211, 211
                    , 211, 211, 211, 211
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 211, 211, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+219, sellCostBuyPrice =sellCostBuyPrice+211
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+211, sellCostMeanBuyPrice = sellCostMeanBuyPrice+211
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+211, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+211
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+211
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+211
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+211
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 219, 211, 211
                    , 211, 211, 211, 211
                    , 0, 0, 0, 0
                    , 0, 0, 0, 211, 211, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+219, sellCostBuyPrice =sellCostBuyPrice+211
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+211, sellCostMeanBuyPrice = sellCostMeanBuyPrice+211
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+211, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+211
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+211
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+211
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+211
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1470', userid = '1', storedetaildate = '2026-09-23 15:46:05' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '20', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1490', '1470', '1', '2026-09-23 15:46:05','0','0'); -- id=1476
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '104', '1', '9', '1', '319', '319', '0', '', '1', '2026-09-23 15:46:05', '9', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','319','319','0','','0','0.00','0','0','0','0'); -- id=691
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 = 691;
 INSERT INTO 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-23', 319, 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+319, 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-23', 319, 306, 306
                    , 306, 306, 306, 306
                    , 0, 0, 0, 0
                    , 0, 0, 0, 306, 306, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+319, 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 = '34', userid = '1', storedetaildate = '2026-09-23 15:46:05' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '1', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '34', '1', '2026-09-23 15:46:05','0','0'); -- id=1477
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('14','00206', '104', '6', '206', '12', '19', '228', '0', '', '1', '2026-09-23 15:46:06', '206', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','228','0','','0','0.00','0','0','0','0'); -- id=692
UPDATE sellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where sellbilldetailid = 692;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (206, '2026-09-23', 228, 168, 168
                    , 168, 168, 168, 168
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 168, 168, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228, sellCostBuyPrice =sellCostBuyPrice+168
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 228, 168, 168
                    , 168, 168, 168, 168
                    , 0, 0, 0, 0
                    , 0, 0, 0, 168, 168, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+228, sellCostBuyPrice =sellCostBuyPrice+168
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+168, sellCostMeanBuyPrice = sellCostMeanBuyPrice+168
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+168, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+168
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+168
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+168
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+168
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-23 15:46:06' WHERE storedetailid = '206';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('206', '1', '12', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '8', '1', '2026-09-23 15:46:06','0','0'); -- id=1478
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11','00207', '104', '6', '207', '1', '15', '15', '0', '', '1', '2026-09-23 15:46:06', '207', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','15','0','','0','0.00','0','0','0','0'); -- id=693
UPDATE sellbilldetail SET  lastbuyprice = 11.00 , meanbuyprice = 11.00, lastbuyprice_withDiscount = 11.00, meanbuyprice_withDiscount = 11.00
        , lastbuyprice_withTax = 11, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 11
                where sellbilldetailid = 693;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-09-23', 15, 11, 11
                    , 11, 11, 11, 11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 11, 11, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+11
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 15, 11, 11
                    , 11, 11, 11, 11
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11, 11, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15, sellCostBuyPrice =sellCostBuyPrice+11
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '134', userid = '1', storedetaildate = '2026-09-23 15:46:06' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '1', '1', '104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '135', '134', '1', '2026-09-23 15:46:06','0','0'); -- id=1479
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2816.78', '2816.78', '2026-09-23', '1', '0', '0', '2026-09-23 15:46:06','اضافة فاتورة مبيعات رقم 104','1','0',null,'0','104','sellbillController.php?do=showDetail&sellbillid=104'); -- id=804
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('804', '466', '2816.78', '','0'); -- id=804
UPDATE accountstree SET name = 'جمال', customName = 'جمال', customNameEn = 'جمال', nameEn = 'جمال', parent = '58', accountNature = '0', theValue = '2816.78', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 15:45:35' WHERE id = '466';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('804', '143', '2816.78', '','0'); -- id=804
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '330235.71', 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 ( '2628.22', '2628.22', '2026-09-23', '1', '0', '0', '2026-09-23 15:46:06','اضافة فاتورة مبيعات رقم 104 - صرف البضاعة من المخزن','1','0',null,'0','104','sellbillController.php?do=showDetail&sellbillid=104'); -- id=805
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('805', '402', '2628.22', '','0'); -- id=805
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '309567.74', 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 ('805', '382', '2628.22', '','0'); -- id=805
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2124813.83', 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='804,0,805' where sellbillid=104;
 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-23', 2816.78, 2628.22, 2628.22
                    , 2628.22, 2628.22, 2628.22, 2628.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2628.22, 2628.22, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2816.78, sellCostBuyPrice =sellCostBuyPrice+2628.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2628.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2628.22
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2628.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2628.22
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2628.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2628.22
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2628.22
                        , returnSellVal = returnSellVal+0, 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 (35, '2026-09-23', 2816.78, 2628.22, 2628.22
                    , 2628.22, 2628.22, 2628.22, 2628.22
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2628.22, 2628.22, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2816.78, sellCostBuyPrice =sellCostBuyPrice+2628.22
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2628.22, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2628.22
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2628.22, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2628.22
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2628.22
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2628.22
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2628.22
                        , returnSellVal = returnSellVal+0, 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, 2816.78, 2628.22, 2628.22
                    , 2628.22, 2628.22, 2628.22, 2628.22, 2628.22, 2628.22)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2816.78, netSellCostBuyPrice = netSellCostBuyPrice+2628.22
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2628.22
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2628.22
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2628.22
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2628.22
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2628.22
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2628.22
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2628.22;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3c48ad1182 and sellbillId = 104 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

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

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3d83b37aec
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(35,@clientdebt,@clientname,@treeIdis);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-09-23 15:50:07', '06ab3d83b37aec', '35', '2816.78', '870.78', '0', '1', '1946', '1946', '0', '-1946', '1', '2026-09-23 15:50:07', '', '1', '0', 'جمال','1', '1', '5', '0', 'جمال', '12', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','','0'); -- id=5
UPDATE client SET  clientdebt = '870.78', userid = '1' WHERE clientid = '35';
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 ('35','2816.78','1946','1','اضافة فاتورة مردوات مبيعات','5', '870.78', '2026-09-23 15:50:08', '1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1946', '0', null, '0', null, null,'', '0','1','1','1946','1','2026-09-23 15:50:07','0','0','',''); -- id=179
UPDATE client SET  inUse = 0 where clientid = 35;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('255.00', '00035', '5', '8', '35', '1', '345', '345', '0', '', '1', '0', '35', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','345','345','0','','0'); -- id=15
UPDATE returnsellbilldetail SET  lastbuyprice = 255.00 , meanbuyprice = 255.00, lastbuyprice_withDiscount = 255.00, meanbuyprice_withDiscount = 255.00
        , lastbuyprice_withTax = 255, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 255
                where returnsellbilldetailid = 15;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (35, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 345, 255, 255, 255
                    , 255, 255, 255, 0, 1, 0, 0, 255, 255)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+345, returnSellCostBuyPrice = returnSellCostBuyPrice+255, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+255
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+255, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+255
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+255
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+255
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+255
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+255
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 345, 255, 255, 255
                    , 255, 255, 255, 0, 0, 255, 255)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+345, returnSellCostBuyPrice = returnSellCostBuyPrice+255, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+255
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+255, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+255
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+255
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+255
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+255
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+255;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-09-23 15:50:08' WHERE storedetailid = '35';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('35', '1', '1', '0', '5', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '32', '33', '1', '2026-09-23 15:50:08','0','0'); -- id=1480
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('275.00', '00282', '5', '22', '282', '3', '305', '915', '0', '', '1', '0', '282', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','305','915','0','','0'); -- id=16
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 16;
 INSERT INTO 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-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 915, 825, 825, 825
                    , 825, 825, 825, 0, 3, 0, 0, 825, 825)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+915, returnSellCostBuyPrice = returnSellCostBuyPrice+825, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+825
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+825, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+825
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+825
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+825
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+825
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+825
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 915, 825, 825, 825
                    , 825, 825, 825, 0, 0, 825, 825)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+915, returnSellCostBuyPrice = returnSellCostBuyPrice+825, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+825
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+825, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+825
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+825
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+825
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+825
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+825;
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2026-09-23 15:50:09' WHERE storedetailid = '282';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('282', '1', '3', '0', '5', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '11', '14', '1', '2026-09-23 15:50:09','0','0'); -- id=1481
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('255.00', '00032', '5', '8', '32', '2', '295', '590', '0', '', '1', '0', '32', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','295','590','0','','0'); -- id=17
UPDATE returnsellbilldetail SET  lastbuyprice = 255.00 , meanbuyprice = 255.00, lastbuyprice_withDiscount = 255.00, meanbuyprice_withDiscount = 255.00
        , lastbuyprice_withTax = 255, meanbuyprice_withTax = 255, lastbuyprice_withDiscountAndTax = 255
                where returnsellbilldetailid = 17;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (32, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 590, 510, 510, 510
                    , 510, 510, 510, 0, 2, 0, 0, 510, 510)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+590, returnSellCostBuyPrice = returnSellCostBuyPrice+510, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+510
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+510, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+510
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+510
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+510
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+510
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+510
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+2;
 INSERT INTO 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-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 590, 510, 510, 510
                    , 510, 510, 510, 0, 0, 510, 510)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+590, returnSellCostBuyPrice = returnSellCostBuyPrice+510, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+510
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+510, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+510
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+510
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+510
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+510
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+510;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-09-23 15:50:09' WHERE storedetailid = '32';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('32', '1', '2', '0', '5', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '34', '36', '1', '2026-09-23 15:50:09','0','0'); -- id=1482
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('14.20', '00195', '5', '20', '195', '6', '16', '96', '0', '', '1', '0', '195', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','16','96','0','','0'); -- id=18
UPDATE returnsellbilldetail SET  lastbuyprice = 14.20 , meanbuyprice = 14.20, lastbuyprice_withDiscount = 14.20, meanbuyprice_withDiscount = 14.20
        , lastbuyprice_withTax = 14.2, meanbuyprice_withTax = 14.2, lastbuyprice_withDiscountAndTax = 14.2
                where returnsellbilldetailid = 18;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (195, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 96, 85.2, 85.2, 85.2
                    , 85.2, 85.2, 85.2, 0, 6, 0, 0, 85.2, 85.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+96, returnSellCostBuyPrice = returnSellCostBuyPrice+85.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+85.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+85.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+85.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+85.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+85.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+85.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+85.2
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+6;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 96, 85.2, 85.2, 85.2
                    , 85.2, 85.2, 85.2, 0, 0, 85.2, 85.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+96, returnSellCostBuyPrice = returnSellCostBuyPrice+85.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+85.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+85.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+85.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+85.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+85.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+85.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+85.2;
UPDATE storedetail SET  productquantity = '136', userid = '1', storedetaildate = '2026-09-23 15:50:09' WHERE storedetailid = '195';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('195', '1', '6', '0', '5', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '130', '136', '1', '2026-09-23 15:50:09','0','0'); -- id=1483
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1946', '1946', '2026-09-23', '1', '0', '0', '2026-09-23 15:50:09','اضافة فاتورة مردود مبيعات رقم 5','1','0',null,'0','5','returnsellbillController.php?do=showDetail&returnsellbillid=5'); -- id=806
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('806', '143', '1946', '','0'); -- id=806
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '328289.71', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('806', '466', '1946', '','0'); -- id=806
UPDATE accountstree SET name = 'جمال', customName = 'جمال', customNameEn = 'جمال', nameEn = 'جمال', parent = '58', accountNature = '0', theValue = '870.78', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 15:45:35' WHERE id = '466';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1675.2', '1675.2', '2026-09-23', '1', '0', '0', '2026-09-23 15:50:09','اضافة فاتورة مردود مبيعات رقم 5 - صرف البضاعة من المخزن','1','0',null,'0','5','returnsellbillController.php?do=showDetail&returnsellbillid=5'); -- id=807
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('807', '382', '1675.2', '','0'); -- id=807
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2126489.03', 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 ('807', '402', '1675.2', '','0'); -- id=807
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '307892.54', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
update returnsellbill set dailyentryid='806,0,807' where returnsellbillid=5;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1946, 1675.2, 1675.2, 1675.2
                    , 1675.2, 1675.2, 1675.2 ,0, 0, 1675.2, 1675.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1946, returnSellCostBuyPrice = returnSellCostBuyPrice+1675.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1675.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1675.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1675.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1675.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1675.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1675.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1675.2;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (35, '2026-09-23', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1946, 1675.2, 1675.2, 1675.2
                    , 1675.2, 1675.2, 1675.2 ,0, 0, 1675.2, 1675.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1946, returnSellCostBuyPrice = returnSellCostBuyPrice+1675.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1675.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1675.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1675.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1675.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1675.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1675.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1675.2;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1946, -1675.2, -1675.2
                    , -1675.2, -1675.2, -1675.2, -1675.2, -1675.2, -1675.2)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1946, netSellCostBuyPrice = netSellCostBuyPrice+-1675.2
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-1675.2
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-1675.2
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-1675.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-1675.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-1675.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-1675.2
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-1675.2;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3d83b37aec and sellbillId = 5 and returnsellbillId = 5
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:20:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 15:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 15:50:12', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=2130
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:30:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:00:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-23 16:00:51', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=2131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:30:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:00:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 16:00:55', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=2132
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:30:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:00:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-23 16:00:57', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:31:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:01:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 16:01:14', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=2134

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =180
-- ----------------------------------------------------------------------------------------------------

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

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:31:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:01:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 16:01:16', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=2135
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:31:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:01:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 16:01:18', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=2136
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:36:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:06:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 16:06:02', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:37:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:07:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 16:07:42', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2138

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab3dccb9e9b6
-- ----------------------------------------------------------------------------------------------------

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-23 16:07:42', '06ab3dccb9e9b6', '1', '0.00', '0', '0', '1', '273.90', '273.9', '273.9', '0', '1', '2026-09-23 16:07:42', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','273','0','','0','0','273.9','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','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=105
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','اضافة فاتورة مبيعات','105', '0', '2026-09-23 16:07:43', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '273.9', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-23 16:07:42','0','0','',''); -- id=181
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '105', '1', '1', '5', '54.78', '273.9', '0', '', '1', '2026-09-23 16:07:43', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','54.78','273.9','0','','0','0.00','0','0','0','0'); -- id=694
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 = 694;
 INSERT INTO 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-23', 273.9, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.9, sellCostBuyPrice =sellCostBuyPrice+263.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263.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+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-23', 273.9, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.9, sellCostBuyPrice =sellCostBuyPrice+263.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263.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 = '657', userid = '1', storedetaildate = '2026-09-23 16:07:44' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '5', '1', '105', 'اضافة فاتورة مبيعات', 'sellbillController.php', '662', '657', '1', '2026-09-23 16:07:44','0','0'); -- id=1484
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-257845.6625',  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 ('-258119.5625','273.9', '0', '1', 'اضافة فاتورة مبيعات', '105', '-257845.6625', '2026-09-23 16:07:44', '1',  'sellbillController.php','1','','0'); -- id=100
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '273.9', '273.9', '2026-09-23', '1', '0', '0', '2026-09-23 16:07:44','اضافة فاتورة مبيعات رقم 105','1','0',null,'0','105','sellbillController.php?do=showDetail&sellbillid=105'); -- id=809
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('809', '383', '273.9', '','0'); -- id=809
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-210478.64', 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 ('809', '143', '273.9', '','0'); -- id=809
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '328563.61', 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 ( '263.75', '263.75', '2026-09-23', '1', '0', '0', '2026-09-23 16:07:44','اضافة فاتورة مبيعات رقم 105 - صرف البضاعة من المخزن','1','0',null,'0','105','sellbillController.php?do=showDetail&sellbillid=105'); -- id=810
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('810', '402', '263.75', '','0'); -- id=810
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '308156.29', 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 ('810', '382', '263.75', '','0'); -- id=810
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2126225.28', 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='809,0,810' where sellbillid=105;
 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-23', 273.9, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.9, sellCostBuyPrice =sellCostBuyPrice+263.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 273.9, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+273.9, sellCostBuyPrice =sellCostBuyPrice+263.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+263.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+263.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+263.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+263.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+263.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+263.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+263.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 273.9, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75, 263.75, 263.75)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+273.9, netSellCostBuyPrice = netSellCostBuyPrice+263.75
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+263.75
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+263.75
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+263.75
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+263.75
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+263.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+263.75
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+263.75;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab3dccb9e9b6 and sellbillId = 105 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 12:37:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 16:07:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 16:07:45', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2139
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 14:06:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 17:36:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 17:36:36', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:23:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:53:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 18:53:41', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2141
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:26:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:56:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 18:56:28', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:27:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:57:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 18:57:09', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2143
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 ('لوحه 24 خط بالعمومي ','','3','1950','2000','2000','2000','2026-09-23','0','1','0','','0','0','0','0','0','1950','1950','1950','1950','1950','0','2.56','2.56','2.56','.','0','0','0','1950','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1950','1950','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1950','0','0','0','0','0','0','','','0','0','0','0'); -- id=448
UPDATE product SET productName = 'لوحه 24 خط بالعمومي ', productDescription = '', productCatId = '3', productBuyPrice = '1950', productSellAllPrice = '2000', productSellUnitPrice = '2000', productSellHalfPrice = '2000', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00448',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1950',lastbuyprice_withDiscount = '1950',meanbuyprice = '1950',meanbuyprice_withDiscount = '1950' , productbuypricereal = '1950' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '2.56',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1950',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='1950',meanbuyprice_withTax='1950',price4='0',price5='0',price6='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='1950',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '448';
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', '448', '1.00', '2026-09-23', '1', '0','0044801','2000','2000','2000','1950','','0','0','0','0','0','0','0','0','0','0'); -- id=448
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('448', '1', '2', '1', '2026-09-23'); -- id=448
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('448', '1', '2', '0', '448', 'إضافة منتج', 'productController.php', '0', '2', '1', '2026-09-23','0','0'); -- id=1485
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (448, 1,'2026-09-23 18:57:11',1)
                ON DUPLICATE KEY UPDATE productid = 448, edited = 1, sysdate = '2026-09-23 18:57:11', userid = 1; -- id=567
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3900', '3900', '2026-09-23', '1', '0', '0', '2026-09-23 18:57:11','إضافة منتج لوحه 24 خط بالعمومي  الكمية 2','1','0','0','0','448','productController.php?do=edit&id=448'); -- id=811
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('811', '382', '3900', '','0'); -- id=811
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2130125.28', 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 ('811', '121', '3900', '','0'); -- id=811
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1227829.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 = 'لوحه 24 خط بالعمومي ', productDescription = '', productCatId = '3', productBuyPrice = '1950.00', productSellAllPrice = '2000.00', productSellUnitPrice = '2000.00', productSellHalfPrice = '2000.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00448',type ='0', expireDate = '0' , dailyentryId = '811',isService = '0',isOptic = '0',lastbuyprice = '1950',lastbuyprice_withDiscount = '1950',meanbuyprice = '1950',meanbuyprice_withDiscount = '1950' , productbuypricereal = '1950' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '2.56',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1950',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='1950',meanbuyprice_withTax='1950',price4='0',price5='0',price6='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='1950',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '448';
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 ('لوحه اتصالات ','','3','875','925','925','925','2026-09-23','0','1','0','','0','0','0','0','0','875','875','875','875','875','0','5.71','5.71','5.71','.','0','0','0','875','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','875','875','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','875','0','0','0','0','0','0','','','0','0','0','0'); -- id=449
UPDATE product SET productName = 'لوحه اتصالات ', productDescription = '', productCatId = '3', productBuyPrice = '875', productSellAllPrice = '925', productSellUnitPrice = '925', productSellHalfPrice = '925', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00449',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '875',lastbuyprice_withDiscount = '875',meanbuyprice = '875',meanbuyprice_withDiscount = '875' , productbuypricereal = '875' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , buyhalf_precentage = '5.71' , buypart_precentage = '5.71',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='875',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='875',meanbuyprice_withTax='875',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='875',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '449';
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', '449', '1.00', '2026-09-23', '1', '0','0044901','925','925','925','875','','0','0','0','0','0','0','0','0','0','0'); -- id=449
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('449', '1', '2', '1', '2026-09-23'); -- id=449
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('449', '1', '2', '0', '449', 'إضافة منتج', 'productController.php', '0', '2', '1', '2026-09-23','0','0'); -- id=1486
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (449, 1,'2026-09-23 18:57:13',1)
                ON DUPLICATE KEY UPDATE productid = 449, edited = 1, sysdate = '2026-09-23 18:57:13', userid = 1; -- id=568
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1750', '1750', '2026-09-23', '1', '0', '0', '2026-09-23 18:57:13','إضافة منتج لوحه اتصالات  الكمية 2','1','0','0','0','449','productController.php?do=edit&id=449'); -- id=812
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('812', '382', '1750', '','0'); -- id=812
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2131875.28', 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 ('812', '121', '1750', '','0'); -- id=812
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1229579.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 = '3', productBuyPrice = '875.00', productSellAllPrice = '925.00', productSellUnitPrice = '925.00', productSellHalfPrice = '925.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00449',type ='0', expireDate = '0' , dailyentryId = '812',isService = '0',isOptic = '0',lastbuyprice = '875',lastbuyprice_withDiscount = '875',meanbuyprice = '875',meanbuyprice_withDiscount = '875' , productbuypricereal = '875' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , buyhalf_precentage = '5.71' , buypart_precentage = '5.71',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='875',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='875',meanbuyprice_withTax='875',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='875',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '449';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:27:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:57:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 18:57:15', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:28:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:58:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 18:58:37', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:29:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:59:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 18:59:04', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2146
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ab4053e50a6a', '2026-09-23 18:58:38', '9', '163321.40', '168571.4', '0', '0', '5250.00',  '5250.00', '0', '5250', '1', '2026-09-23 18:59:05', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=19
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00432', '19', '20', '432', '300', '17.5', '5250.00', '0', '', '2026-09-23 18:59:05', '432','','','0','0','0','0','0',null,'17.5','5250','0','0','0','0','0','0','0','0','1'); -- id=49
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 18:58:38', 1, 432, 0, 0
                    , 17.5, 300, 0, 0, 1, '2026-09-23 18:59:05')
                ON DUPLICATE KEY UPDATE buyprice = 17.5,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 18:59:05' ; -- id=49
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('432', '17.5', '300', '0', 'buyBillController.php', '49', '', '0', '0'); -- id=49
UPDATE product SET  productBuyPrice = "17.5" WHERE productId = 432 ;
UPDATE buybilldetail SET  quantitybefore = 30 WHERE buybilldetailid = 49 ;
UPDATE product SET productName = 'علبه ماجيك اسمارت ', productDescription = '', productCatId = '20', productBuyPrice = '17.50', productSellAllPrice = '18.25', productSellUnitPrice = '18.25', productSellHalfPrice = '18.25', productDate = '2026-09-21', conditions = '0', userId = '1', limitamount = '0', parcode = '00432',type ='0', expireDate = '0' , dailyentryId = '715',isService = '0',isOptic = '0',lastbuyprice = '17.5',lastbuyprice_withDiscount = '17.5',meanbuyprice = '17.5',meanbuyprice_withDiscount = '17.5' , productbuypricereal = '17.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.29' , buyhalf_precentage = '4.29' , buypart_precentage = '4.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='17.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='17.5',meanbuyprice_withTax='17.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='17.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '432';
UPDATE buybilldetail SET  lastbuyprice = 17.5 , meanbuyprice = 17.5, lastbuyprice_withDiscount = 17.5, meanbuyprice_withDiscount = 17.5
        , lastbuyprice_withTax = 17.5, meanbuyprice_withTax = 17.5, lastbuyprice_withDiscountAndTax = 17.5
                where buybilldetailid = 49;
UPDATE productunit SET proUnitBuyPrice  = 17.5 * productnumber WHERE productid = 432;
UPDATE storedetail SET  productquantity = '330', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '432';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '300', '0', '19', 'اضافة فاتورة مشتريات', 'buyBillController.php', '30', '330', '1', '2026-09-23 18:58:38','0','0'); -- id=1487
UPDATE supplier SET  suppliercurrentDebt = '168571.4',suppliercurrentDebtInCurrency= '168571.4' , userid = '1', supplierdate = '2026-09-23 18:59:05'   WHERE supplierid = '9';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('9', '163321.40', '5250', '0', 'اضافة فاتورة مشتريات', '19', '168571.4', '2026-09-23 18:58:38', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','5250','1','163321.4','5250','168571.4','0',''); -- id=42
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5250', '5250', '2026-09-23', '1', '0', '0', '2026-09-23 18:59:06','اضافة فاتورة مشتريات رقم 19','1','0',null,'0','19','buyBillController.php?do=details&id=19'); -- id=813
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('813', '382', '5250', '','0'); -- id=813
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2137125.28', 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 ('813', '432', '5250', '','0'); -- id=813
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '168571.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
update buybill set dailyentryid='813,0' where buybillid=19;
COMMIT;
UPDATE product SET overAllAveragePrice = 17.5 WHERE productId = 432;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:29:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 18:59:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 18:59:07', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=19'); -- id=2147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:31:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 19:01:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 19:01:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:32:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 19:02:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 19:02:05', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2149
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 ('كوفريه 3 خط ','','6','13','15','15','15','2026-09-23','0','1','0','','0','0','0','0','0','13','13','13','13','13','0','15.38','15.38','15.38','.','0','0','0','13','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','13','13','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','13','0','0','0','0','0','0','','','0','0','0','0'); -- id=450
UPDATE product SET productName = 'كوفريه 3 خط ', productDescription = '', productCatId = '6', productBuyPrice = '13', productSellAllPrice = '15', productSellUnitPrice = '15', productSellHalfPrice = '15', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00450',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '13',lastbuyprice_withDiscount = '13',meanbuyprice = '13',meanbuyprice_withDiscount = '13' , productbuypricereal = '13' , buypricereal_precentage = '0' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='13',meanbuyprice_withTax='13',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='13',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '450';
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', '450', '1.00', '2026-09-23', '1', '0','0045001','15','15','15','13','','0','0','0','0','0','0','0','0','0','0'); -- id=450
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('450', '1', '10', '1', '2026-09-23'); -- id=450
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('450', '1', '10', '0', '450', 'إضافة منتج', 'productController.php', '0', '10', '1', '2026-09-23','0','0'); -- id=1488
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (450, 1,'2026-09-23 19:02:06',1)
                ON DUPLICATE KEY UPDATE productid = 450, edited = 1, sysdate = '2026-09-23 19:02:06', userid = 1; -- id=569
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '130', '130', '2026-09-23', '1', '0', '0', '2026-09-23 19:02:06','إضافة منتج كوفريه 3 خط  الكمية 10','1','0','0','0','450','productController.php?do=edit&id=450'); -- id=814
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('814', '382', '130', '','0'); -- id=814
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2137255.28', 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 ('814', '121', '130', '','0'); -- id=814
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1229709.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 = 'كوفريه 3 خط ', productDescription = '', productCatId = '6', productBuyPrice = '13.00', productSellAllPrice = '15.00', productSellUnitPrice = '15.00', productSellHalfPrice = '15.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '0', parcode = '00450',type ='0', expireDate = '0' , dailyentryId = '814',isService = '0',isOptic = '0',lastbuyprice = '13',lastbuyprice_withDiscount = '13',meanbuyprice = '13',meanbuyprice_withDiscount = '13' , productbuypricereal = '13' , buypricereal_precentage = '0' , buytotal_precentage = '15.38' , buyhalf_precentage = '15.38' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='13',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='13',meanbuyprice_withTax='13',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='13',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '450';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:32:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 19:02:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 19:02:08', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2150
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:34:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 19:04:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 19:04:03', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2151

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab4041674983
-- ----------------------------------------------------------------------------------------------------

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-23 19:04:04', '06ab4041674983', '1', '0.00', '0', '0', '1', '24945.75', '24945.75', '24945.75', '0', '1', '2026-09-23 19:04:04', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '212.25' ,'0','','','','','-1','0','0','0','0','0','24945','0','','0','0','24945.75','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-23','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=106
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','اضافة فاتورة مبيعات','106', '0', '2026-09-23 19:04:05', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '24945.75', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-23 19:04:04','0','0','',''); -- id=182
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1000','00229', '106', '10', '229', '4', '1190', '4760', '0', '', '1', '2026-09-23 19:04:05', '229', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1190','4760','0','','0','0.00','0','0','0','0'); -- id=695
UPDATE sellbilldetail SET  lastbuyprice = 1000.00 , meanbuyprice = 1000.00, lastbuyprice_withDiscount = 1000.00, meanbuyprice_withDiscount = 1000.00
        , lastbuyprice_withTax = 1000, meanbuyprice_withTax = 1000, lastbuyprice_withDiscountAndTax = 1000
                where sellbilldetailid = 695;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (229, '2026-09-23', 4760, 4000, 4000
                    , 4000, 4000, 4000, 4000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 4000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4760, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 4760, 4000, 4000
                    , 4000, 4000, 4000, 4000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4760, sellCostBuyPrice =sellCostBuyPrice+4000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-23 19:04:05' WHERE storedetailid = '229';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('229', '1', '4', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '15', '1', '2026-09-23 19:04:05','0','0'); -- id=1489
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1917','00231', '106', '10', '231', '4', '2190', '8760', '0', '', '1', '2026-09-23 19:04:05', '231', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2190','8760','0','','0','0.00','0','0','0','0'); -- id=696
UPDATE sellbilldetail SET  lastbuyprice = 1917.00 , meanbuyprice = 1917.00, lastbuyprice_withDiscount = 1917.00, meanbuyprice_withDiscount = 1917.00
        , lastbuyprice_withTax = 1917, meanbuyprice_withTax = 1917, lastbuyprice_withDiscountAndTax = 1917
                where sellbilldetailid = 696;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (231, '2026-09-23', 8760, 7668, 7668
                    , 7668, 7668, 7668, 7668
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 7668, 7668, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8760, sellCostBuyPrice =sellCostBuyPrice+7668
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7668, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7668
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7668, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7668
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7668
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7668
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7668
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 8760, 7668, 7668
                    , 7668, 7668, 7668, 7668
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7668, 7668, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8760, sellCostBuyPrice =sellCostBuyPrice+7668
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7668, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7668
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7668, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7668
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7668
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7668
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7668
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-23 19:04:05' WHERE storedetailid = '231';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('231', '1', '4', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '8', '1', '2026-09-23 19:04:05','0','0'); -- id=1490
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1950','00448', '106', '3', '448', '2', '2000', '4000', '0', '', '1', '2026-09-23 19:04:06', '448', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2000','4000','0','','0','0.00','0','0','0','0'); -- id=697
UPDATE sellbilldetail SET  lastbuyprice = 1950.00 , meanbuyprice = 1950.00, lastbuyprice_withDiscount = 1950.00, meanbuyprice_withDiscount = 1950.00
        , lastbuyprice_withTax = 1950, meanbuyprice_withTax = 1950, lastbuyprice_withDiscountAndTax = 1950
                where sellbilldetailid = 697;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (448, '2026-09-23', 4000, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 4000, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4000, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-23 19:04:06' WHERE storedetailid = '448';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('448', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '0', '1', '2026-09-23 19:04:06','0','0'); -- id=1491
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('140','00221', '106', '13', '221', '4', '150', '600', '0', '', '1', '2026-09-23 19:04:06', '221', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','150','600','0','','0','0.00','0','0','0','0'); -- id=698
UPDATE sellbilldetail SET  lastbuyprice = 140.00 , meanbuyprice = 140.00, lastbuyprice_withDiscount = 140.00, meanbuyprice_withDiscount = 140.00
        , lastbuyprice_withTax = 140, meanbuyprice_withTax = 140, lastbuyprice_withDiscountAndTax = 140
                where sellbilldetailid = 698;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (221, '2026-09-23', 600, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 600, 560, 560
                    , 560, 560, 560, 560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 560, 560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-23 19:04:06' WHERE storedetailid = '221';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('221', '1', '4', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '15', '1', '2026-09-23 19:04:06','0','0'); -- id=1492
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('165','00220', '106', '13', '220', '2', '170', '340', '0', '', '1', '2026-09-23 19:04:06', '220', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','170','340','0','','0','0.00','0','0','0','0'); -- id=699
UPDATE sellbilldetail SET  lastbuyprice = 165.00 , meanbuyprice = 165.00, lastbuyprice_withDiscount = 165.00, meanbuyprice_withDiscount = 165.00
        , lastbuyprice_withTax = 165, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 165
                where sellbilldetailid = 699;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (220, '2026-09-23', 340, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 340, 330, 330
                    , 330, 330, 330, 330
                    , 0, 0, 0, 0
                    , 0, 0, 0, 330, 330, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+330
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+330
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+330
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-09-23 19:04:07' WHERE storedetailid = '220';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('220', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '1', '1', '2026-09-23 19:04:07','0','0'); -- id=1493
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '106', '14', '81', '7', '19', '133', '0', '', '1', '2026-09-23 19:04:07', '81', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','19','133','0','','0','0.00','0','0','0','0'); -- id=700
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 = 700;
 INSERT INTO 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-23', 133, 126, 126
                    , 126, 126, 126, 126
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 126, 126, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+133, sellCostBuyPrice =sellCostBuyPrice+126
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+126, sellCostMeanBuyPrice = sellCostMeanBuyPrice+126
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+126, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+126
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+126
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+126
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+126
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 133, 126, 126
                    , 126, 126, 126, 126
                    , 0, 0, 0, 0
                    , 0, 0, 0, 126, 126, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+133, sellCostBuyPrice =sellCostBuyPrice+126
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+126, sellCostMeanBuyPrice = sellCostMeanBuyPrice+126
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+126, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+126
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+126
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+126
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+126
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '594', userid = '1', storedetaildate = '2026-09-23 19:04:07' WHERE storedetailid = '81';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '7', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '601', '594', '1', '2026-09-23 19:04:07','0','0'); -- id=1494
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 where id = 49;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('17.5','00432', '106', '20', '432', '50', '18.25', '912.5', '0', '', '1', '2026-09-23 19:04:07', '432', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','49-50,','1','1','0','0','18.25','912.5','0','','0','0.00','0','0','0','0'); -- id=701
UPDATE sellbilldetail SET  lastbuyprice = 17.50 , meanbuyprice = 17.50, lastbuyprice_withDiscount = 17.50, meanbuyprice_withDiscount = 17.50
        , lastbuyprice_withTax = 17.5, meanbuyprice_withTax = 17.5, lastbuyprice_withDiscountAndTax = 17.5
                where sellbilldetailid = 701;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (432, '2026-09-23', 912.5, 875, 875
                    , 875, 875, 875, 875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 875, 875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+912.5, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 912.5, 875, 875
                    , 875, 875, 875, 875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 875, 875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+912.5, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '280', userid = '1', storedetaildate = '2026-09-23 19:04:07' WHERE storedetailid = '432';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '50', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '330', '280', '1', '2026-09-23 19:04:07','0','0'); -- id=1495
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('8.5','00385', '106', '12', '385', '35', '9.8', '343', '0', '', '1', '2026-09-23 19:04:07', '385', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','9.8','343','0','','0','0.00','0','0','0','0'); -- id=702
UPDATE sellbilldetail SET  lastbuyprice = 8.50 , meanbuyprice = 8.50, lastbuyprice_withDiscount = 8.50, meanbuyprice_withDiscount = 8.50
        , lastbuyprice_withTax = 8.5, meanbuyprice_withTax = 8.5, lastbuyprice_withDiscountAndTax = 8.5
                where sellbilldetailid = 702;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (385, '2026-09-23', 343, 297.5, 297.5
                    , 297.5, 297.5, 297.5, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 0, 297.5, 297.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+343, sellCostBuyPrice =sellCostBuyPrice+297.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+297.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+297.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+297.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+297.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+297.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+297.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+35
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 343, 297.5, 297.5
                    , 297.5, 297.5, 297.5, 297.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 297.5, 297.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+343, sellCostBuyPrice =sellCostBuyPrice+297.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+297.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+297.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+297.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+297.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+297.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+297.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+297.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 = '5', userid = '1', storedetaildate = '2026-09-23 19:04:08' WHERE storedetailid = '385';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('385', '1', '35', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '5', '1', '2026-09-23 19:04:08','0','0'); -- id=1496
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11.1','00088', '106', '12', '88', '25', '11.3', '282.5', '0', '', '1', '2026-09-23 19:04:08', '88', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','11.3','282.5','0','','0','0.00','0','0','0','0'); -- id=703
UPDATE sellbilldetail SET  lastbuyprice = 11.10 , meanbuyprice = 11.10, lastbuyprice_withDiscount = 11.10, meanbuyprice_withDiscount = 11.10
        , lastbuyprice_withTax = 11.1, meanbuyprice_withTax = 11.1, lastbuyprice_withDiscountAndTax = 11.1
                where sellbilldetailid = 703;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (88, '2026-09-23', 282.5, 277.5, 277.5
                    , 277.5, 277.5, 277.5, 277.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 277.5, 277.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+282.5, sellCostBuyPrice =sellCostBuyPrice+277.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+277.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+277.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+277.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+277.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277.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+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 282.5, 277.5, 277.5
                    , 277.5, 277.5, 277.5, 277.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 277.5, 277.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+282.5, sellCostBuyPrice =sellCostBuyPrice+277.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+277.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+277.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+277.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+277.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+277.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 = '128', userid = '1', storedetaildate = '2026-09-23 19:04:08' WHERE storedetailid = '88';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '25', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '153', '128', '1', '2026-09-23 19:04:08','0','0'); -- id=1497
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 48;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('39.6','00083', '106', '12', '83', '5', '45', '225', '0', '', '1', '2026-09-23 19:04:08', '83', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','48-5,','1','1','0','0','45','225','0','','0','0.00','0','0','0','0'); -- id=704
UPDATE sellbilldetail SET  lastbuyprice = 39.60 , meanbuyprice = 40.90, lastbuyprice_withDiscount = 39.60, meanbuyprice_withDiscount = 40.90
        , lastbuyprice_withTax = 39.6, meanbuyprice_withTax = 40.9, lastbuyprice_withDiscountAndTax = 39.6
                where sellbilldetailid = 704;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (83, '2026-09-23', 225, 198, 198
                    , 204.5, 198, 204.5, 198
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 198, 204.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+198
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+198, sellCostMeanBuyPrice = sellCostMeanBuyPrice+204.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+198, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+204.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+198
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+198
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+204.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 225, 198, 198
                    , 204.5, 198, 204.5, 198
                    , 0, 0, 0, 0
                    , 0, 0, 0, 198, 204.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+225, sellCostBuyPrice =sellCostBuyPrice+198
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+198, sellCostMeanBuyPrice = sellCostMeanBuyPrice+204.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+198, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+204.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+198
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+198
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+204.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 = '284', userid = '1', storedetaildate = '2026-09-23 19:04:08' WHERE storedetailid = '83';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('83', '1', '5', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '289', '284', '1', '2026-09-23 19:04:08','0','0'); -- id=1498
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 47;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('30.8','00082', '106', '12', '82', '3', '34', '102', '0', '', '1', '2026-09-23 19:04:08', '82', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','47-3,','1','1','0','0','34','102','0','','0','0.00','0','0','0','0'); -- id=705
UPDATE sellbilldetail SET  lastbuyprice = 30.80 , meanbuyprice = 30.80, lastbuyprice_withDiscount = 30.80, meanbuyprice_withDiscount = 30.80
        , lastbuyprice_withTax = 30.8, meanbuyprice_withTax = 30.8, lastbuyprice_withDiscountAndTax = 30.8
                where sellbilldetailid = 705;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (82, '2026-09-23', 102, 92.4, 92.4
                    , 92.4, 92.4, 92.4, 92.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 92.4, 92.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+102, sellCostBuyPrice =sellCostBuyPrice+92.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+92.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+92.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+92.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+92.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+92.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+92.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+92.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 102, 92.4, 92.4
                    , 92.4, 92.4, 92.4, 92.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 92.4, 92.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+102, sellCostBuyPrice =sellCostBuyPrice+92.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+92.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+92.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+92.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+92.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+92.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+92.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+92.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '345', userid = '1', storedetaildate = '2026-09-23 19:04:09' WHERE storedetailid = '82';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('82', '1', '3', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '348', '345', '1', '2026-09-23 19:04:09','0','0'); -- id=1499
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('50','00152', '106', '22', '152', '20', '50', '1000', '0', '', '1', '2026-09-23 19:04:09', '152', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','50','1000','0','','0','0.00','0','0','0','0'); -- id=706
UPDATE sellbilldetail SET  lastbuyprice = 50.00 , meanbuyprice = 50.00, lastbuyprice_withDiscount = 50.00, meanbuyprice_withDiscount = 50.00
        , lastbuyprice_withTax = 50, meanbuyprice_withTax = 50, lastbuyprice_withDiscountAndTax = 50
                where sellbilldetailid = 706;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (152, '2026-09-23', 1000, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 1000, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-09-23 19:04:09' WHERE storedetailid = '152';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('152', '1', '20', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '44', '24', '1', '2026-09-23 19:04:09','0','0'); -- id=1500
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('6.5','00315', '106', '6', '315', '20', '8', '160', '0', '', '1', '2026-09-23 19:04:09', '315', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','160','0','','0','0.00','0','0','0','0'); -- id=707
UPDATE sellbilldetail SET  lastbuyprice = 6.50 , meanbuyprice = 6.50, lastbuyprice_withDiscount = 6.50, meanbuyprice_withDiscount = 6.50
        , lastbuyprice_withTax = 6.5, meanbuyprice_withTax = 6.5, lastbuyprice_withDiscountAndTax = 6.5
                where sellbilldetailid = 707;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (315, '2026-09-23', 160, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+160, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 160, 130, 130
                    , 130, 130, 130, 130
                    , 0, 0, 0, 0
                    , 0, 0, 0, 130, 130, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+160, sellCostBuyPrice =sellCostBuyPrice+130
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+130, sellCostMeanBuyPrice = sellCostMeanBuyPrice+130
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+130, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+130
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+130
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+130
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+130
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '765', userid = '1', storedetaildate = '2026-09-23 19:04:09' WHERE storedetailid = '315';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('315', '1', '20', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '785', '765', '1', '2026-09-23 19:04:09','0','0'); -- id=1501
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('101','00107', '106', '3', '107', '2', '103', '206', '0', '', '1', '2026-09-23 19:04:09', '107', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','23-2,','1','1','0','0','103','206','0','','0','0.00','0','0','0','0'); -- id=708
UPDATE sellbilldetail SET  lastbuyprice = 101.00 , meanbuyprice = 101.00, lastbuyprice_withDiscount = 101.00, meanbuyprice_withDiscount = 101.00
        , lastbuyprice_withTax = 101, meanbuyprice_withTax = 101, lastbuyprice_withDiscountAndTax = 101
                where sellbilldetailid = 708;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (107, '2026-09-23', 206, 202, 202
                    , 202, 202, 202, 202
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 202, 202, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+206, sellCostBuyPrice =sellCostBuyPrice+202
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+202, sellCostMeanBuyPrice = sellCostMeanBuyPrice+202
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+202, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+202
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+202
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+202
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+202
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 206, 202, 202
                    , 202, 202, 202, 202
                    , 0, 0, 0, 0
                    , 0, 0, 0, 202, 202, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+206, sellCostBuyPrice =sellCostBuyPrice+202
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+202, sellCostMeanBuyPrice = sellCostMeanBuyPrice+202
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+202, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+202
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+202
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+202
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+202
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '85', userid = '1', storedetaildate = '2026-09-23 19:04:10' WHERE storedetailid = '107';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('107', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '87', '85', '1', '2026-09-23 19:04:10','0','0'); -- id=1502
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('232','00113', '106', '3', '113', '2', '240', '480', '0', '', '1', '2026-09-23 19:04:10', '113', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','240','480','0','','0','0.00','0','0','0','0'); -- id=709
UPDATE sellbilldetail SET  lastbuyprice = 232.00 , meanbuyprice = 232.00, lastbuyprice_withDiscount = 232.00, meanbuyprice_withDiscount = 232.00
        , lastbuyprice_withTax = 232, meanbuyprice_withTax = 232, lastbuyprice_withDiscountAndTax = 232
                where sellbilldetailid = 709;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (113, '2026-09-23', 480, 464, 464
                    , 464, 464, 464, 464
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 464, 464, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+464
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+464, sellCostMeanBuyPrice = sellCostMeanBuyPrice+464
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+464
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+464
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+464
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+464
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 480, 464, 464
                    , 464, 464, 464, 464
                    , 0, 0, 0, 0
                    , 0, 0, 0, 464, 464, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+464
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+464, sellCostMeanBuyPrice = sellCostMeanBuyPrice+464
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+464, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+464
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+464
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+464
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+464
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-23 19:04:10' WHERE storedetailid = '113';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('113', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '2', '1', '2026-09-23 19:04:10','0','0'); -- id=1503
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('13','00450', '106', '6', '450', '2', '15', '30', '0', '', '1', '2026-09-23 19:04:10', '450', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','15','30','0','','0','0.00','0','0','0','0'); -- id=710
UPDATE sellbilldetail SET  lastbuyprice = 13.00 , meanbuyprice = 13.00, lastbuyprice_withDiscount = 13.00, meanbuyprice_withDiscount = 13.00
        , lastbuyprice_withTax = 13, meanbuyprice_withTax = 13, lastbuyprice_withDiscountAndTax = 13
                where sellbilldetailid = 710;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (450, '2026-09-23', 30, 26, 26
                    , 26, 26, 26, 26
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 26, 26, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+26
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 30, 26, 26
                    , 26, 26, 26, 26
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26, 26, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+26
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-23 19:04:10' WHERE storedetailid = '450';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('450', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '8', '1', '2026-09-23 19:04:10','0','0'); -- id=1504
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 34;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('12','00344', '106', '6', '344', '2', '15', '30', '0', '', '1', '2026-09-23 19:04:10', '344', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','34-2,','1','1','0','0','15','30','0','','0','0.00','0','0','0','0'); -- id=711
UPDATE sellbilldetail SET  lastbuyprice = 12.00 , meanbuyprice = 12.00, lastbuyprice_withDiscount = 12.00, meanbuyprice_withDiscount = 12.00
        , lastbuyprice_withTax = 12, meanbuyprice_withTax = 12, lastbuyprice_withDiscountAndTax = 12
                where sellbilldetailid = 711;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (344, '2026-09-23', 30, 24, 24
                    , 24, 24, 24, 24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 24, 24, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+24
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 30, 24, 24
                    , 24, 24, 24, 24
                    , 0, 0, 0, 0
                    , 0, 0, 0, 24, 24, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+24
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-23 19:04:11' WHERE storedetailid = '344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('344', '1', '2', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '30', '1', '2026-09-23 19:04:11','0','0'); -- id=1505
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('875','00449', '106', '3', '449', '1', '925', '925', '0', '', '1', '2026-09-23 19:04:11', '449', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','925','925','0','','0','0.00','0','0','0','0'); -- id=712
UPDATE sellbilldetail SET  lastbuyprice = 875.00 , meanbuyprice = 875.00, lastbuyprice_withDiscount = 875.00, meanbuyprice_withDiscount = 875.00
        , lastbuyprice_withTax = 875, meanbuyprice_withTax = 875, lastbuyprice_withDiscountAndTax = 875
                where sellbilldetailid = 712;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (449, '2026-09-23', 925, 875, 875
                    , 875, 875, 875, 875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 875, 875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+925, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-23', 925, 875, 875
                    , 875, 875, 875, 875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 875, 875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+925, sellCostBuyPrice =sellCostBuyPrice+875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-09-23 19:04:11' WHERE storedetailid = '449';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('449', '1', '1', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '1', '2026-09-23 19:04:11','0','0'); -- id=1506
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.82','00388', '106', '20', '388', '20', '5.25', '105', '0', '', '1', '2026-09-23 19:04:11', '388', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','25-20,','1','1','0','0','5.25','105','0','','0','0.00','0','0','0','0'); -- id=713
UPDATE sellbilldetail SET  lastbuyprice = 4.82 , meanbuyprice = 4.82, lastbuyprice_withDiscount = 4.82, meanbuyprice_withDiscount = 4.82
        , lastbuyprice_withTax = 4.82, meanbuyprice_withTax = 4.82, lastbuyprice_withDiscountAndTax = 4.82
                where sellbilldetailid = 713;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (388, '2026-09-23', 105, 96.4, 96.4
                    , 96.4, 96.4, 96.4, 96.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 96.4, 96.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+105, sellCostBuyPrice =sellCostBuyPrice+96.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+96.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+96.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+96.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+96.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+96.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+96.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+96.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 105, 96.4, 96.4
                    , 96.4, 96.4, 96.4, 96.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 96.4, 96.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+105, sellCostBuyPrice =sellCostBuyPrice+96.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+96.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+96.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+96.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+96.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+96.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+96.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+96.4
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1193', userid = '1', storedetaildate = '2026-09-23 19:04:11' WHERE storedetailid = '388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('388', '1', '20', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1213', '1193', '1', '2026-09-23 19:04:11','0','0'); -- id=1507
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('5.5','00419', '106', '6', '419', '1', '8', '8', '0', '', '1', '2026-09-23 19:04:11', '419', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','8','8','0','','0','0.00','0','0','0','0'); -- id=714
UPDATE sellbilldetail SET  lastbuyprice = 5.50 , meanbuyprice = 5.50, lastbuyprice_withDiscount = 5.50, meanbuyprice_withDiscount = 5.50
        , lastbuyprice_withTax = 5.5, meanbuyprice_withTax = 5.5, lastbuyprice_withDiscountAndTax = 5.5
                where sellbilldetailid = 714;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (419, '2026-09-23', 8, 5.5, 5.5
                    , 5.5, 5.5, 5.5, 5.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 5.5, 5.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8, sellCostBuyPrice =sellCostBuyPrice+5.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 8, 5.5, 5.5
                    , 5.5, 5.5, 5.5, 5.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5.5, 5.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8, sellCostBuyPrice =sellCostBuyPrice+5.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5.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 = '63', userid = '1', storedetaildate = '2026-09-23 19:04:12' WHERE storedetailid = '419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('419', '1', '1', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '64', '63', '1', '2026-09-23 19:04:12','0','0'); -- id=1508
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('82','00080', '106', '14', '80', '.25', '95', '23.75', '0', '', '1', '2026-09-23 19:04:12', '80', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','95','23.75','0','','0','0.00','0','0','0','0'); -- id=715
UPDATE sellbilldetail SET  lastbuyprice = 82.00 , meanbuyprice = 82.00, lastbuyprice_withDiscount = 82.00, meanbuyprice_withDiscount = 82.00
        , lastbuyprice_withTax = 82, meanbuyprice_withTax = 82, lastbuyprice_withDiscountAndTax = 82
                where sellbilldetailid = 715;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (80, '2026-09-23', 23.75, 20.5, 20.5
                    , 20.5, 20.5, 20.5, 20.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.25, 0, 20.5, 20.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23.75, sellCostBuyPrice =sellCostBuyPrice+20.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 23.75, 20.5, 20.5
                    , 20.5, 20.5, 20.5, 20.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20.5, 20.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+23.75, sellCostBuyPrice =sellCostBuyPrice+20.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8.5', userid = '1', storedetaildate = '2026-09-23 19:04:12' WHERE storedetailid = '80';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '0.25', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8.75', '8.5', '1', '2026-09-23 19:04:12','0','0'); -- id=1509
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1320','00230', '106', '10', '230', '1', '1520', '1520', '0', '', '1', '2026-09-23 19:04:12', '230', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1520','1520','0','','0','0.00','0','0','0','0'); -- id=716
UPDATE sellbilldetail SET  lastbuyprice = 1320.00 , meanbuyprice = 1320.00, lastbuyprice_withDiscount = 1320.00, meanbuyprice_withDiscount = 1320.00
        , lastbuyprice_withTax = 1320, meanbuyprice_withTax = 1320, lastbuyprice_withDiscountAndTax = 1320
                where sellbilldetailid = 716;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (230, '2026-09-23', 1520, 1320, 1320
                    , 1320, 1320, 1320, 1320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-23', 1520, 1320, 1320
                    , 1320, 1320, 1320, 1320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1520, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-23 19:04:12' WHERE storedetailid = '230';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('230', '1', '1', '1', '106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '5', '1', '2026-09-23 19:04:12','0','0'); -- id=1510
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-232899.90625',  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 ('-257845.65625','24945.75', '0', '1', 'اضافة فاتورة مبيعات', '106', '-232899.90625', '2026-09-23 19:04:13', '1',  'sellbillController.php','1','','0'); -- id=101
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '24945.75', '24945.75', '2026-09-23', '1', '0', '0', '2026-09-23 19:04:13','اضافة فاتورة مبيعات رقم 106','1','0',null,'0','106','sellbillController.php?do=showDetail&sellbillid=106'); -- id=815
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('815', '383', '24945.75', '','0'); -- id=815
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-185532.89', 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 ('815', '143', '24945.75', '','0'); -- id=815
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '353509.36', 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 ( '22487.8', '22487.8', '2026-09-23', '1', '0', '0', '2026-09-23 19:04:13','اضافة فاتورة مبيعات رقم 106 - صرف البضاعة من المخزن','1','0',null,'0','106','sellbillController.php?do=showDetail&sellbillid=106'); -- id=816
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('816', '402', '22487.8', '','0'); -- id=816
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '330644.09', 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 ('816', '382', '22487.8', '','0'); -- id=816
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2114767.48', 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='815,0,816' where sellbillid=106;
 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-23', 24945.75, 22487.8, 22487.8
                    , 22494.3, 22487.8, 22494.3, 22487.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,22487.8, 22494.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+24945.75, sellCostBuyPrice =sellCostBuyPrice+22487.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22487.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22494.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22487.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22494.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22487.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22487.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22494.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-23', 24945.75, 22487.8, 22487.8
                    , 22494.3, 22487.8, 22494.3, 22487.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,22487.8, 22494.3, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+24945.75, sellCostBuyPrice =sellCostBuyPrice+22487.8
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+22487.8, sellCostMeanBuyPrice = sellCostMeanBuyPrice+22494.3
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+22487.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+22494.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+22487.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+22487.8
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22494.3
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 24945.75, 22487.8, 22487.8
                    , 22494.3, 22487.8, 22494.3, 22487.8, 22487.8, 22494.3)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+24945.75, netSellCostBuyPrice = netSellCostBuyPrice+22487.8
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+22487.8
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+22494.3
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+22487.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+22494.3
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+22487.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+22487.8
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+22494.3;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab4041674983 and sellbillId = 106 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 15:34:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 19:04:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 19:04:14', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 17:53:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:23:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 21:23:39', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=106'); -- id=2153
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:11:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:41:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:41:56', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:42:10', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:42:17', '1', 'details', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=details&id=8'); -- id=2156
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:42:32', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:42:38', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2158
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:44";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-23 21:42:44', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=editprint&id=11'); -- id=2159
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:42:50', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:12:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:42:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:42:57', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2161
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:13:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:43:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:43:03', '1', 'details', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=details&id=8'); -- id=2162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:13:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:43:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 21:43:30', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2163
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:13:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:43:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 21:43:47', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2164
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:14:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:44:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-23 21:44:07', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:14:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:44:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:44:22', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:14:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:44:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:44:31', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2167
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:14:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:44:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:44:39', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=editprint&id=23'); -- id=2168
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:14:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:44:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:44:48', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2169
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('شركه الصقر اب لايت ', '', '', '1386', '', '0', '1', '2026-09-23 21:45:29', '0', '', '','0','0','','','','','','','','','','0','0','1','1386','0','0'); -- id=15
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('15', '0', '1386', '0', 'إضافة مورد جديد', '15', '1386', '2026-09-23 21:45:29', '1', 'supplierController.php', '', '0','', '0','1','1','1386','1','0','0','0','0',''); -- id=43
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('شركه الصقر اب لايت ', 'شركه الصقر اب لايت ', 'شركه الصقر اب لايت ', 'شركه الصقر اب لايت ', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-23 21:45:29'); -- id=467
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1386', '1386', '2026-09-23', '1', '0', '0', '2026-09-23 21:45:30','إضافة مورد شركه الصقر اب لايت ','1','0','0','0','0',''); -- id=817
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('817', '121', '1386', '','0'); -- id=817
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1228323.87', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('817', '467', '1386', '','0'); -- id=817
UPDATE accountstree SET name = 'شركه الصقر اب لايت ', customName = 'شركه الصقر اب لايت ', customNameEn = 'شركه الصقر اب لايت ', nameEn = 'شركه الصقر اب لايت ', parent = '81', accountNature = '1', theValue = '1386', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 21:45:29' WHERE id = '467';
COMMIT;
UPDATE supplier SET suppliername = 'شركه الصقر اب لايت ', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '1386.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-23', dailyentryid = '817', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='467',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='1386',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '15';
UPDATE productunit SET unitid = '1', productid = '202', productnumber = '1.00', productunitdate = '2026-09-15', userid = '1', conditions = '0',proUnitParcode='0020201',proUnitSellAllPrice='1350',proUnitSellHalfPrice='1350',proUnitSellUnitPrice ='1550',proUnitBuyPrice='1250',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '202';
UPDATE product SET productName = 'بكره ليد ويرليس دبل ورم', productDescription = '', productCatId = '6', productBuyPrice = '1282', productSellAllPrice = '1350', productSellUnitPrice = '1550', productSellHalfPrice = '1350', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00202',type ='0', expireDate = '0' , dailyentryId = '229',isService = '0',isOptic = '0',lastbuyprice = '1250.00',lastbuyprice_withDiscount = '1250',meanbuyprice = '1250.00',meanbuyprice_withDiscount = '1250' , productbuypricereal = '1250' , buypricereal_precentage = '0' , buytotal_precentage = '8' , buyhalf_precentage = '8' , buypart_precentage = '24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1250',meanbuyprice_withTax='1250',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1250',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '202';
INSERT INTO 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 ('متر ليد ويرليس تربل 3 لمبه ','','6','21.5','23.5','24.5','23.5','2026-09-23','0','1','1','','0','0','0','0','0','21.5','21.5','21.5','21.5','21.5','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','21.5','21.5','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=451
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (451, 1,'2026-09-23 21:47:23',1)
                ON DUPLICATE KEY UPDATE productid = 451, edited = 1, sysdate = '2026-09-23 21:47:23', userid = 1; -- id=570
UPDATE product SET productName = 'متر ليد ويرليس تربل 3 لمبه ', productDescription = '', productCatId = '6', productBuyPrice = '21.5', productSellAllPrice = '23.5', productSellUnitPrice = '24.5', productSellHalfPrice = '23.5', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00451',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '21.5',lastbuyprice_withDiscount = '21.5',meanbuyprice = '21.5',meanbuyprice_withDiscount = '21.5' , productbuypricereal = '21.5' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='21.5',meanbuyprice_withTax='21.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '451';
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', '451', '1', '2026-09-23', '1', '0','0045101','23.5','23.5','24.5','21.5','','0','0','0','0','0','0','0','0','0','0'); -- id=451
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('451', '1', '0', '1', '2026-09-23'); -- id=451
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('451', '1', '0', '0', '451', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1511
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 ('باور سبلاي 200 وات اب لايت ','','6','168','190','215','190','2026-09-23','0','1','1','','0','0','0','0','0','168','168','168','168','168','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','168','168','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=452
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (452, 1,'2026-09-23 21:48:09',1)
                ON DUPLICATE KEY UPDATE productid = 452, edited = 1, sysdate = '2026-09-23 21:48:09', userid = 1; -- id=571
UPDATE product SET productName = 'باور سبلاي 200 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '168', productSellAllPrice = '190', productSellUnitPrice = '215', productSellHalfPrice = '190', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00452',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '168',lastbuyprice_withDiscount = '168',meanbuyprice = '168',meanbuyprice_withDiscount = '168' , productbuypricereal = '168' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='168',meanbuyprice_withTax='168',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '452';
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', '452', '1', '2026-09-23', '1', '0','0045201','190','190','215','168','','0','0','0','0','0','0','0','0','0','0'); -- id=452
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('452', '1', '0', '1', '2026-09-23'); -- id=452
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('452', '1', '0', '0', '452', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1512
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 ('باور سبلاي 300 وات اب لايت ','','6','212','235','250','235','2026-09-23','0','1','1','','0','0','0','0','0','212','212','212','212','212','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','212','212','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=453
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (453, 1,'2026-09-23 21:48:50',1)
                ON DUPLICATE KEY UPDATE productid = 453, edited = 1, sysdate = '2026-09-23 21:48:50', userid = 1; -- id=572
UPDATE product SET productName = 'باور سبلاي 300 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '212', productSellAllPrice = '235', productSellUnitPrice = '250', productSellHalfPrice = '235', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00453',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '212',lastbuyprice_withDiscount = '212',meanbuyprice = '212',meanbuyprice_withDiscount = '212' , productbuypricereal = '212' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='212',meanbuyprice_withTax='212',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '453';
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', '453', '1', '2026-09-23', '1', '0','0045301','235','235','250','212','','0','0','0','0','0','0','0','0','0','0'); -- id=453
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('453', '1', '0', '1', '2026-09-23'); -- id=453
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('453', '1', '0', '0', '453', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1513
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('باور سبلاي 400 وات اب لايت ','','6','224','250','300','250','2026-09-23','0','1','1','','0','0','0','0','0','224','224','224','224','224','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','224','224','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=454
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (454, 1,'2026-09-23 21:49:28',1)
                ON DUPLICATE KEY UPDATE productid = 454, edited = 1, sysdate = '2026-09-23 21:49:28', userid = 1; -- id=573
UPDATE product SET productName = 'باور سبلاي 400 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '224', productSellAllPrice = '250', productSellUnitPrice = '300', productSellHalfPrice = '250', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00454',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '224',lastbuyprice_withDiscount = '224',meanbuyprice = '224',meanbuyprice_withDiscount = '224' , productbuypricereal = '224' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='224',meanbuyprice_withTax='224',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '454';
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', '454', '1', '2026-09-23', '1', '0','0045401','250','250','300','224','','0','0','0','0','0','0','0','0','0','0'); -- id=454
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('454', '1', '0', '1', '2026-09-23'); -- id=454
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('454', '1', '0', '0', '454', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1514
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:20:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:50:12', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2170
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ab42c30a9ed7', '2026-09-23 21:44:48', '15', '1386.00', '23108', '0', '0', '36742.00',  '36742.00', '15020', '21722', '1', '2026-09-23 21:50:13', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=20
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00202', '20', '6', '202', '6', '1282', '7692.00', '0', '', '2026-09-23 21:50:13', '202','','','0','0','0','0','0',null,'1282','7692','0','0','0','0','0','0','0','0','1'); -- id=50
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:44:48', 1, 202, 0, 0
                    , 1282, 6, 0, 0, 1, '2026-09-23 21:50:13')
                ON DUPLICATE KEY UPDATE buyprice = 1282,
                        buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:50:13' ; -- id=50
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('202', '1282', '6', '0', 'buyBillController.php', '50', '', '0', '0'); -- id=50
UPDATE product SET  productBuyPrice = "1282" WHERE productId = 202 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 50 ;
UPDATE product SET productName = 'بكره ليد ويرليس دبل ورم', productDescription = '', productCatId = '6', productBuyPrice = '1282.00', productSellAllPrice = '1350.00', productSellUnitPrice = '1550.00', productSellHalfPrice = '1350.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00202',type ='0', expireDate = '0' , dailyentryId = '229',isService = '0',isOptic = '0',lastbuyprice = '1282',lastbuyprice_withDiscount = '1282',meanbuyprice = '1271.33',meanbuyprice_withDiscount = '1271.33' , productbuypricereal = '1250.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '8.00' , buypart_precentage = '24.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1282',meanbuyprice_withTax='1271.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1282',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '202';
UPDATE buybilldetail SET  lastbuyprice = 1282 , meanbuyprice = 1271.33, lastbuyprice_withDiscount = 1282, meanbuyprice_withDiscount = 1271.33
        , lastbuyprice_withTax = 1282, meanbuyprice_withTax = 1271.33, lastbuyprice_withDiscountAndTax = 1282
                where buybilldetailid = 50;
UPDATE productunit SET proUnitBuyPrice  = 1282 * productnumber WHERE productid = 202;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '202';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('202', '1', '6', '0', '20', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '9', '1', '2026-09-23 21:44:48','0','0'); -- id=1515
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00451', '20', '6', '451', '100', '21.5', '2150.00', '0', '', '2026-09-23 21:50:13', '451','','','0','0','0','0','0',null,'21.5','2150','0','0','0','0','0','0','0','0','1'); -- id=51
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:44:48', 1, 451, 0, 0
                    , 21.5, 100, 0, 0, 1, '2026-09-23 21:50:14')
                ON DUPLICATE KEY UPDATE buyprice = 21.5,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:50:14' ; -- id=51
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('451', '21.5', '100', '0', 'buyBillController.php', '51', '', '0', '0'); -- id=51
UPDATE product SET  productBuyPrice = "21.5" WHERE productId = 451 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 51 ;
UPDATE product SET productName = 'متر ليد ويرليس تربل 3 لمبه ', productDescription = '', productCatId = '6', productBuyPrice = '21.50', productSellAllPrice = '23.50', productSellUnitPrice = '24.50', productSellHalfPrice = '23.50', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00451',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '21.5',lastbuyprice_withDiscount = '21.5',meanbuyprice = '21.5',meanbuyprice_withDiscount = '21.5' , productbuypricereal = '21.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='21.5',meanbuyprice_withTax='21.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='21.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '451';
UPDATE buybilldetail SET  lastbuyprice = 21.5 , meanbuyprice = 21.5, lastbuyprice_withDiscount = 21.5, meanbuyprice_withDiscount = 21.5
        , lastbuyprice_withTax = 21.5, meanbuyprice_withTax = 21.5, lastbuyprice_withDiscountAndTax = 21.5
                where buybilldetailid = 51;
UPDATE productunit SET proUnitBuyPrice  = 21.5 * productnumber WHERE productid = 451;
UPDATE storedetail SET  productquantity = '100', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '451';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('451', '1', '100', '0', '20', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '100', '1', '2026-09-23 21:44:48','0','0'); -- id=1516
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00452', '20', '6', '452', '50', '168', '8400.00', '0', '', '2026-09-23 21:50:13', '452','','','0','0','0','0','0',null,'168','8400','0','0','0','0','0','0','0','0','1'); -- id=52
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:44:48', 1, 452, 0, 0
                    , 168, 50, 0, 0, 1, '2026-09-23 21:50:15')
                ON DUPLICATE KEY UPDATE buyprice = 168,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:50:15' ; -- id=52
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('452', '168', '50', '0', 'buyBillController.php', '52', '', '0', '0'); -- id=52
UPDATE product SET  productBuyPrice = "168" WHERE productId = 452 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 52 ;
UPDATE product SET productName = 'باور سبلاي 200 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '168.00', productSellAllPrice = '190.00', productSellUnitPrice = '215.00', productSellHalfPrice = '190.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00452',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '168',lastbuyprice_withDiscount = '168',meanbuyprice = '168',meanbuyprice_withDiscount = '168' , productbuypricereal = '168.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='168',meanbuyprice_withTax='168',price4='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='168',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '452';
UPDATE buybilldetail SET  lastbuyprice = 168 , meanbuyprice = 168, lastbuyprice_withDiscount = 168, meanbuyprice_withDiscount = 168
        , lastbuyprice_withTax = 168, meanbuyprice_withTax = 168, lastbuyprice_withDiscountAndTax = 168
                where buybilldetailid = 52;
UPDATE productunit SET proUnitBuyPrice  = 168 * productnumber WHERE productid = 452;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '452';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('452', '1', '50', '0', '20', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '1', '2026-09-23 21:44:48','0','0'); -- id=1517
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00453', '20', '6', '453', '45', '212', '9540.00', '0', '', '2026-09-23 21:50:13', '453','','','0','0','0','0','0',null,'212','9540','0','0','0','0','0','0','0','0','1'); -- id=53
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:44:48', 1, 453, 0, 0
                    , 212, 45, 0, 0, 1, '2026-09-23 21:50:16')
                ON DUPLICATE KEY UPDATE buyprice = 212,
                        buyQuantity =buyQuantity+45, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:50:16' ; -- id=53
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('453', '212', '45', '0', 'buyBillController.php', '53', '', '0', '0'); -- id=53
UPDATE product SET  productBuyPrice = "212" WHERE productId = 453 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 53 ;
UPDATE product SET productName = 'باور سبلاي 300 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '212.00', productSellAllPrice = '235.00', productSellUnitPrice = '250.00', productSellHalfPrice = '235.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00453',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '212',lastbuyprice_withDiscount = '212',meanbuyprice = '212',meanbuyprice_withDiscount = '212' , productbuypricereal = '212.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='212',meanbuyprice_withTax='212',price4='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='212',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '453';
UPDATE buybilldetail SET  lastbuyprice = 212 , meanbuyprice = 212, lastbuyprice_withDiscount = 212, meanbuyprice_withDiscount = 212
        , lastbuyprice_withTax = 212, meanbuyprice_withTax = 212, lastbuyprice_withDiscountAndTax = 212
                where buybilldetailid = 53;
UPDATE productunit SET proUnitBuyPrice  = 212 * productnumber WHERE productid = 453;
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '453';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('453', '1', '45', '0', '20', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '45', '1', '2026-09-23 21:44:48','0','0'); -- id=1518
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00454', '20', '6', '454', '40', '224', '8960.00', '0', '', '2026-09-23 21:50:13', '454','','','0','0','0','0','0',null,'224','8960','0','0','0','0','0','0','0','0','1'); -- id=54
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:44:48', 1, 454, 0, 0
                    , 224, 40, 0, 0, 1, '2026-09-23 21:50:17')
                ON DUPLICATE KEY UPDATE buyprice = 224,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:50:17' ; -- id=54
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('454', '224', '40', '0', 'buyBillController.php', '54', '', '0', '0'); -- id=54
UPDATE product SET  productBuyPrice = "224" WHERE productId = 454 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 54 ;
UPDATE product SET productName = 'باور سبلاي 400 وات اب لايت ', productDescription = '', productCatId = '6', productBuyPrice = '224.00', productSellAllPrice = '250.00', productSellUnitPrice = '300.00', productSellHalfPrice = '250.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00454',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '224',lastbuyprice_withDiscount = '224',meanbuyprice = '224',meanbuyprice_withDiscount = '224' , productbuypricereal = '224.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='224',meanbuyprice_withTax='224',price4='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='224',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '454';
UPDATE buybilldetail SET  lastbuyprice = 224 , meanbuyprice = 224, lastbuyprice_withDiscount = 224, meanbuyprice_withDiscount = 224
        , lastbuyprice_withTax = 224, meanbuyprice_withTax = 224, lastbuyprice_withDiscountAndTax = 224
                where buybilldetailid = 54;
UPDATE productunit SET proUnitBuyPrice  = 224 * productnumber WHERE productid = 454;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '454';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('454', '1', '40', '0', '20', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-23 21:44:48','0','0'); -- id=1519
UPDATE supplier SET  suppliercurrentDebt = '23108',suppliercurrentDebtInCurrency= '23108' , userid = '1', supplierdate = '2026-09-23 21:50:13'   WHERE supplierid = '15';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('15', '1386.00', '21722', '0', 'اضافة فاتورة مشتريات', '20', '23108', '2026-09-23 21:44:48', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','21722','1','1386','21722','23108','0',''); -- id=44
UPDATE save SET  savecurrentvalue = '-247919.91',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-232899.91','15020', '1', '1', 'اضافة فاتورة مشتريات', '20', '-247919.91', '2026-09-23 21:44:48', '1',  'buyBillController.php','0','','0'); -- id=102
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '36742', '36742', '2026-09-23', '1', '0', '0', '2026-09-23 21:50:18','اضافة فاتورة مشتريات رقم 20','1','0',null,'0','20','buyBillController.php?do=details&id=20'); -- id=818
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('818', '382', '36742', '','0'); -- id=818
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2151509.48', 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 ('818', '467', '36742', '','0'); -- id=818
UPDATE accountstree SET name = 'شركه الصقر اب لايت ', customName = 'شركه الصقر اب لايت ', customNameEn = 'شركه الصقر اب لايت ', nameEn = 'شركه الصقر اب لايت ', parent = '81', accountNature = '1', theValue = '38128', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 21:45:29' WHERE id = '467';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15020', '15020', '2026-09-23', '1', '0', '0', '2026-09-23 21:50:18','اضافة فاتورة مشتريات رقم 20 - سداد الفاتورة للمورد','1','0',null,'0','20','buyBillController.php?do=details&id=20'); -- id=819
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('819', '467', '15020', '','0'); -- id=819
UPDATE accountstree SET name = 'شركه الصقر اب لايت ', customName = 'شركه الصقر اب لايت ', customNameEn = 'شركه الصقر اب لايت ', nameEn = 'شركه الصقر اب لايت ', parent = '81', accountNature = '1', theValue = '23108', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 21:45:29' WHERE id = '467';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('819', '383', '15020', '','0'); -- id=819
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-200552.89', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
update buybill set dailyentryid='818,819' where buybillid=20;
COMMIT;
UPDATE product SET overAllAveragePrice = 1282 WHERE productId = 202;UPDATE product SET overAllAveragePrice = 21.5 WHERE productId = 451;UPDATE product SET overAllAveragePrice = 168 WHERE productId = 452;UPDATE product SET overAllAveragePrice = 212 WHERE productId = 453;UPDATE product SET overAllAveragePrice = 224 WHERE productId = 454;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:20:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:50:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:50:19', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=20'); -- id=2171
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:20:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:50:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:50:33', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:20:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:50:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 21:50:40', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:20:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:50:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:50:50', '1', 'details', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=details&id=20'); -- id=2174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:21:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:51:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:51:10', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2175
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('زر جرس عريض رمادي ','','1','100','102','105','102','2026-09-23','0','1','1','','0','0','0','0','0','100','100','100','100','100','0','0','0','0','','0','0','0','0','0','','','0','0','0','','0','0','0','','','','','0','0','0','0','','0','0','','0','','100','100','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=455
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (455, 1,'2026-09-23 21:56:45',1)
                ON DUPLICATE KEY UPDATE productid = 455, edited = 1, sysdate = '2026-09-23 21:56:45', userid = 1; -- id=574
UPDATE product SET productName = 'زر جرس عريض رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '100', productSellAllPrice = '102', productSellUnitPrice = '105', productSellHalfPrice = '102', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00455',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '100',lastbuyprice_withDiscount = '100',meanbuyprice = '100',meanbuyprice_withDiscount = '100' , productbuypricereal = '100' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='100',meanbuyprice_withTax='100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '455';
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', '455', '1', '2026-09-23', '1', '0','0045501','102','102','105','100','','0','0','0','0','0','0','0','0','0','0'); -- id=455
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('455', '1', '0', '1', '2026-09-23'); -- id=455
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('455', '1', '0', '0', '455', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-23','0','0'); -- id=1520
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:28:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:58:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:58:20', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2176
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ab42daf27c13', '2026-09-23 21:51:11', '3', '61105.00', '61105', '0', '0', '97803.40',  '97803.40', '97803.4', '0', '1', '2026-09-23 21:58:21', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=21
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00355', '21', '1', '355', '200', '52.79', '10558.00', '0', '', '2026-09-23 21:58:21', '355','','','0','0','0','0','0',null,'52.79','10558','0','0','0','0','0','0','0','0','1'); -- id=55
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 355, 0, 0
                    , 52.79, 200, 0, 0, 1, '2026-09-23 21:58:21')
                ON DUPLICATE KEY UPDATE buyprice = 52.79,
                        buyQuantity =buyQuantity+200, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:21' ; -- id=55
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('355', '52.79', '200', '0', 'buyBillController.php', '55', '', '0', '0'); -- id=55
UPDATE product SET  productBuyPrice = "52.79" WHERE productId = 355 ;
UPDATE buybilldetail SET  quantitybefore = 72 WHERE buybilldetailid = 55 ;
UPDATE product SET productName = 'وش بالشاسيه رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '52.79', productSellAllPrice = '53.33', productSellUnitPrice = '54.78', productSellHalfPrice = '53.33', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00355',type ='0', expireDate = '0' , dailyentryId = '442',isService = '0',isOptic = '0',lastbuyprice = '52.79',lastbuyprice_withDiscount = '52.79',meanbuyprice = '52.79',meanbuyprice_withDiscount = '52.79' , productbuypricereal = '52.79' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.02' , buyhalf_precentage = '1.02' , buypart_precentage = '3.77',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='52.79',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='52.79',meanbuyprice_withTax='52.79',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='52.79',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '355';
UPDATE buybilldetail SET  lastbuyprice = 52.79 , meanbuyprice = 52.79, lastbuyprice_withDiscount = 52.79, meanbuyprice_withDiscount = 52.79
        , lastbuyprice_withTax = 52.79, meanbuyprice_withTax = 52.79, lastbuyprice_withDiscountAndTax = 52.79
                where buybilldetailid = 55;
UPDATE productunit SET proUnitBuyPrice  = 52.79 * productnumber WHERE productid = 355;
UPDATE storedetail SET  productquantity = '272', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('355', '1', '200', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '72', '272', '1', '2026-09-23 21:51:11','0','0'); -- id=1521
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00040', '21', '1', '40', '36', '121.4', '4370.40', '0', '', '2026-09-23 21:58:21', '40','','','0','0','0','0','0',null,'121.4','4370.4','0','0','0','0','0','0','0','0','1'); -- id=56
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 40, 0, 0
                    , 121.4, 36, 0, 0, 1, '2026-09-23 21:58:22')
                ON DUPLICATE KEY UPDATE buyprice = 121.4,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:22' ; -- id=56
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('40', '121.4', '36', '0', 'buyBillController.php', '56', '', '0', '0'); -- id=56
UPDATE product SET  productBuyPrice = "121.4" WHERE productId = 40 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 56 ;
UPDATE product SET productName = 'مفتاح 4 طرف اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '121.40', productSellAllPrice = '123.00', productSellUnitPrice = '128.00', productSellHalfPrice = '123.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '10', parcode = '00040',type ='0', expireDate = '0' , dailyentryId = '52',isService = '0',isOptic = '0',lastbuyprice = '121.4',lastbuyprice_withDiscount = '121.4',meanbuyprice = '121.4',meanbuyprice_withDiscount = '121.4' , productbuypricereal = '121.40' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.32' , buyhalf_precentage = '1.32' , buypart_precentage = '5.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='121.4',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='121.4',meanbuyprice_withTax='121.4',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='121.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '40';
UPDATE buybilldetail SET  lastbuyprice = 121.4 , meanbuyprice = 121.4, lastbuyprice_withDiscount = 121.4, meanbuyprice_withDiscount = 121.4
        , lastbuyprice_withTax = 121.4, meanbuyprice_withTax = 121.4, lastbuyprice_withDiscountAndTax = 121.4
                where buybilldetailid = 56;
UPDATE productunit SET proUnitBuyPrice  = 121.4 * productnumber WHERE productid = 40;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '40';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('40', '1', '36', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '60', '1', '2026-09-23 21:51:11','0','0'); -- id=1522
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00015', '21', '1', '15', '36', '163', '5868.00', '0', '', '2026-09-23 21:58:21', '15','','','0','0','0','0','0',null,'163','5868','0','0','0','0','0','0','0','0','1'); -- id=57
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 15, 0, 0
                    , 163, 36, 0, 0, 1, '2026-09-23 21:58:23')
                ON DUPLICATE KEY UPDATE buyprice = 163,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:23' ; -- id=57
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15', '163', '36', '0', 'buyBillController.php', '57', '', '0', '0'); -- id=57
UPDATE product SET  productBuyPrice = "163" WHERE productId = 15 ;
UPDATE buybilldetail SET  quantitybefore = 69 WHERE buybilldetailid = 57 ;
UPDATE product SET productName = 'لقمه سخان 20 امبير اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '163.00', productSellAllPrice = '165.00', productSellUnitPrice = '170.00', productSellHalfPrice = '165.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '36', parcode = '00015',type ='0', expireDate = '0' , dailyentryId = '20',isService = '0',isOptic = '0',lastbuyprice = '163',lastbuyprice_withDiscount = '163',meanbuyprice = '163',meanbuyprice_withDiscount = '163' , productbuypricereal = '163.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.23' , buyhalf_precentage = '1.23' , buypart_precentage = '4.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='163',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='163',meanbuyprice_withTax='163',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='163',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '15';
UPDATE buybilldetail SET  lastbuyprice = 163 , meanbuyprice = 163, lastbuyprice_withDiscount = 163, meanbuyprice_withDiscount = 163
        , lastbuyprice_withTax = 163, meanbuyprice_withTax = 163, lastbuyprice_withDiscountAndTax = 163
                where buybilldetailid = 57;
UPDATE productunit SET proUnitBuyPrice  = 163 * productnumber WHERE productid = 15;
UPDATE storedetail SET  productquantity = '105', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '15';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '1', '36', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '69', '105', '1', '2026-09-23 21:51:11','0','0'); -- id=1523
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00357', '21', '1', '357', '180', '34.8', '6264.00', '0', '', '2026-09-23 21:58:21', '357','','','0','0','0','0','0',null,'34.8','6264','0','0','0','0','0','0','0','0','1'); -- id=58
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 357, 0, 0
                    , 34.8, 180, 0, 0, 1, '2026-09-23 21:58:24')
                ON DUPLICATE KEY UPDATE buyprice = 34.8,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:24' ; -- id=58
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('357', '34.8', '180', '0', 'buyBillController.php', '58', '', '0', '0'); -- id=58
UPDATE product SET  productBuyPrice = "34.8" WHERE productId = 357 ;
UPDATE buybilldetail SET  quantitybefore = 186 WHERE buybilldetailid = 58 ;
UPDATE product SET productName = 'مفتاح مفرد رمادي', productDescription = '', productCatId = '1', productBuyPrice = '34.80', productSellAllPrice = '34.90', productSellUnitPrice = '36.00', productSellHalfPrice = '34.90', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00357',type ='0', expireDate = '0' , dailyentryId = '444',isService = '0',isOptic = '0',lastbuyprice = '34.8',lastbuyprice_withDiscount = '34.8',meanbuyprice = '34.8',meanbuyprice_withDiscount = '34.8' , productbuypricereal = '34.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.29' , buyhalf_precentage = '0.29' , buypart_precentage = '3.45',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34.8',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34.8',meanbuyprice_withTax='34.8',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '357';
UPDATE buybilldetail SET  lastbuyprice = 34.8 , meanbuyprice = 34.8, lastbuyprice_withDiscount = 34.8, meanbuyprice_withDiscount = 34.8
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where buybilldetailid = 58;
UPDATE productunit SET proUnitBuyPrice  = 34.8 * productnumber WHERE productid = 357;
UPDATE storedetail SET  productquantity = '366', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('357', '1', '180', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '186', '366', '1', '2026-09-23 21:51:11','0','0'); -- id=1524
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00356', '21', '1', '356', '180', '34.8', '6264.00', '0', '', '2026-09-23 21:58:21', '356','','','0','0','0','0','0',null,'34.8','6264','0','0','0','0','0','0','0','0','1'); -- id=59
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 356, 0, 0
                    , 34.8, 180, 0, 0, 1, '2026-09-23 21:58:25')
                ON DUPLICATE KEY UPDATE buyprice = 34.8,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:25' ; -- id=59
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('356', '34.8', '180', '0', 'buyBillController.php', '59', '', '0', '0'); -- id=59
UPDATE product SET  productBuyPrice = "34.8" WHERE productId = 356 ;
UPDATE buybilldetail SET  quantitybefore = 169 WHERE buybilldetailid = 59 ;
UPDATE product SET productName = 'بريزه مفرد رمادي', productDescription = '', productCatId = '1', productBuyPrice = '34.80', productSellAllPrice = '34.90', productSellUnitPrice = '36.00', productSellHalfPrice = '34.90', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00356',type ='0', expireDate = '0' , dailyentryId = '443',isService = '0',isOptic = '0',lastbuyprice = '34.8',lastbuyprice_withDiscount = '34.8',meanbuyprice = '34.8',meanbuyprice_withDiscount = '34.8' , productbuypricereal = '34.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.29' , buyhalf_precentage = '0.29' , buypart_precentage = '3.45',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34.8',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34.8',meanbuyprice_withTax='34.8',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '356';
UPDATE buybilldetail SET  lastbuyprice = 34.8 , meanbuyprice = 34.8, lastbuyprice_withDiscount = 34.8, meanbuyprice_withDiscount = 34.8
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where buybilldetailid = 59;
UPDATE productunit SET proUnitBuyPrice  = 34.8 * productnumber WHERE productid = 356;
UPDATE storedetail SET  productquantity = '349', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '356';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('356', '1', '180', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '169', '349', '1', '2026-09-23 21:51:11','0','0'); -- id=1525
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00361', '21', '1', '361', '36', '63', '2268.00', '0', '', '2026-09-23 21:58:21', '361','','','0','0','0','0','0',null,'63','2268','0','0','0','0','0','0','0','0','1'); -- id=60
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 361, 0, 0
                    , 63, 36, 0, 0, 1, '2026-09-23 21:58:26')
                ON DUPLICATE KEY UPDATE buyprice = 63,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:26' ; -- id=60
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('361', '63', '36', '0', 'buyBillController.php', '60', '', '0', '0'); -- id=60
UPDATE product SET  productBuyPrice = "63" WHERE productId = 361 ;
UPDATE buybilldetail SET  quantitybefore = 22 WHERE buybilldetailid = 60 ;
UPDATE product SET productName = 'مفتاح ديفاتيري رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '63.00', productSellAllPrice = '64.00', productSellUnitPrice = '66.00', productSellHalfPrice = '64.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00361',type ='0', expireDate = '0' , dailyentryId = '448',isService = '0',isOptic = '0',lastbuyprice = '63',lastbuyprice_withDiscount = '63',meanbuyprice = '63',meanbuyprice_withDiscount = '63' , productbuypricereal = '63.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.59' , buyhalf_precentage = '1.59' , buypart_precentage = '4.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='63',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='63',meanbuyprice_withTax='63',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='63',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '361';
UPDATE buybilldetail SET  lastbuyprice = 63 , meanbuyprice = 63, lastbuyprice_withDiscount = 63, meanbuyprice_withDiscount = 63
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where buybilldetailid = 60;
UPDATE productunit SET proUnitBuyPrice  = 63 * productnumber WHERE productid = 361;
UPDATE storedetail SET  productquantity = '58', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '361';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('361', '1', '36', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '22', '58', '1', '2026-09-23 21:51:11','0','0'); -- id=1526
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00362', '21', '1', '362', '36', '95', '3420.00', '0', '', '2026-09-23 21:58:21', '362','','','0','0','0','0','0',null,'95','3420','0','0','0','0','0','0','0','0','1'); -- id=61
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 362, 0, 0
                    , 95, 36, 0, 0, 1, '2026-09-23 21:58:27')
                ON DUPLICATE KEY UPDATE buyprice = 95,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:27' ; -- id=61
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('362', '95', '36', '0', 'buyBillController.php', '61', '', '0', '0'); -- id=61
UPDATE product SET  productBuyPrice = "95" WHERE productId = 362 ;
UPDATE buybilldetail SET  quantitybefore = 19 WHERE buybilldetailid = 61 ;
UPDATE product SET productName = 'مفتاح مجوز رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '95.00', productSellAllPrice = '96.00', productSellUnitPrice = '98.00', productSellHalfPrice = '96.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00362',type ='0', expireDate = '0' , dailyentryId = '449',isService = '0',isOptic = '0',lastbuyprice = '95',lastbuyprice_withDiscount = '95',meanbuyprice = '95',meanbuyprice_withDiscount = '95' , productbuypricereal = '95.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.05' , buyhalf_precentage = '1.05' , buypart_precentage = '3.16',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='95',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='95',meanbuyprice_withTax='95',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='95',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '362';
UPDATE buybilldetail SET  lastbuyprice = 95 , meanbuyprice = 95, lastbuyprice_withDiscount = 95, meanbuyprice_withDiscount = 95
        , lastbuyprice_withTax = 95, meanbuyprice_withTax = 95, lastbuyprice_withDiscountAndTax = 95
                where buybilldetailid = 61;
UPDATE productunit SET proUnitBuyPrice  = 95 * productnumber WHERE productid = 362;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '362';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('362', '1', '36', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '19', '55', '1', '2026-09-23 21:51:11','0','0'); -- id=1527
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00006', '21', '1', '6', '40', '105', '4200.00', '0', '', '2026-09-23 21:58:21', '6','','','0','0','0','0','0',null,'105','4200','0','0','0','0','0','0','0','0','1'); -- id=62
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 6, 0, 0
                    , 105, 40, 0, 0, 1, '2026-09-23 21:58:28')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:28' ; -- id=62
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('6', '105', '40', '0', 'buyBillController.php', '62', '', '0', '0'); -- id=62
UPDATE product SET  productBuyPrice = "105" WHERE productId = 6 ;
UPDATE buybilldetail SET  quantitybefore = 145 WHERE buybilldetailid = 62 ;
UPDATE product SET productName = 'بريزه ام كي اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '109.00', productSellHalfPrice = '106.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '40', parcode = '00006',type ='0', expireDate = '0' , dailyentryId = '11',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '6';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 62;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 6;
UPDATE storedetail SET  productquantity = '185', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '40', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '145', '185', '1', '2026-09-23 21:51:11','0','0'); -- id=1528
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00011', '21', '1', '11', '60', '105', '6300.00', '0', '', '2026-09-23 21:58:21', '11','','','0','0','0','0','0',null,'105','6300','0','0','0','0','0','0','0','0','1'); -- id=63
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 11, 0, 0
                    , 105, 60, 0, 0, 1, '2026-09-23 21:58:28')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:28' ; -- id=63
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('11', '105', '60', '0', 'buyBillController.php', '63', '', '0', '0'); -- id=63
UPDATE product SET  productBuyPrice = "105" WHERE productId = 11 ;
UPDATE buybilldetail SET  quantitybefore = 73 WHERE buybilldetailid = 63 ;
UPDATE product SET productName = 'بريزه مجوفه اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '109.00', productSellHalfPrice = '106.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '20', parcode = '00011',type ='0', expireDate = '0' , dailyentryId = '16',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '11';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 63;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 11;
UPDATE storedetail SET  productquantity = '133', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '60', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '73', '133', '1', '2026-09-23 21:51:11','0','0'); -- id=1529
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00359', '21', '1', '359', '40', '105', '4200.00', '0', '', '2026-09-23 21:58:21', '359','','','0','0','0','0','0',null,'105','4200','0','0','0','0','0','0','0','0','1'); -- id=64
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 359, 0, 0
                    , 105, 40, 0, 0, 1, '2026-09-23 21:58:29')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:29' ; -- id=64
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('359', '105', '40', '0', 'buyBillController.php', '64', '', '0', '0'); -- id=64
UPDATE product SET  productBuyPrice = "105" WHERE productId = 359 ;
UPDATE buybilldetail SET  quantitybefore = 17 WHERE buybilldetailid = 64 ;
UPDATE product SET productName = 'بريزه ام كي رمادي', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '106.00', productSellHalfPrice = '106.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00359',type ='0', expireDate = '0' , dailyentryId = '446',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '0.95',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '359';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 64;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 359;
UPDATE storedetail SET  productquantity = '57', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '359';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('359', '1', '40', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '17', '57', '1', '2026-09-23 21:51:11','0','0'); -- id=1530
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00358', '21', '1', '358', '40', '105', '4200.00', '0', '', '2026-09-23 21:58:21', '358','','','0','0','0','0','0',null,'105','4200','0','0','0','0','0','0','0','0','1'); -- id=65
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 358, 0, 0
                    , 105, 40, 0, 0, 1, '2026-09-23 21:58:30')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:30' ; -- id=65
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('358', '105', '40', '0', 'buyBillController.php', '65', '', '0', '0'); -- id=65
UPDATE product SET  productBuyPrice = "105" WHERE productId = 358 ;
UPDATE buybilldetail SET  quantitybefore = 21 WHERE buybilldetailid = 65 ;
UPDATE product SET productName = 'بريزه مجوفه رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '109.00', productSellHalfPrice = '106.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00358',type ='0', expireDate = '0' , dailyentryId = '445',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '358';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 65;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 358;
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '358';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('358', '1', '40', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '21', '61', '1', '2026-09-23 21:51:11','0','0'); -- id=1531
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00360', '21', '1', '360', '500', '10.55', '5275.00', '0', '', '2026-09-23 21:58:21', '360','','','0','0','0','0','0',null,'10.55','5275','0','0','0','0','0','0','0','0','1'); -- id=66
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 360, 0, 0
                    , 10.55, 500, 0, 0, 1, '2026-09-23 21:58:31')
                ON DUPLICATE KEY UPDATE buyprice = 10.55,
                        buyQuantity =buyQuantity+500, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:31' ; -- id=66
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('360', '10.55', '500', '0', 'buyBillController.php', '66', '', '0', '0'); -- id=66
UPDATE product SET  productBuyPrice = "10.55" WHERE productId = 360 ;
UPDATE buybilldetail SET  quantitybefore = 169 WHERE buybilldetailid = 66 ;
UPDATE product SET productName = 'سداده رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '10.55', productSellAllPrice = '10.65', productSellUnitPrice = '10.95', productSellHalfPrice = '10.65', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00360',type ='0', expireDate = '0' , dailyentryId = '447',isService = '0',isOptic = '0',lastbuyprice = '10.55',lastbuyprice_withDiscount = '10.55',meanbuyprice = '10.55',meanbuyprice_withDiscount = '10.55' , productbuypricereal = '10.55' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.79',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10.55',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='10.55',meanbuyprice_withTax='10.55',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='10.55',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '360';
UPDATE buybilldetail 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 buybilldetailid = 66;
UPDATE productunit SET proUnitBuyPrice  = 10.55 * productnumber WHERE productid = 360;
UPDATE storedetail SET  productquantity = '669', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('360', '1', '500', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '169', '669', '1', '2026-09-23 21:51:11','0','0'); -- id=1532
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00016', '21', '1', '16', '72', '63', '4536.00', '0', '', '2026-09-23 21:58:21', '16','','','0','0','0','0','0',null,'63','4536','0','0','0','0','0','0','0','0','1'); -- id=67
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 16, 0, 0
                    , 63, 72, 0, 0, 1, '2026-09-23 21:58:32')
                ON DUPLICATE KEY UPDATE buyprice = 63,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:32' ; -- id=67
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('16', '63', '72', '0', 'buyBillController.php', '67', '', '0', '0'); -- id=67
UPDATE product SET  productBuyPrice = "63" WHERE productId = 16 ;
UPDATE buybilldetail SET  quantitybefore = 55 WHERE buybilldetailid = 67 ;
UPDATE product SET productName = 'زر جرس مفرد اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '63.00', productSellAllPrice = '64.00', productSellUnitPrice = '67.00', productSellHalfPrice = '64.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '36', parcode = '00016',type ='0', expireDate = '0' , dailyentryId = '21',isService = '0',isOptic = '0',lastbuyprice = '63',lastbuyprice_withDiscount = '63',meanbuyprice = '63',meanbuyprice_withDiscount = '63' , productbuypricereal = '63.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.59' , buyhalf_precentage = '1.59' , buypart_precentage = '6.35',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='63',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='63',meanbuyprice_withTax='63',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='63',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '16';
UPDATE buybilldetail SET  lastbuyprice = 63 , meanbuyprice = 63, lastbuyprice_withDiscount = 63, meanbuyprice_withDiscount = 63
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where buybilldetailid = 67;
UPDATE productunit SET proUnitBuyPrice  = 63 * productnumber WHERE productid = 16;
UPDATE storedetail SET  productquantity = '127', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '72', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '55', '127', '1', '2026-09-23 21:51:11','0','0'); -- id=1533
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00455', '21', '1', '455', '20', '100', '2000.00', '0', '', '2026-09-23 21:58:21', '455','','','0','0','0','0','0',null,'100','2000','0','0','0','0','0','0','0','0','1'); -- id=68
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 455, 0, 0
                    , 100, 20, 0, 0, 1, '2026-09-23 21:58:33')
                ON DUPLICATE KEY UPDATE buyprice = 100,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:33' ; -- id=68
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('455', '100', '20', '0', 'buyBillController.php', '68', '', '0', '0'); -- id=68
UPDATE product SET  productBuyPrice = "100" WHERE productId = 455 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 68 ;
UPDATE product SET productName = 'زر جرس عريض رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '100.00', productSellAllPrice = '102.00', productSellUnitPrice = '105.00', productSellHalfPrice = '102.00', productDate = '2026-09-23', conditions = '0', userId = '1', limitamount = '1', parcode = '00455',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '100',lastbuyprice_withDiscount = '100',meanbuyprice = '100',meanbuyprice_withDiscount = '100' , productbuypricereal = '100.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='100',meanbuyprice_withTax='100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '455';
UPDATE buybilldetail SET  lastbuyprice = 100 , meanbuyprice = 100, lastbuyprice_withDiscount = 100, meanbuyprice_withDiscount = 100
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where buybilldetailid = 68;
UPDATE productunit SET proUnitBuyPrice  = 100 * productnumber WHERE productid = 455;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('455', '1', '20', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-09-23 21:51:11','0','0'); -- id=1534
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00010', '21', '1', '10', '48', '237', '11376.00', '0', '', '2026-09-23 21:58:21', '10','','','0','0','0','0','0',null,'237','11376','0','0','0','0','0','0','0','0','1'); -- id=69
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 10, 0, 0
                    , 237, 48, 0, 0, 1, '2026-09-23 21:58:34')
                ON DUPLICATE KEY UPDATE buyprice = 237,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:34' ; -- id=69
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('10', '237', '48', '0', 'buyBillController.php', '69', '', '0', '0'); -- id=69
UPDATE product SET  productBuyPrice = "237" WHERE productId = 10 ;
UPDATE buybilldetail SET  quantitybefore = 44 WHERE buybilldetailid = 69 ;
UPDATE product SET productName = 'مفتاح تكيف 45 امبير اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '237.00', productSellAllPrice = '239.00', productSellUnitPrice = '246.50', productSellHalfPrice = '239.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '12', parcode = '00010',type ='0', expireDate = '0' , dailyentryId = '15',isService = '0',isOptic = '0',lastbuyprice = '237',lastbuyprice_withDiscount = '237',meanbuyprice = '237',meanbuyprice_withDiscount = '237' , productbuypricereal = '237.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.84' , buyhalf_precentage = '0.84' , buypart_precentage = '4.01',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='237',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='237',meanbuyprice_withTax='237',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='237',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '10';
UPDATE buybilldetail SET  lastbuyprice = 237 , meanbuyprice = 237, lastbuyprice_withDiscount = 237, meanbuyprice_withDiscount = 237
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where buybilldetailid = 69;
UPDATE productunit SET proUnitBuyPrice  = 237 * productnumber WHERE productid = 10;
UPDATE storedetail SET  productquantity = '92', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '48', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '44', '92', '1', '2026-09-23 21:51:11','0','0'); -- id=1535
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00366', '21', '1', '366', '24', '237', '5688.00', '0', '', '2026-09-23 21:58:21', '366','','','0','0','0','0','0',null,'237','5688','0','0','0','0','0','0','0','0','1'); -- id=70
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 366, 0, 0
                    , 237, 24, 0, 0, 1, '2026-09-23 21:58:35')
                ON DUPLICATE KEY UPDATE buyprice = 237,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:35' ; -- id=70
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('366', '237', '24', '0', 'buyBillController.php', '70', '', '0', '0'); -- id=70
UPDATE product SET  productBuyPrice = "237" WHERE productId = 366 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 70 ;
UPDATE product SET productName = 'مفتاح تكييف 45 امبير رمادي ', productDescription = '', productCatId = '1', productBuyPrice = '237.00', productSellAllPrice = '239.00', productSellUnitPrice = '246.50', productSellHalfPrice = '239.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00366',type ='0', expireDate = '0' , dailyentryId = '453',isService = '0',isOptic = '0',lastbuyprice = '237',lastbuyprice_withDiscount = '237',meanbuyprice = '237',meanbuyprice_withDiscount = '237' , productbuypricereal = '237.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.84' , buyhalf_precentage = '0.84' , buypart_precentage = '4.01',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='237',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='237',meanbuyprice_withTax='237',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='237',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '366';
UPDATE buybilldetail SET  lastbuyprice = 237 , meanbuyprice = 237, lastbuyprice_withDiscount = 237, meanbuyprice_withDiscount = 237
        , lastbuyprice_withTax = 237, meanbuyprice_withTax = 237, lastbuyprice_withDiscountAndTax = 237
                where buybilldetailid = 70;
UPDATE productunit SET proUnitBuyPrice  = 237 * productnumber WHERE productid = 366;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '366';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('366', '1', '24', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '28', '1', '2026-09-23 21:51:11','0','0'); -- id=1536
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00009', '21', '1', '9', '36', '306', '11016.00', '0', '', '2026-09-23 21:58:21', '9','','','0','0','0','0','0',null,'306','11016','0','0','0','0','0','0','0','0','1'); -- id=71
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-23 21:51:11', 1, 9, 0, 0
                    , 306, 36, 0, 0, 1, '2026-09-23 21:58:35')
                ON DUPLICATE KEY UPDATE buyprice = 306,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-23 21:58:35' ; -- id=71
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('9', '306', '36', '0', 'buyBillController.php', '71', '', '0', '0'); -- id=71
UPDATE product SET  productBuyPrice = "306" WHERE productId = 9 ;
UPDATE buybilldetail SET  quantitybefore = 34 WHERE buybilldetailid = 71 ;
UPDATE product SET productName = 'قطعه طواريء ', productDescription = '', productCatId = '1', productBuyPrice = '306.00', productSellAllPrice = '307.00', productSellUnitPrice = '319.00', productSellHalfPrice = '307.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '15', parcode = '00009',type ='0', expireDate = '0' , dailyentryId = '14',isService = '0',isOptic = '0',lastbuyprice = '306',lastbuyprice_withDiscount = '306',meanbuyprice = '306',meanbuyprice_withDiscount = '306' , productbuypricereal = '306.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.33' , buyhalf_precentage = '0.33' , buypart_precentage = '4.25',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='306',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='306',meanbuyprice_withTax='306',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='306',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '9';
UPDATE buybilldetail SET  lastbuyprice = 306 , meanbuyprice = 306, lastbuyprice_withDiscount = 306, meanbuyprice_withDiscount = 306
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where buybilldetailid = 71;
UPDATE productunit SET proUnitBuyPrice  = 306 * productnumber WHERE productid = 9;
UPDATE storedetail SET  productquantity = '70', userid = '1', storedetaildate = '2026-09-23' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '36', '0', '21', 'اضافة فاتورة مشتريات', 'buyBillController.php', '34', '70', '1', '2026-09-23 21:51:11','0','0'); -- id=1537
UPDATE supplier SET  suppliercurrentDebt = '61105',suppliercurrentDebtInCurrency= '61105' , userid = '1', supplierdate = '2026-09-23 21:58:21'   WHERE supplierid = '3';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('3', '61105.00', '0', '0', 'اضافة فاتورة مشتريات', '21', '61105', '2026-09-23 21:51:11', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','61105','0','61105','0',''); -- id=45
UPDATE save SET  savecurrentvalue = '-345723.31',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-247919.91','97803.4', '1', '1', 'اضافة فاتورة مشتريات', '21', '-345723.31', '2026-09-23 21:51:11', '1',  'buyBillController.php','0','','0'); -- id=103
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97803.4', '97803.4', '2026-09-23', '1', '0', '0', '2026-09-23 21:58:37','اضافة فاتورة مشتريات رقم 21 - سداد الفاتورة للمورد','1','0',null,'0','21','buyBillController.php?do=details&id=21'); -- id=820
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('820', '421', '97803.4', '','0'); -- id=820
UPDATE accountstree SET name = 'كيون حساب نشات', customName = 'كيون حساب نشات', customNameEn = 'كيون حساب نشات', nameEn = 'كيون حساب نشات', parent = '81', accountNature = '1', theValue = '-36698.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 15:58:35' WHERE id = '421';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('820', '383', '97803.4', '','0'); -- id=820
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-298356.29', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
update buybill set dailyentryid='0,820' where buybillid=21;
COMMIT;
UPDATE product SET overAllAveragePrice = 105 WHERE productId = 6;UPDATE product SET overAllAveragePrice = 306 WHERE productId = 9;UPDATE product SET overAllAveragePrice = 237 WHERE productId = 10;UPDATE product SET overAllAveragePrice = 105 WHERE productId = 11;UPDATE product SET overAllAveragePrice = 163 WHERE productId = 15;UPDATE product SET overAllAveragePrice = 63 WHERE productId = 16;UPDATE product SET overAllAveragePrice = 121.4 WHERE productId = 40;UPDATE product SET overAllAveragePrice = 52.79 WHERE productId = 355;UPDATE product SET overAllAveragePrice = 34.8 WHERE productId = 356;UPDATE product SET overAllAveragePrice = 34.8 WHERE productId = 357;UPDATE product SET overAllAveragePrice = 105 WHERE productId = 358;UPDATE product SET overAllAveragePrice = 105 WHERE productId = 359;UPDATE product SET overAllAveragePrice = 10.55 WHERE productId = 360;UPDATE product SET overAllAveragePrice = 63 WHERE productId = 361;UPDATE product SET overAllAveragePrice = 95 WHERE productId = 362;UPDATE product SET overAllAveragePrice = 237 WHERE productId = 366;UPDATE product SET overAllAveragePrice = 100 WHERE productId = 455;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:28:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 21:58:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 21:58:38', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=21'); -- id=2177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:30:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:00:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-23 22:00:32', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=2178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:30:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:00:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-23 22:00:55', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php?do=add'); -- id=2179
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('ابراهيم سرور ' , '', '', '', '11000', '', '0', '2026-09-23 22:00:56', '1', '0','36','0','','-10','36','10000',',','-1','0','','0','0','.','2026-09-23','0','36','','0','0','0','','','0','0','','','','','','','','','','-1','','.','.','0','','','0','0',''); -- id=36
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('36', '0', '0', '', ''); -- id=36
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 ('36','0','11000','0','إضافة عميل جديد','36', '11000', '2026-09-23 22:00:56', '1', 'clientController.php', '', '11000', '0', null, '0', null, null,'', '0','1','1','11000','1','','0','0','',''); -- id=183
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('ابراهيم سرور ', 'ابراهيم سرور ', 'ابراهيم سرور ', 'ابراهيم سرور ', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-23 22:00:56'); -- id=468
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11000', '11000', '2026-09-23', '1', '0', '0', '2026-09-23 22:00:57','تم اضافة عميل ابراهيم سرور ','1','0','0','0','36','clientController.php?do=edit&id=36'); -- id=821
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('821', '468', '11000', '','0'); -- id=821
UPDATE accountstree SET name = 'ابراهيم سرور ', customName = 'ابراهيم سرور ', customNameEn = 'ابراهيم سرور ', nameEn = 'ابراهيم سرور ', parent = '58', accountNature = '0', theValue = '11000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 22:00:56' WHERE id = '468';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('821', '121', '11000', '','0'); -- id=821
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1239323.87', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
COMMIT;
UPDATE client SET clientname = 'ابراهيم سرور ', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '11000.00', clientdetails = '', conditions = '0', clientdate = '2026-09-23', userid = '1'  , clientareaid = '0'  ,clientcode = '36',dailyentryid = '821' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '36' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='36' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='468',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='.',fileimg='.',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '36';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:30:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:00:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-23 22:00:59', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=2180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:31:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:01:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-23 22:01:05', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=2181
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:31:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:01:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-23 22:01:13', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php?do=show'); -- id=2182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:31:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:01:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-23 22:01:23', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php?do=show'); -- id=2183
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 22:02:30', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=2184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 22:02:46', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=2185

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =184
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(34,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-09-23 22:02:46', userid = '1' WHERE clientid = '34';
UPDATE client SET  inUse = 0 where clientid = 34;
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 ('34','7178.00','7178','1','ايصال تحصيل (( قبض من عميل ))','184', '0', '2026-09-23 22:02:30', '1', 'clientPayedDeptController.php', '   ', '7178', '0', null, '0', null, null,'', '-1','1','1','7178','1','','14','0','','.'); -- id=184
UPDATE save SET  savecurrentvalue = '-338545.31',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-345723.31','7178', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '184', '-338545.31', '2026-09-23 22:02:46', '1',  'clientPayedDeptController.php','34','','0'); -- id=104
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7178', '7178', '2026-09-23', '1', '0', '0', '2026-09-23 22:02:46','اضافة ايصال سداد للعميل محمود شلبي','1','0','0','0','184','clientPayedDeptController.php?do=show&id=184'); -- id=822
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('822', '383', '7178', '','0'); -- id=822
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-291178.29', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('822', '465', '7178', '','0'); -- id=822
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-23 12:12:39' WHERE id = '465';
UPDATE clientdebtchange SET clientid = '34', clientdebtchangebefore = '7178.000', clientdebtchangeamount = '7178.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '184', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-09-23 22:02:30', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '7178.000',discount='', reciptid='0', dailyentryid = '822',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='7178',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '184';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 22:02:47', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=2186
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-23 22:02:49', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=2187
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-23 22:02:52', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=2188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:32:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:02:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-23 22:02:53', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:34:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:04:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 22:04:51', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2190
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:34:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:04:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 22:04:58', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:35:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:05:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-23 22:05:06', '1', 'details', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=details&id=19'); -- id=2192
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:35:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:05:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-23 22:05:12', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:35:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:05:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyAndReturnBillController.php', '2026-09-23 22:05:37', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyAndReturnBillController.php?do=show'); -- id=2194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 18:36:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:06:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-23 22:06:21', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2195
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:05:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:35:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-23 22:35:50', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=2196
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:05:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:35:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-23 22:35:57', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=2197
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:06:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:36:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-23 22:36:11', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=2198
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:06:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:36:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-23 22:36:17', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=2199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:06:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:36:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-23 22:36:32', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=2200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:07:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:37:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-23 22:37:14', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyreport.php'); -- id=2201
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:07:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:37:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-23 22:37:21', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyreport.php'); -- id=2202
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:07:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:37:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-23 22:37:52', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyreport.php'); -- id=2203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:08:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:38:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-23 22:38:03', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=2204
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-23 19:08:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-23 22:38:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-23 22:38:10', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php?do=show'); -- id=2205
