UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 05:42:05";
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-22 05:42:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 09:12:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-22 09:12:23', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=1995
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-22',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-22 05:42:30";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-22 09:12:30', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1996
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 05:42:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 09:12:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 09:12:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1997
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 05:43:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 09:13:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 09:13:35', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=1998
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 ('نجفه موديل 7005 دهبي مستورد','','16','1250','1400','1490','1400','2026-09-22','0','1','0','','0','0','0','0','0','1250','1250','1250','1250','1250','0','12','12','19.2','.','0','0','0','1250','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1250','1250','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1250','0','0','0','0','0','0','','','0','0','0','0'); -- id=435
UPDATE product SET productName = 'نجفه موديل 7005 دهبي مستورد', productDescription = '', productCatId = '16', productBuyPrice = '1250', productSellAllPrice = '1400', productSellUnitPrice = '1490', productSellHalfPrice = '1400', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00435',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1250',lastbuyprice_withDiscount = '1250',meanbuyprice = '1250',meanbuyprice_withDiscount = '1250' , productbuypricereal = '1250' , buypricereal_precentage = '0' , buytotal_precentage = '12' , buyhalf_precentage = '12' , buypart_precentage = '19.2',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1250',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='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 = '435';
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', '435', '1.00', '2026-09-22', '1', '0','0043501','1400','1400','1490','1250','','0','0','0','0','0','0','0','0','0','0'); -- id=435
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('435', '1', '3', '1', '2026-09-22'); -- id=435
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('435', '1', '3', '0', '435', 'إضافة منتج', 'productController.php', '0', '3', '1', '2026-09-22','0','0'); -- id=1393
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (435, 1,'2026-09-22 09:13:36',1)
                ON DUPLICATE KEY UPDATE productid = 435, edited = 1, sysdate = '2026-09-22 09:13:36', userid = 1; -- id=552
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3750', '3750', '2026-09-22', '1', '0', '0', '2026-09-22 09:13:36','إضافة منتج نجفه موديل 7005 دهبي مستورد الكمية 3','1','0','0','0','435','productController.php?do=edit&id=435'); -- id=763
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('763', '382', '3750', '','0'); -- id=763
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2084570.35', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('763', '121', '3750', '','0'); -- id=763
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1208034.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 = 'نجفه موديل 7005 دهبي مستورد', productDescription = '', productCatId = '16', productBuyPrice = '1250.00', productSellAllPrice = '1400.00', productSellUnitPrice = '1490.00', productSellHalfPrice = '1400.00', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00435',type ='0', expireDate = '0' , dailyentryId = '763',isService = '0',isOptic = '0',lastbuyprice = '1250',lastbuyprice_withDiscount = '1250',meanbuyprice = '1250',meanbuyprice_withDiscount = '1250' , productbuypricereal = '1250' , buypricereal_precentage = '0' , buytotal_precentage = '12' , buyhalf_precentage = '12' , buypart_precentage = '19.2',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1250',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='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 = '435';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 05:43:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 09:13:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 09:13:39', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=1999
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:53:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:23:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 11:23:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2000
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 11:25:16', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2001

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab2490a65fc4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4,@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-22 11:25:17', '06ab2490a65fc4', '4', '2199.14', '2948.68', '0', '1', '749.54', '749.54', '0', '749.54', '1', '2026-09-22 11:25:17', '', '1', '0', 'محمد عبدالله الالفي', '1', '1', '3', '0', 'محمد عبدالله الالفي', '5' ,'0','','','','','-1','0','0','0','0','0','749','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=94
UPDATE client SET  clientdebt = '2948.68', userid = '1' WHERE clientid = '4';
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 ('4','2199.14','749.54','0','اضافة فاتورة مبيعات','94', '2948.68', '2026-09-22 11:25:18', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '749.54', '0', null, '0', null, null,'', '0','1','1','749.54','1','2026-09-22 11:25:17','0','0','',''); -- id=164
UPDATE client SET  inUse = 0 where clientid = 4;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('79.18','00054', '94', '1', '54', '3', '79.18', '237.54000000000002', '0', '', '0', '2026-09-22 11:25:18', '54', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','79.18','237.54','0','','0','','0','0','0','0'); -- id=639
UPDATE sellbilldetail SET  lastbuyprice = 79.18 , meanbuyprice = 79.18, lastbuyprice_withDiscount = 79.18, meanbuyprice_withDiscount = 79.18
        , lastbuyprice_withTax = 79.18, meanbuyprice_withTax = 79.18, lastbuyprice_withDiscountAndTax = 79.18
                where sellbilldetailid = 639;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (54, '2026-09-22', 237.54, 237.54, 237.54
                    , 237.54, 237.54, 237.54, 237.54
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 237.54, 237.54, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237.54, sellCostBuyPrice =sellCostBuyPrice+237.54
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+237.54, sellCostMeanBuyPrice = sellCostMeanBuyPrice+237.54
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+237.54, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+237.54
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+237.54
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237.54
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 237.54, 237.54, 237.54
                    , 237.54, 237.54, 237.54, 237.54
                    , 0, 0, 0, 0
                    , 0, 0, 0, 237.54, 237.54, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+237.54, sellCostBuyPrice =sellCostBuyPrice+237.54
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+237.54, sellCostMeanBuyPrice = sellCostMeanBuyPrice+237.54
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+237.54, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+237.54
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+237.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+237.54
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+237.54
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '96', userid = '1', storedetaildate = '2026-09-22 11:25:18' WHERE storedetailid = '54';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('54', '1', '3', '1', '94', 'اضافة فاتورة مبيعات', 'sellbillController.php', '99', '96', '1', '2026-09-22 11:25:18','0','0'); -- id=1394
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('254','00314', '94', '1', '314', '2', '256', '512', '0', '', '0', '2026-09-22 11:25:18', '314', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','256','512','0','','0','','0','0','0','0'); -- id=640
UPDATE sellbilldetail SET  lastbuyprice = 254.00 , meanbuyprice = 254.00, lastbuyprice_withDiscount = 254.00, meanbuyprice_withDiscount = 254.00
        , lastbuyprice_withTax = 254, meanbuyprice_withTax = 254, lastbuyprice_withDiscountAndTax = 254
                where sellbilldetailid = 640;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (314, '2026-09-22', 512, 508, 508
                    , 508, 508, 508, 508
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 508, 508, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+512, sellCostBuyPrice =sellCostBuyPrice+508
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+508, sellCostMeanBuyPrice = sellCostMeanBuyPrice+508
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+508
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+508
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+508
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 512, 508, 508
                    , 508, 508, 508, 508
                    , 0, 0, 0, 0
                    , 0, 0, 0, 508, 508, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+512, sellCostBuyPrice =sellCostBuyPrice+508
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+508, sellCostMeanBuyPrice = sellCostMeanBuyPrice+508
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+508
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+508
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+508
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-09-22 11:25:19' WHERE storedetailid = '314';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('314', '1', '2', '1', '94', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '6', '1', '2026-09-22 11:25:19','0','0'); -- id=1395
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '749.54', '749.54', '2026-09-22', '1', '0', '0', '2026-09-22 11:25:19','اضافة فاتورة مبيعات رقم 94','1','0',null,'0','94','sellbillController.php?do=showDetail&sellbillid=94'); -- id=764
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('764', '428', '749.54', '','0'); -- id=764
UPDATE accountstree SET name = 'محمد عبدالله الالفي', customName = 'محمد عبدالله الالفي', customNameEn = 'محمد عبدالله الالفي', nameEn = 'محمد عبدالله الالفي', parent = '58', accountNature = '0', theValue = '2948.68', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 09:05:36' WHERE id = '428';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('764', '143', '749.54', '','0'); -- id=764
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '303482.65', 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 ( '745.54', '745.54', '2026-09-22', '1', '0', '0', '2026-09-22 11:25:19','اضافة فاتورة مبيعات رقم 94 - صرف البضاعة من المخزن','1','0',null,'0','94','sellbillController.php?do=showDetail&sellbillid=94'); -- id=765
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('765', '402', '745.54', '','0'); -- id=765
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '285446.76', 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 ('765', '382', '745.54', '','0'); -- id=765
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2083824.81', 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='764,0,765' where sellbillid=94;
 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-22', 749.54, 745.54, 745.54
                    , 745.54, 745.54, 745.54, 745.54
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,745.54, 745.54, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+749.54, sellCostBuyPrice =sellCostBuyPrice+745.54
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+745.54, sellCostMeanBuyPrice = sellCostMeanBuyPrice+745.54
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+745.54, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+745.54
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+745.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+745.54
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+745.54
                        , returnSellVal = returnSellVal+0, 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 (4, '2026-09-22', 749.54, 745.54, 745.54
                    , 745.54, 745.54, 745.54, 745.54
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,745.54, 745.54, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+749.54, sellCostBuyPrice =sellCostBuyPrice+745.54
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+745.54, sellCostMeanBuyPrice = sellCostMeanBuyPrice+745.54
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+745.54, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+745.54
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+745.54
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+745.54
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+745.54
                        , returnSellVal = returnSellVal+0, 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, 749.54, 745.54, 745.54
                    , 745.54, 745.54, 745.54, 745.54, 745.54, 745.54)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+749.54, netSellCostBuyPrice = netSellCostBuyPrice+745.54
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+745.54
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+745.54
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+745.54
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+745.54
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+745.54
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+745.54
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+745.54;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab2490a65fc4 and sellbillId = 94 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 11:25:20', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2002
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-22 11:25:36', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=2003
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-22 11:25:55', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=2004

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =165
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(4,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '448.68' , clientdate = '2026-09-22 11:25:55', userid = '1' WHERE clientid = '4';
UPDATE client SET  inUse = 0 where clientid = 4;
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 ('4','2948.68','2500','1','ايصال تحصيل (( قبض من عميل ))','165', '448.68', '2026-09-22 11:25:36', '1', 'clientPayedDeptController.php', '   ', '2500', '0', null, '0', null, null,'', '-1','1','1','2500','1','','12','0','','.'); -- id=165
UPDATE save SET  savecurrentvalue = '-228917.59',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-231417.59','2500', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '165', '-228917.59', '2026-09-22 11:25:55', '1',  'clientPayedDeptController.php','4','','0'); -- id=89
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2500', '2500', '2026-09-22', '1', '0', '0', '2026-09-22 11:25:55','اضافة ايصال سداد للعميل محمد عبدالله الالفي','1','0','0','0','165','clientPayedDeptController.php?do=show&id=165'); -- id=766
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('766', '383', '2500', '','0'); -- id=766
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-182225.57', 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 ('766', '428', '2500', '','0'); -- id=766
UPDATE accountstree SET name = 'محمد عبدالله الالفي', customName = 'محمد عبدالله الالفي', customNameEn = 'محمد عبدالله الالفي', nameEn = 'محمد عبدالله الالفي', parent = '58', accountNature = '0', theValue = '448.68', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 09:05:36' WHERE id = '428';
UPDATE clientdebtchange SET clientid = '4', clientdebtchangebefore = '2948.680', clientdebtchangeamount = '2500.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '165', clientdebtchangeafter = '448.680', clientdebtchangedate = '2026-09-22 11:25:36', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2500.000',discount='', reciptid='0', dailyentryid = '766',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='2500',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '165';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-22 11:25:56', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=2005
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:55:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:25:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-09-22 11:25:58', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=2006
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:56:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:26:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:26:58', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=2007
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:56:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:26:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:26:59', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2008
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:57:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:27:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:27:06', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:57:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:27:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:27:07', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2010
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:57:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:27:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:27:15', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2011
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:57:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:27:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-22 11:27:19', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=2012
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 07:57:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:27:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 11:27:37', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2013
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:14:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:44:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 11:44:13', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2014
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:14:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:44:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 11:44:28', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2015
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:14:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:44:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 11:44:37', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2016
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:14:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:44:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 11:44:48', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2017
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:15:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:45:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 11:45:27', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2018
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 ('06ab24e12a050f', '2026-09-22 11:44:50', '1', '31338.00', '31626', '0', '0', '288.00',  '288.00', '', '288', '1', '2026-09-22 11:45:27', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=12
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 ('00344', '12', '6', '344', '24', '12', '288.00', '0', '', '2026-09-22 11:45:27', '344','','','0','0','0','0','0',null,'12','288','0','0','0','0','0','0','0','0','1'); -- id=34
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 11:44:50', 1, 344, 0, 0
                    , 12, 24, 0, 0, 1, '2026-09-22 11:45:28')
                ON DUPLICATE KEY UPDATE buyprice = 12,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 11:45:28' ; -- id=34
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('344', '12', '24', '0', 'buyBillController.php', '34', '', '0', '0'); -- id=34
UPDATE product SET  productBuyPrice = "12" WHERE productId = 344 ;
UPDATE buybilldetail SET  quantitybefore = 8 WHERE buybilldetailid = 34 ;
UPDATE product SET productName = 'لمبه اشاره ', productDescription = '', productCatId = '6', productBuyPrice = '12.00', productSellAllPrice = '15.00', productSellUnitPrice = '15.00', productSellHalfPrice = '15.00', productDate = '2026-09-16', conditions = '0', userId = '1', limitamount = '0', parcode = '00344',type ='0', expireDate = '0' , dailyentryId = '417',isService = '0',isOptic = '0',lastbuyprice = '12',lastbuyprice_withDiscount = '12',meanbuyprice = '12',meanbuyprice_withDiscount = '12' , productbuypricereal = '12.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.00' , buyhalf_precentage = '25.00' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='12',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='12',meanbuyprice_withTax='12',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='12',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '344';
UPDATE buybilldetail SET  lastbuyprice = 12 , meanbuyprice = 12, lastbuyprice_withDiscount = 12, meanbuyprice_withDiscount = 12
        , lastbuyprice_withTax = 12, meanbuyprice_withTax = 12, lastbuyprice_withDiscountAndTax = 12
                where buybilldetailid = 34;
UPDATE productunit SET proUnitBuyPrice  = 12 * productnumber WHERE productid = 344;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('344', '1', '24', '0', '12', 'اضافة فاتورة مشتريات', 'buyBillController.php', '8', '32', '1', '2026-09-22 11:44:50','0','0'); -- id=1396
UPDATE supplier SET  suppliercurrentDebt = '31626',suppliercurrentDebtInCurrency= '31626' , userid = '1', supplierdate = '2026-09-22 11:45:27'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '31338.00', '288', '0', 'اضافة فاتورة مشتريات', '12', '31626', '2026-09-22 11:44:50', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','288','1','31338','288','31626','0',''); -- id=33
update buybill set dailyentryid='0,0' where buybillid=12;
COMMIT;
UPDATE product SET overAllAveragePrice = 12 WHERE productId = 344;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 08:15:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 11:45:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 11:45:29', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=12'); -- id=2019
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 09:01:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 12:31:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 12:31:39', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2020
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 09:02:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 12:32:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 12:32:29', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2021

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab2590c3646d
-- ----------------------------------------------------------------------------------------------------

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-22 12:32:30', '06ab2590c3646d', '1', '0.00', '0', '0', '1', '68.75', '68.75', '68.75', '0', '1', '2026-09-22 12:32:30', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','68','0','','0','0','68.75','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=95
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','اضافة فاتورة مبيعات','95', '0', '2026-09-22 12:32:31', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '68.75', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-22 12:32:30','0','0','',''); -- id=166
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('17.6','00100', '95', '3', '100', '1', '17.75', '17.75', '0', '', '1', '2026-09-22 12:32:31', '100', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17.75','17.75','0','','0','0.00','0','0','0','0'); -- id=641
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 641;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (100, '2026-09-22', 17.75, 17.6, 17.6
                    , 17.6, 17.6, 17.6, 17.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 17.6, 17.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17.75, sellCostBuyPrice =sellCostBuyPrice+17.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.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+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-22', 17.75, 17.6, 17.6
                    , 17.6, 17.6, 17.6, 17.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17.6, 17.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17.75, sellCostBuyPrice =sellCostBuyPrice+17.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.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 = '335', userid = '1', storedetaildate = '2026-09-22 12:32:31' WHERE storedetailid = '100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '1', '1', '95', 'اضافة فاتورة مبيعات', 'sellbillController.php', '336', '335', '1', '2026-09-22 12:32:31','0','0'); -- id=1397
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('17.6','00101', '95', '3', '101', '1', '17.75', '17.75', '0', '', '1', '2026-09-22 12:32:31', '101', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','17.75','17.75','0','','0','0.00','0','0','0','0'); -- id=642
UPDATE sellbilldetail SET  lastbuyprice = 17.60 , meanbuyprice = 17.60, lastbuyprice_withDiscount = 17.60, meanbuyprice_withDiscount = 17.60
        , lastbuyprice_withTax = 17.6, meanbuyprice_withTax = 17.6, lastbuyprice_withDiscountAndTax = 17.6
                where sellbilldetailid = 642;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (101, '2026-09-22', 17.75, 17.6, 17.6
                    , 17.6, 17.6, 17.6, 17.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 17.6, 17.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17.75, sellCostBuyPrice =sellCostBuyPrice+17.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.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+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-22', 17.75, 17.6, 17.6
                    , 17.6, 17.6, 17.6, 17.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17.6, 17.6, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17.75, sellCostBuyPrice =sellCostBuyPrice+17.6
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17.6, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17.6
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17.6
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17.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 = '388', userid = '1', storedetaildate = '2026-09-22 12:32:31' WHERE storedetailid = '101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('101', '1', '1', '1', '95', 'اضافة فاتورة مبيعات', 'sellbillController.php', '389', '388', '1', '2026-09-22 12:32:31','0','0'); -- id=1398
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 11;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('11.75','00102', '95', '3', '102', '1', '12', '12', '0', '', '1', '2026-09-22 12:32:31', '102', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','11-1,','1','1','0','0','12','12','0','','0','0.00','0','0','0','0'); -- id=643
UPDATE sellbilldetail SET  lastbuyprice = 11.75 , meanbuyprice = 11.75, lastbuyprice_withDiscount = 11.75, meanbuyprice_withDiscount = 11.75
        , lastbuyprice_withTax = 11.75, meanbuyprice_withTax = 11.75, lastbuyprice_withDiscountAndTax = 11.75
                where sellbilldetailid = 643;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (102, '2026-09-22', 12, 11.75, 11.75
                    , 11.75, 11.75, 11.75, 11.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 11.75, 11.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12, sellCostBuyPrice =sellCostBuyPrice+11.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 12, 11.75, 11.75
                    , 11.75, 11.75, 11.75, 11.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11.75, 11.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12, sellCostBuyPrice =sellCostBuyPrice+11.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1279', userid = '1', storedetaildate = '2026-09-22 12:32:32' WHERE storedetailid = '102';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '1', '1', '95', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1280', '1279', '1', '2026-09-22 12:32:32','0','0'); -- id=1399
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('15','00120', '95', '3', '120', '1', '15.75', '15.75', '0', '', '1', '2026-09-22 12:32:32', '120', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','10-1,','1','1','0','0','15.75','15.75','0','','0','0.00','0','0','0','0'); -- id=644
UPDATE sellbilldetail SET  lastbuyprice = 15.00 , meanbuyprice = 15.00, lastbuyprice_withDiscount = 15.00, meanbuyprice_withDiscount = 15.00
        , lastbuyprice_withTax = 15, meanbuyprice_withTax = 15, lastbuyprice_withDiscountAndTax = 15
                where sellbilldetailid = 644;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (120, '2026-09-22', 15.75, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15.75, sellCostBuyPrice =sellCostBuyPrice+15
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 15.75, 15, 15
                    , 15, 15, 15, 15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15.75, sellCostBuyPrice =sellCostBuyPrice+15
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '271', userid = '1', storedetaildate = '2026-09-22 12:32:32' WHERE storedetailid = '120';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '1', '1', '95', 'اضافة فاتورة مبيعات', 'sellbillController.php', '272', '271', '1', '2026-09-22 12:32:32','0','0'); -- id=1400
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 8;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.5','00103', '95', '3', '103', '1', '5.5', '5.5', '0', '', '1', '2026-09-22 12:32:32', '103', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','8-1,','1','1','0','0','5.5','5.5','0','','0','0.00','0','0','0','0'); -- id=645
UPDATE sellbilldetail SET  lastbuyprice = 4.50 , meanbuyprice = 4.50, lastbuyprice_withDiscount = 4.50, meanbuyprice_withDiscount = 4.50
        , lastbuyprice_withTax = 4.5, meanbuyprice_withTax = 4.5, lastbuyprice_withDiscountAndTax = 4.5
                where sellbilldetailid = 645;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (103, '2026-09-22', 5.5, 4.5, 4.5
                    , 4.5, 4.5, 4.5, 4.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 4.5, 4.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5.5, sellCostBuyPrice =sellCostBuyPrice+4.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4.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-22', 5.5, 4.5, 4.5
                    , 4.5, 4.5, 4.5, 4.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4.5, 4.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5.5, sellCostBuyPrice =sellCostBuyPrice+4.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4.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 = '1944', userid = '1', storedetaildate = '2026-09-22 12:32:32' WHERE storedetailid = '103';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '1', '1', '95', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1945', '1944', '1', '2026-09-22 12:32:32','0','0'); -- id=1401
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-228848.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 ('-228917.59375','68.75', '0', '1', 'اضافة فاتورة مبيعات', '95', '-228848.84375', '2026-09-22 12:32:33', '1',  'sellbillController.php','1','','0'); -- id=90
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '68.75', '68.75', '2026-09-22', '1', '0', '0', '2026-09-22 12:32:33','اضافة فاتورة مبيعات رقم 95','1','0',null,'0','95','sellbillController.php?do=showDetail&sellbillid=95'); -- id=767
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('767', '383', '68.75', '','0'); -- id=767
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-182156.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 ('767', '143', '68.75', '','0'); -- id=767
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '303551.4', 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 ( '66.45', '66.45', '2026-09-22', '1', '0', '0', '2026-09-22 12:32:33','اضافة فاتورة مبيعات رقم 95 - صرف البضاعة من المخزن','1','0',null,'0','95','sellbillController.php?do=showDetail&sellbillid=95'); -- id=768
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('768', '402', '66.45', '','0'); -- id=768
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '285513.21', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('768', '382', '66.45', '','0'); -- id=768
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2083758.36', 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='767,0,768' where sellbillid=95;
 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-22', 68.75, 66.45, 66.45
                    , 66.45, 66.45, 66.45, 66.45
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,66.45, 66.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68.75, sellCostBuyPrice =sellCostBuyPrice+66.45
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+66.45, sellCostMeanBuyPrice = sellCostMeanBuyPrice+66.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+66.45, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+66.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+66.45
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+66.45
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+66.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 68.75, 66.45, 66.45
                    , 66.45, 66.45, 66.45, 66.45
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,66.45, 66.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+68.75, sellCostBuyPrice =sellCostBuyPrice+66.45
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+66.45, sellCostMeanBuyPrice = sellCostMeanBuyPrice+66.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+66.45, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+66.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+66.45
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+66.45
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+66.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 68.75, 66.45, 66.45
                    , 66.45, 66.45, 66.45, 66.45, 66.45, 66.45)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+68.75, netSellCostBuyPrice = netSellCostBuyPrice+66.45
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+66.45
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+66.45
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+66.45
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+66.45
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+66.45
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+66.45
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+66.45;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab2590c3646d and sellbillId = 95 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 09:02:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 12:32:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 12:32:34', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2022
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 11:10:46";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 14:40:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 14:40:46', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2023
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 11:11:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 14:41:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 14:41:22', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2024

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab2774ef353c
-- ----------------------------------------------------------------------------------------------------

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-22 14:41:22', '06ab2774ef353c', '1', '0.00', '0', '0', '1', '5085.00', '5085', '5085', '0', '1', '2026-09-22 14:41:22', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '90' ,'0','','','','','-1','0','0','0','0','0','5085','0','','0','0','5085','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=96
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','اضافة فاتورة مبيعات','96', '0', '2026-09-22 14:41:23', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5085', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-22 14:41:22','0','0','',''); -- id=167
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+49 where id = 29;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('34','00169', '96', '2', '169', '50', '38.5', '1925', '0', '', '0', '2026-09-22 14:41:23', '169', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','29-49,','1','1','0','0','38.5','1925','0','','0','0.00','0','0','0','0'); -- id=646
UPDATE sellbilldetail SET  lastbuyprice = 34.00 , meanbuyprice = 34.00, lastbuyprice_withDiscount = 34.00, meanbuyprice_withDiscount = 34.00
        , lastbuyprice_withTax = 34, meanbuyprice_withTax = 34, lastbuyprice_withDiscountAndTax = 34
                where sellbilldetailid = 646;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (169, '2026-09-22', 1925, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1925, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 1925, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1925, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-22 14:41:23' WHERE storedetailid = '169';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('169', '1', '50', '1', '96', 'اضافة فاتورة مبيعات', 'sellbillController.php', '135', '85', '1', '2026-09-22 14:41:23','0','0'); -- id=1402
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 28;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('64','00170', '96', '2', '170', '20', '74', '1480', '0', '', '0', '2026-09-22 14:41:23', '170', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','28-20,','1','1','0','0','74','1480','0','','0','0.00','0','0','0','0'); -- id=647
UPDATE sellbilldetail SET  lastbuyprice = 64.00 , meanbuyprice = 64.00, lastbuyprice_withDiscount = 64.00, meanbuyprice_withDiscount = 64.00
        , lastbuyprice_withTax = 64, meanbuyprice_withTax = 64, lastbuyprice_withDiscountAndTax = 64
                where sellbilldetailid = 647;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (170, '2026-09-22', 1480, 1280, 1280
                    , 1280, 1280, 1280, 1280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1280, 1280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 1480, 1280, 1280
                    , 1280, 1280, 1280, 1280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1280, 1280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '93', userid = '1', storedetaildate = '2026-09-22 14:41:24' WHERE storedetailid = '170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('170', '1', '20', '1', '96', 'اضافة فاتورة مبيعات', 'sellbillController.php', '113', '93', '1', '2026-09-22 14:41:24','0','0'); -- id=1403
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('74','00171', '96', '2', '171', '20', '84', '1680', '0', '', '0', '2026-09-22 14:41:24', '171', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','84','1680','0','','0','0.00','0','0','0','0'); -- id=648
UPDATE sellbilldetail SET  lastbuyprice = 74.00 , meanbuyprice = 74.00, lastbuyprice_withDiscount = 74.00, meanbuyprice_withDiscount = 74.00
        , lastbuyprice_withTax = 74, meanbuyprice_withTax = 74, lastbuyprice_withDiscountAndTax = 74
                where sellbilldetailid = 648;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (171, '2026-09-22', 1680, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 1680, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-09-22 14:41:24' WHERE storedetailid = '171';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('171', '1', '20', '1', '96', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '9', '1', '2026-09-22 14:41:24','0','0'); -- id=1404
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-223763.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 ('-228848.84375','5085', '0', '1', 'اضافة فاتورة مبيعات', '96', '-223763.84375', '2026-09-22 14:41:24', '1',  'sellbillController.php','1','','0'); -- id=91
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5085', '5085', '2026-09-22', '1', '0', '0', '2026-09-22 14:41:24','اضافة فاتورة مبيعات رقم 96','1','0',null,'0','96','sellbillController.php?do=showDetail&sellbillid=96'); -- id=769
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('769', '383', '5085', '','0'); -- id=769
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-177071.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 ('769', '143', '5085', '','0'); -- id=769
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '308636.4', 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 ( '4460', '4460', '2026-09-22', '1', '0', '0', '2026-09-22 14:41:24','اضافة فاتورة مبيعات رقم 96 - صرف البضاعة من المخزن','1','0',null,'0','96','sellbillController.php?do=showDetail&sellbillid=96'); -- id=770
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('770', '402', '4460', '','0'); -- id=770
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '289973.21', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('770', '382', '4460', '','0'); -- id=770
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2079298.36', 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='769,0,770' where sellbillid=96;
 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-22', 5085, 4460, 4460
                    , 4460, 4460, 4460, 4460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4460, 4460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5085, sellCostBuyPrice =sellCostBuyPrice+4460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4460
                        , returnSellVal = returnSellVal+0, 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-22', 5085, 4460, 4460
                    , 4460, 4460, 4460, 4460
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4460, 4460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5085, sellCostBuyPrice =sellCostBuyPrice+4460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4460
                        , returnSellVal = returnSellVal+0, 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, 5085, 4460, 4460
                    , 4460, 4460, 4460, 4460, 4460, 4460)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5085, netSellCostBuyPrice = netSellCostBuyPrice+4460
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4460
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4460
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4460
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4460
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4460
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4460
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4460;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab2774ef353c and sellbillId = 96 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

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

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab277770224d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(24,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-22 15:20:57', '06ab277770224d', '24', '2621.00', '4271', '0', '1', '3650.00', '3650', '2000', '1650', '1', '2026-09-22 15:20:57', '', '1', '0', 'وليد الهنداوي', '1', '1', '3', '0', '24 - وليد الهنداوي', '6' ,'0','','','','','-1','0','0','0','0','0','3650','0','','0','0','2000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=97
UPDATE client SET  clientdebt = '4271', userid = '1' WHERE clientid = '24';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('24','2621.00','1650','0','اضافة فاتورة مبيعات','97', '4271', '2026-09-22 15:20:57', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3650', '0', null, '0', null, null,'', '0','1','1','1650','1','2026-09-22 15:20:57','0','0','',''); -- id=168
UPDATE client SET  inUse = 0 where clientid = 24;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('1587','00241', '97', '10', '241', '1', '1750', '1750', '0', '', '1', '2026-09-22 15:20:58', '241', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','1750','1750','0','','0','','0','0','0','0'); -- id=649
UPDATE sellbilldetail SET  lastbuyprice = 1587.00 , meanbuyprice = 1587.00, lastbuyprice_withDiscount = 1587.00, meanbuyprice_withDiscount = 1587.00
        , lastbuyprice_withTax = 1587, meanbuyprice_withTax = 1587, lastbuyprice_withDiscountAndTax = 1587
                where sellbilldetailid = 649;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (241, '2026-09-22', 1750, 1587, 1587
                    , 1587, 1587, 1587, 1587
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 1587, 1587, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1750, sellCostBuyPrice =sellCostBuyPrice+1587
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1587, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1587, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1587
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1587
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1587
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 1750, 1587, 1587
                    , 1587, 1587, 1587, 1587
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1587, 1587, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1750, sellCostBuyPrice =sellCostBuyPrice+1587
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1587, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1587
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1587, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1587
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1587
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1587
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1587
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-22 15:20:58' WHERE storedetailid = '241';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('241', '1', '1', '1', '97', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2', '1', '1', '2026-09-22 15:20:58','0','0'); -- id=1405
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312','00070', '97', '12', '70', '5', '380', '1900', '0', '', '1', '2026-09-22 15:20:58', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','380','1900','0','','0','0.00','0','0','0','0'); -- id=650
UPDATE sellbilldetail SET  lastbuyprice = 312.00 , meanbuyprice = 312.00, lastbuyprice_withDiscount = 312.00, meanbuyprice_withDiscount = 312.00
        , lastbuyprice_withTax = 312, meanbuyprice_withTax = 312, lastbuyprice_withDiscountAndTax = 312
                where sellbilldetailid = 650;
 INSERT INTO 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-22', 1900, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 1900, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2026-09-22 15:20:58' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '5', '1', '97', 'اضافة فاتورة مبيعات', 'sellbillController.php', '47', '42', '1', '2026-09-22 15:20:58','0','0'); -- id=1406
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-221763.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 ('-223763.84375','2000', '0', '1', 'اضافة فاتورة مبيعات', '97', '-221763.84375', '2026-09-22 15:20:58', '1',  'sellbillController.php','24','','0'); -- id=92
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3650', '3650', '2026-09-22', '1', '0', '0', '2026-09-22 15:20:59','اضافة فاتورة مبيعات رقم 97','1','0',null,'0','97','sellbillController.php?do=showDetail&sellbillid=97'); -- id=771
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('771', '453', '3650', '','0'); -- id=771
UPDATE accountstree SET name = 'وليد الهنداوي', customName = 'وليد الهنداوي', customNameEn = 'وليد الهنداوي', nameEn = 'وليد الهنداوي', parent = '58', accountNature = '0', theValue = '6271', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:39:30' WHERE id = '453';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('771', '143', '3650', '','0'); -- id=771
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '312286.4', 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 ( '2000', '2000', '2026-09-22', '1', '0', '0', '2026-09-22 15:20:59','اضافة فاتورة مبيعات رقم 97 - تحصيل الفاتورة من العميل','1','0',null,'0','97','sellbillController.php?do=showDetail&sellbillid=97'); -- id=772
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('772', '383', '2000', '','0'); -- id=772
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-175071.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 ('772', '453', '2000', '','0'); -- id=772
UPDATE accountstree SET name = 'وليد الهنداوي', customName = 'وليد الهنداوي', customNameEn = 'وليد الهنداوي', nameEn = 'وليد الهنداوي', parent = '58', accountNature = '0', theValue = '4271', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-21 21:39:30' WHERE id = '453';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3147', '3147', '2026-09-22', '1', '0', '0', '2026-09-22 15:20:59','اضافة فاتورة مبيعات رقم 97 - صرف البضاعة من المخزن','1','0',null,'0','97','sellbillController.php?do=showDetail&sellbillid=97'); -- id=773
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('773', '402', '3147', '','0'); -- id=773
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '293120.21', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('773', '382', '3147', '','0'); -- id=773
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2076151.36', 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='771,772,773' where sellbillid=97;
 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-22', 3650, 3147, 3147
                    , 3147, 3147, 3147, 3147
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3147, 3147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3650, sellCostBuyPrice =sellCostBuyPrice+3147
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3147, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3147
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3147, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3147
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3147
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3147
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3147
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (24, '2026-09-22', 3650, 3147, 3147
                    , 3147, 3147, 3147, 3147
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3147, 3147, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3650, sellCostBuyPrice =sellCostBuyPrice+3147
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3147, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3147
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3147, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3147
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3147
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3147
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3147
                        , returnSellVal = returnSellVal+0, 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, 3650, 3147, 3147
                    , 3147, 3147, 3147, 3147, 3147, 3147)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3650, netSellCostBuyPrice = netSellCostBuyPrice+3147
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3147
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3147
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3147
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3147
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3147
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3147
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3147;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab277770224d and sellbillId = 97 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 11:51:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 15:21:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 15:21:00', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2027
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 12:52:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 16:22:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 16:22:08', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 12:53:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 16:23:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 16:23:41', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2029
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 12:54:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 16:24:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 16:24:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2030
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 ('06ab28f78bb2df', '2026-09-22 16:23:52', '1', '31626.00', '32676', '0', '0', '1050.00',  '1050.00', '', '1050', '1', '2026-09-22 16:24:15', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=13
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 ('00222', '13', '13', '222', '10', '105', '1050.00', '0', '', '2026-09-22 16:24:15', '222','','','0','0','0','0','0',null,'105','1050','0','0','0','0','0','0','0','0','1'); -- id=35
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 16:23:52', 1, 222, 0, 0
                    , 105, 10, 0, 0, 1, '2026-09-22 16:24:16')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 16:24:16' ; -- id=35
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('222', '105', '10', '0', 'buyBillController.php', '35', '', '0', '0'); -- id=35
UPDATE product SET  productBuyPrice = "105" WHERE productId = 222 ;
UPDATE buybilldetail SET  quantitybefore = 4 WHERE buybilldetailid = 35 ;
UPDATE product SET productName = 'بواط صاج 20 في 20 حجازي', productDescription = '', productCatId = '13', productBuyPrice = '105.00', productSellAllPrice = '110.00', productSellUnitPrice = '110.00', productSellHalfPrice = '110.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00222',type ='0', expireDate = '0' , dailyentryId = '253',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.76' , buyhalf_precentage = '4.76' , buypart_precentage = '4.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '222';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 35;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 222;
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '222';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('222', '1', '10', '0', '13', 'اضافة فاتورة مشتريات', 'buyBillController.php', '4', '14', '1', '2026-09-22 16:23:52','0','0'); -- id=1407
UPDATE supplier SET  suppliercurrentDebt = '32676',suppliercurrentDebtInCurrency= '32676' , userid = '1', supplierdate = '2026-09-22 16:24:15'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '31626.00', '1050', '0', 'اضافة فاتورة مشتريات', '13', '32676', '2026-09-22 16:23:52', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','1050','1','31626','1050','32676','0',''); -- id=34
update buybill set dailyentryid='0,0' where buybillid=13;
COMMIT;
UPDATE product SET overAllAveragePrice = 105 WHERE productId = 222;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 12:54:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 16:24:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 16:24:17', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=13'); -- id=2031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:19:00";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 17:49:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 17:49:04', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2032
UPDATE productunit SET unitid = '1', productid = '164', productnumber = '1.00', productunitdate = '2026-09-15', userid = '1', conditions = '0',proUnitParcode='0016401',proUnitSellAllPrice='10',proUnitSellHalfPrice='10',proUnitSellUnitPrice ='12',proUnitBuyPrice='8.75',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '164';
UPDATE product SET productName = 'لمبه 13 وات ايجي قلاوظ سنه', productDescription = '', productCatId = '2', productBuyPrice = '8.5', productSellAllPrice = '10', productSellUnitPrice = '12', productSellHalfPrice = '10', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00164',type ='0', expireDate = '0' , dailyentryId = '182',isService = '0',isOptic = '0',lastbuyprice = '8.75',lastbuyprice_withDiscount = '8.75',meanbuyprice = '8.75',meanbuyprice_withDiscount = '8.75' , productbuypricereal = '8.75' , buypricereal_precentage = '0' , buytotal_precentage = '2.86' , buyhalf_precentage = '2.86' , buypart_precentage = '37.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='8.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='8.75',meanbuyprice_withTax='8.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='8.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '164';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 18:02:12', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2033
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 ('06ab2a3718dd68', '2026-09-22 17:49:05', '8', '6000.00', '7000', '0', '0', '13640.00',  '13640.00', '12640', '1000', '1', '2026-09-22 18:02:12', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=14
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 ('00165', '14', '2', '165', '100', '8.75', '875.00', '0', '', '2026-09-22 18:02:12', '165','','','0','0','0','0','0',null,'8.75','875','0','0','0','0','0','0','0','0','1'); -- id=36
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 165, 0, 0
                    , 8.75, 100, 0, 0, 1, '2026-09-22 18:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 8.75,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:13' ; -- id=36
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('165', '8.75', '100', '0', 'buyBillController.php', '36', '', '0', '0'); -- id=36
UPDATE product SET  productBuyPrice = "8.75" WHERE productId = 165 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 36 ;
UPDATE product SET productName = 'لمبه 13 وات ايجي مسمار', productDescription = '', productCatId = '2', productBuyPrice = '8.75', productSellAllPrice = '11.00', productSellUnitPrice = '11.00', productSellHalfPrice = '11.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00165',type ='0', expireDate = '0' , dailyentryId = '183',isService = '0',isOptic = '0',lastbuyprice = '8.75',lastbuyprice_withDiscount = '8.75',meanbuyprice = '8.75',meanbuyprice_withDiscount = '8.75' , productbuypricereal = '8.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '2.86' , buypart_precentage = '2.86',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='8.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='8.75',meanbuyprice_withTax='8.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='8.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '165';
UPDATE buybilldetail SET  lastbuyprice = 8.75 , meanbuyprice = 8.75, lastbuyprice_withDiscount = 8.75, meanbuyprice_withDiscount = 8.75
        , lastbuyprice_withTax = 8.75, meanbuyprice_withTax = 8.75, lastbuyprice_withDiscountAndTax = 8.75
                where buybilldetailid = 36;
UPDATE productunit SET proUnitBuyPrice  = 8.75 * productnumber WHERE productid = 165;
UPDATE storedetail SET  productquantity = '100', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '165';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('165', '1', '100', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '100', '1', '2026-09-22 17:49:05','0','0'); -- id=1408
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 ('00164', '14', '2', '164', '150', '8.5', '1275.00', '0', '', '2026-09-22 18:02:12', '164','','','0','0','0','0','0',null,'8.5','1275','0','0','0','0','0','0','0','0','1'); -- id=37
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 164, 0, 0
                    , 8.5, 150, 0, 0, 1, '2026-09-22 18:02:13')
                ON DUPLICATE KEY UPDATE buyprice = 8.5,
                        buyQuantity =buyQuantity+150, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:13' ; -- id=37
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('164', '8.5', '150', '0', 'buyBillController.php', '37', '', '0', '0'); -- id=37
UPDATE product SET  productBuyPrice = "8.5" WHERE productId = 164 ;
UPDATE buybilldetail SET  quantitybefore = 50 WHERE buybilldetailid = 37 ;
UPDATE product SET productName = 'لمبه 13 وات ايجي قلاوظ سنه', productDescription = '', productCatId = '2', productBuyPrice = '8.50', productSellAllPrice = '10.00', productSellUnitPrice = '12.00', productSellHalfPrice = '10.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00164',type ='0', expireDate = '0' , dailyentryId = '182',isService = '0',isOptic = '0',lastbuyprice = '8.5',lastbuyprice_withDiscount = '8.5',meanbuyprice = '8.56',meanbuyprice_withDiscount = '8.56' , productbuypricereal = '8.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '2.86' , buypart_precentage = '37.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='8.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='8.5',meanbuyprice_withTax='8.56',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='8.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '164';
UPDATE buybilldetail SET  lastbuyprice = 8.5 , meanbuyprice = 8.56, lastbuyprice_withDiscount = 8.5, meanbuyprice_withDiscount = 8.56
        , lastbuyprice_withTax = 8.5, meanbuyprice_withTax = 8.56, lastbuyprice_withDiscountAndTax = 8.5
                where buybilldetailid = 37;
UPDATE productunit SET proUnitBuyPrice  = 8.5 * productnumber WHERE productid = 164;
UPDATE storedetail SET  productquantity = '200', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '164';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('164', '1', '150', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '50', '200', '1', '2026-09-22 17:49:05','0','0'); -- id=1409
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 ('00179', '14', '2', '179', '100', '23.5', '2350.00', '0', '', '2026-09-22 18:02:12', '179','','','0','0','0','0','0',null,'23.5','2350','0','0','0','0','0','0','0','0','1'); -- id=38
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 179, 0, 0
                    , 23.5, 100, 0, 0, 1, '2026-09-22 18:02:14')
                ON DUPLICATE KEY UPDATE buyprice = 23.5,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:14' ; -- id=38
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('179', '23.5', '100', '0', 'buyBillController.php', '38', '', '0', '0'); -- id=38
UPDATE product SET  productBuyPrice = "23.5" WHERE productId = 179 ;
UPDATE buybilldetail SET  quantitybefore = 131 WHERE buybilldetailid = 38 ;
UPDATE product SET productName = 'لمبه 15 وات الفرسان ', productDescription = '', productCatId = '2', productBuyPrice = '23.50', productSellAllPrice = '26.00', productSellUnitPrice = '30.00', productSellHalfPrice = '26.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00179',type ='0', expireDate = '0' , dailyentryId = '206',isService = '0',isOptic = '0',lastbuyprice = '23.5',lastbuyprice_withDiscount = '23.5',meanbuyprice = '23.5',meanbuyprice_withDiscount = '23.5' , productbuypricereal = '23.50' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.64' , buyhalf_precentage = '10.64' , buypart_precentage = '27.66',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='23.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='23.5',meanbuyprice_withTax='23.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='23.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 = '179';
UPDATE buybilldetail SET  lastbuyprice = 23.5 , meanbuyprice = 23.5, lastbuyprice_withDiscount = 23.5, meanbuyprice_withDiscount = 23.5
        , lastbuyprice_withTax = 23.5, meanbuyprice_withTax = 23.5, lastbuyprice_withDiscountAndTax = 23.5
                where buybilldetailid = 38;
UPDATE productunit SET proUnitBuyPrice  = 23.5 * productnumber WHERE productid = 179;
UPDATE storedetail SET  productquantity = '231', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '179';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('179', '1', '100', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '131', '231', '1', '2026-09-22 17:49:05','0','0'); -- id=1410
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00169', '14', '2', '169', '150', '34', '5100.00', '0', '', '2026-09-22 18:02:12', '169','','','0','0','0','0','0',null,'34','5100','0','0','0','0','0','0','0','0','1'); -- id=39
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 169, 0, 0
                    , 34, 150, 0, 0, 1, '2026-09-22 18:02:15')
                ON DUPLICATE KEY UPDATE buyprice = 34,
                        buyQuantity =buyQuantity+150, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:15' ; -- id=39
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('169', '34', '150', '0', 'buyBillController.php', '39', '', '0', '0'); -- id=39
UPDATE product SET  productBuyPrice = "34" WHERE productId = 169 ;
UPDATE buybilldetail SET  quantitybefore = 85 WHERE buybilldetailid = 39 ;
UPDATE product SET productName = 'لمبه 20 وات كينو قلاوظ', productDescription = '', productCatId = '2', productBuyPrice = '34.00', productSellAllPrice = '38.50', productSellUnitPrice = '50.00', productSellHalfPrice = '42.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00169',type ='0', expireDate = '0' , dailyentryId = '193',isService = '0',isOptic = '0',lastbuyprice = '34',lastbuyprice_withDiscount = '34',meanbuyprice = '34',meanbuyprice_withDiscount = '34' , productbuypricereal = '34.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.24' , buyhalf_precentage = '23.53' , buypart_precentage = '47.06',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34',meanbuyprice_withTax='34',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '169';
UPDATE buybilldetail SET  lastbuyprice = 34 , meanbuyprice = 34, lastbuyprice_withDiscount = 34, meanbuyprice_withDiscount = 34
        , lastbuyprice_withTax = 34, meanbuyprice_withTax = 34, lastbuyprice_withDiscountAndTax = 34
                where buybilldetailid = 39;
UPDATE productunit SET proUnitBuyPrice  = 34 * productnumber WHERE productid = 169;
UPDATE storedetail SET  productquantity = '235', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '169';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('169', '1', '150', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '85', '235', '1', '2026-09-22 17:49:05','0','0'); -- id=1411
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00170', '14', '2', '170', '40', '64', '2560.00', '0', '', '2026-09-22 18:02:12', '170','','','0','0','0','0','0',null,'64','2560','0','0','0','0','0','0','0','0','1'); -- id=40
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 170, 0, 0
                    , 64, 40, 0, 0, 1, '2026-09-22 18:02:16')
                ON DUPLICATE KEY UPDATE buyprice = 64,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:16' ; -- id=40
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('170', '64', '40', '0', 'buyBillController.php', '40', '', '0', '0'); -- id=40
UPDATE product SET  productBuyPrice = "64" WHERE productId = 170 ;
UPDATE buybilldetail SET  quantitybefore = 93 WHERE buybilldetailid = 40 ;
UPDATE product SET productName = 'لمبه 48 وات كينو قلاوظ', productDescription = '', productCatId = '2', productBuyPrice = '64.00', productSellAllPrice = '74.00', productSellUnitPrice = '80.00', productSellHalfPrice = '75.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00170',type ='0', expireDate = '0' , dailyentryId = '194',isService = '0',isOptic = '0',lastbuyprice = '64',lastbuyprice_withDiscount = '64',meanbuyprice = '64',meanbuyprice_withDiscount = '64' , productbuypricereal = '64.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '15.63' , buyhalf_precentage = '17.19' , buypart_precentage = '25.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='64',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='64',meanbuyprice_withTax='64',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='64',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '170';
UPDATE buybilldetail SET  lastbuyprice = 64 , meanbuyprice = 64, lastbuyprice_withDiscount = 64, meanbuyprice_withDiscount = 64
        , lastbuyprice_withTax = 64, meanbuyprice_withTax = 64, lastbuyprice_withDiscountAndTax = 64
                where buybilldetailid = 40;
UPDATE productunit SET proUnitBuyPrice  = 64 * productnumber WHERE productid = 170;
UPDATE storedetail SET  productquantity = '133', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '170';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('170', '1', '40', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '93', '133', '1', '2026-09-22 17:49:05','0','0'); -- id=1412
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 ('00171', '14', '2', '171', '20', '74', '1480.00', '0', '', '2026-09-22 18:02:12', '171','','','0','0','0','0','0',null,'74','1480','0','0','0','0','0','0','0','0','1'); -- id=41
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 17:49:05', 1, 171, 0, 0
                    , 74, 20, 0, 0, 1, '2026-09-22 18:02:17')
                ON DUPLICATE KEY UPDATE buyprice = 74,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 18:02:17' ; -- id=41
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('171', '74', '20', '0', 'buyBillController.php', '41', '', '0', '0'); -- id=41
UPDATE product SET  productBuyPrice = "74" WHERE productId = 171 ;
UPDATE buybilldetail SET  quantitybefore = 9 WHERE buybilldetailid = 41 ;
UPDATE product SET productName = 'لمبه 75 وات كينو قلاوظ ', productDescription = '', productCatId = '2', productBuyPrice = '74.00', productSellAllPrice = '84.00', productSellUnitPrice = '100.00', productSellHalfPrice = '90.00', productDate = '2026-09-15', conditions = '0', userId = '1', limitamount = '0', parcode = '00171',type ='0', expireDate = '0' , dailyentryId = '195',isService = '0',isOptic = '0',lastbuyprice = '74',lastbuyprice_withDiscount = '74',meanbuyprice = '74',meanbuyprice_withDiscount = '74' , productbuypricereal = '74.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.51' , buyhalf_precentage = '21.62' , buypart_precentage = '35.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='74',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='74',meanbuyprice_withTax='74',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='74',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '171';
UPDATE buybilldetail SET  lastbuyprice = 74 , meanbuyprice = 74, lastbuyprice_withDiscount = 74, meanbuyprice_withDiscount = 74
        , lastbuyprice_withTax = 74, meanbuyprice_withTax = 74, lastbuyprice_withDiscountAndTax = 74
                where buybilldetailid = 41;
UPDATE productunit SET proUnitBuyPrice  = 74 * productnumber WHERE productid = 171;
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '171';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('171', '1', '20', '0', '14', 'اضافة فاتورة مشتريات', 'buyBillController.php', '9', '29', '1', '2026-09-22 17:49:05','0','0'); -- id=1413
UPDATE supplier SET  suppliercurrentDebt = '7000',suppliercurrentDebtInCurrency= '7000' , userid = '1', supplierdate = '2026-09-22 18:02:12'   WHERE supplierid = '8';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('8', '6000.00', '1000', '0', 'اضافة فاتورة مشتريات', '14', '7000', '2026-09-22 17:49:05', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','1000','1','6000','1000','7000','0',''); -- id=35
UPDATE save SET  savecurrentvalue = '-234403.84',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-221763.84','12640', '1', '1', 'اضافة فاتورة مشتريات', '14', '-234403.84', '2026-09-22 17:49:05', '1',  'buyBillController.php','0','','0'); -- id=93
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13640', '13640', '2026-09-22', '1', '0', '0', '2026-09-22 18:02:18','اضافة فاتورة مشتريات رقم 14','1','0',null,'0','14','buyBillController.php?do=details&id=14'); -- id=774
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('774', '382', '13640', '','0'); -- id=774
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2089791.36', 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 ('774', '429', '13640', '','0'); -- id=774
UPDATE accountstree SET name = 'محمد الفرسان ', customName = 'محمد الفرسان ', customNameEn = 'محمد الفرسان ', nameEn = 'محمد الفرسان ', parent = '81', accountNature = '1', theValue = '19640', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 10:36:58' WHERE id = '429';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12640', '12640', '2026-09-22', '1', '0', '0', '2026-09-22 18:02:18','اضافة فاتورة مشتريات رقم 14 - سداد الفاتورة للمورد','1','0',null,'0','14','buyBillController.php?do=details&id=14'); -- id=775
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('775', '429', '12640', '','0'); -- id=775
UPDATE accountstree SET name = 'محمد الفرسان ', customName = 'محمد الفرسان ', customNameEn = 'محمد الفرسان ', nameEn = 'محمد الفرسان ', parent = '81', accountNature = '1', theValue = '7000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 10:36:58' WHERE id = '429';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('775', '383', '12640', '','0'); -- id=775
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-187711.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';
update buybill set dailyentryid='774,775' where buybillid=14;
COMMIT;
UPDATE product SET overAllAveragePrice = 8.5 WHERE productId = 164;UPDATE product SET overAllAveragePrice = 8.75 WHERE productId = 165;UPDATE product SET overAllAveragePrice = 34 WHERE productId = 169;UPDATE product SET overAllAveragePrice = 64 WHERE productId = 170;UPDATE product SET overAllAveragePrice = 74 WHERE productId = 171;UPDATE product SET overAllAveragePrice = 23.5 WHERE productId = 179;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 18:02:19', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=14'); -- id=2034
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-22 18:02:42', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=2035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-22 18:02:43', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-22 18:02:49', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2037
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 14:32:56";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 18:02:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 18:02:56', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2038
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:17:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:47:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:47:27', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2039

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab2a6b15fa31
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-22 19:47:27', '06ab2a6b15fa31', '2', '556.85', '611.63', '0', '1', '54.78', '54.78', '0', '54.78', '1', '2026-09-22 19:47:27', '', '1', '0', 'فؤاد الطوخي', '1', '1', '3', '0', 'فؤاد الطوخي', '1' ,'0','','','','','-1','0','0','0','0','0','54','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=98
UPDATE client SET  clientdebt = '611.63', userid = '1' WHERE clientid = '2';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('2','556.85','54.78','0','اضافة فاتورة مبيعات','98', '611.63', '2026-09-22 19:47:28', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '54.78', '0', null, '0', null, null,'', '0','1','1','54.78','1','2026-09-22 19:47:27','0','0','',''); -- id=169
UPDATE client SET  inUse = 0 where clientid = 2;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('52.75','00001', '98', '1', '1', '1', '54.78', '54.78', '0', '', '1', '2026-09-22 19:47:28', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','54.78','54.78','0','','0','0.00','0','0','0','0'); -- id=651
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 = 651;
 INSERT INTO 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-22', 54.78, 52.75, 52.75
                    , 52.75, 52.75, 52.75, 52.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 52.75, 52.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54.78, sellCostBuyPrice =sellCostBuyPrice+52.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52.75
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 54.78, 52.75, 52.75
                    , 52.75, 52.75, 52.75, 52.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 52.75, 52.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54.78, sellCostBuyPrice =sellCostBuyPrice+52.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52.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 = '678', userid = '1', storedetaildate = '2026-09-22 19:47:29' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '1', '1', '98', 'اضافة فاتورة مبيعات', 'sellbillController.php', '679', '678', '1', '2026-09-22 19:47:29','0','0'); -- id=1414
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '54.78', '54.78', '2026-09-22', '1', '0', '0', '2026-09-22 19:47:29','اضافة فاتورة مبيعات رقم 98','1','0',null,'0','98','sellbillController.php?do=showDetail&sellbillid=98'); -- id=776
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('776', '426', '54.78', '','0'); -- id=776
UPDATE accountstree SET name = 'فؤاد الطوخي', customName = 'فؤاد الطوخي', customNameEn = 'فؤاد الطوخي', nameEn = 'فؤاد الطوخي', parent = '58', accountNature = '0', theValue = '611.63', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 20:11:03' WHERE id = '426';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('776', '143', '54.78', '','0'); -- id=776
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '312341.18', 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 ( '52.75', '52.75', '2026-09-22', '1', '0', '0', '2026-09-22 19:47:29','اضافة فاتورة مبيعات رقم 98 - صرف البضاعة من المخزن','1','0',null,'0','98','sellbillController.php?do=showDetail&sellbillid=98'); -- id=777
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('777', '402', '52.75', '','0'); -- id=777
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '293172.96', 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 ('777', '382', '52.75', '','0'); -- id=777
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2089738.61', 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='776,0,777' where sellbillid=98;
 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-22', 54.78, 52.75, 52.75
                    , 52.75, 52.75, 52.75, 52.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,52.75, 52.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54.78, sellCostBuyPrice =sellCostBuyPrice+52.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52.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 (2, '2026-09-22', 54.78, 52.75, 52.75
                    , 52.75, 52.75, 52.75, 52.75
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,52.75, 52.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54.78, sellCostBuyPrice =sellCostBuyPrice+52.75
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+52.75, sellCostMeanBuyPrice = sellCostMeanBuyPrice+52.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+52.75, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+52.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+52.75
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+52.75
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+52.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, 54.78, 52.75, 52.75
                    , 52.75, 52.75, 52.75, 52.75, 52.75, 52.75)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+54.78, netSellCostBuyPrice = netSellCostBuyPrice+52.75
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+52.75
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+52.75
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+52.75
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+52.75
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+52.75
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+52.75
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+52.75;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab2a6b15fa31 and sellbillId = 98 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:17:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:47:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:47:30', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2040
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:17:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:47:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:47:51', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=2041
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:18:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:48:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:48:01', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=show'); -- id=2042
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:18:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:48:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:48:09', '1', 'editsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=87'); -- id=2043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:19:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 19:49:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 19:49:49', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2044
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:42:16";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:12:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 20:12:16', '1', 'update', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=update'); -- id=2045
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 87;
UPDATE sellbill SET  sellbillsysdate = '2026-09-22 20:12:17', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '87';
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 591;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-09-22', 64, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-64, sellCostBuyPrice =sellCostBuyPrice-63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-63, sellCostMeanBuyPrice = sellCostMeanBuyPrice-63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-63
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 64, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-64, sellCostBuyPrice =sellCostBuyPrice-63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-63, sellCostMeanBuyPrice = sellCostMeanBuyPrice-63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-63
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-09-22 20:12:17' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '0', '87', 'تعديل فاتورة مبيعات', 'sellbillController.php', '55', '56', '1', '2026-09-21 14:14:13','0','0'); -- id=1415
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 = 592;
 INSERT INTO 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-22', 273.75, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-273.75, 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-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-22', 273.75, 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.75, 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 = '1515', userid = '1', storedetaildate = '2026-09-22 20:12:17' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '25', '0', '87', 'تعديل فاتورة مبيعات', 'sellbillController.php', '1490', '1515', '1', '2026-09-21 14:14:13','0','0'); -- id=1416
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 = 593;
 INSERT INTO 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-22', 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-22', 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 = '683', userid = '1', storedetaildate = '2026-09-22 20:12:17' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '5', '0', '87', 'تعديل فاتورة مبيعات', 'sellbillController.php', '678', '683', '1', '2026-09-21 14:14:13','0','0'); -- id=1417
CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-0.019999999999982', userid = '1' WHERE clientid = '2';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('2','611.63','611.65','1','تعديل فاتورة مبيعات','87', '-0.019999999999982', '2026-09-21 14:14:13', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '611.65', '0', null, '0', null, null,'', '0','1','1','611.65','1','2026-09-21 14:14:13','0','0','',''); -- id=170
UPDATE client SET  inUse = 0 where clientid = 2;
 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-22', 611.65, 590.5, 590.5
                    , 590.5, 590.5, 590.5, 590.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,590.5, 590.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-611.65, sellCostBuyPrice =sellCostBuyPrice-590.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-590.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-590.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-590.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-590.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-590.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-590.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-590.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-09-22', 611.65, 590.5, 590.5
                    , 590.5, 590.5, 590.5, 590.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 590.5, 590.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-611.65, sellCostBuyPrice =sellCostBuyPrice-590.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-590.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice-590.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-590.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-590.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-590.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-590.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-590.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 611.65, 590.5, 590.5
                    , 590.5, 590.5, 590.5, 590.5, 590.5, 590.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-611.65, netSellCostBuyPrice = netSellCostBuyPrice-590.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-590.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-590.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-590.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-590.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-590.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-590.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-590.5;

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


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

COMMIT;
BEGIN;
CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-21 14:14:13', '06ab10df6d1aab', '2', '-0.02', '2422.88', '0', '1', '2422.9', '2422.9', '0', '2422.9', '1', '2026-09-21 14:14:13', '', '1', '0', 'فؤاد الطوخي', '1', '1', '3', '0', 'فؤاد الطوخي', '48', '87', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-21','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=99
UPDATE client SET  clientdebt = '2422.88', userid = '1' WHERE clientid = '2';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('2','-0.02','2422.9','0','اضافة فاتورة مبيعات (معدله)','99', '2422.88', '2026-09-22 20:12:18', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '2422.9', '0', null, '0', null, null,'', '0','1','1','611.65','1','2026-09-21 14:14:13','0','0','',''); -- id=171
UPDATE client SET  inUse = 0 where clientid = 2;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('63','00016', '99', '1', '16', '1.00', '64', '64', '0', '', '0', '2026-09-22 20:12:18', '16', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','64','64','0','','0','','0','0','0','0'); -- id=652
UPDATE sellbilldetail SET  lastbuyprice = 63.00 , meanbuyprice = 63.00, lastbuyprice_withDiscount = 63.00, meanbuyprice_withDiscount = 63.00
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where sellbilldetailid = 652;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (16, '2026-09-22', 64, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+64, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 64, 63, 63
                    , 63, 63, 63, 63
                    , 0, 0, 0, 0
                    , 0, 0, 0, 63, 63, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+64, sellCostBuyPrice =sellCostBuyPrice+63
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+63, sellCostMeanBuyPrice = sellCostMeanBuyPrice+63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+63, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+63
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+63
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+63
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-09-22 20:12:18' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '1', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '56', '55', '1', '2026-09-22 20:12:18','0','0'); -- id=1418
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '99', '1', '5', '25.00', '10.65', '266.25', '0', '', '0', '2026-09-22 20:12:18', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','10.65','266.25','0','','0','','0','0','0','0'); -- id=653
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 = 653;
 INSERT INTO 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-22', 266.25, 263.75, 263.75
                    , 263.75, 263.75, 263.75, 263.75
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 263.75, 263.75, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+266.25, 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+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-22', 266.25, 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+266.25, 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 = '1490', userid = '1', storedetaildate = '2026-09-22 20:12:19' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '25', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1515', '1490', '1', '2026-09-22 20:12:19','0','0'); -- id=1419
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '99', '1', '1', '5.00', '53.33', '266.65', '0', '', '0', '2026-09-22 20:12:19', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','53.33','266.65','0','','0','','0','0','0','0'); -- id=654
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 = 654;
 INSERT INTO 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-22', 266.65, 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+266.65, 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-22', 266.65, 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+266.65, 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 = '678', userid = '1', storedetaildate = '2026-09-22 20:12:19' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '5', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '683', '678', '1', '2026-09-22 20:12:19','0','0'); -- id=1420
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('84.46','00007', '99', '1', '7', '6', '84.5', '507', '0', '', '0', '2026-09-22 20:12:19', '7', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','84.5','507','0','','0','','0','0','0','0'); -- id=655
UPDATE sellbilldetail SET  lastbuyprice = 84.46 , meanbuyprice = 84.46, lastbuyprice_withDiscount = 84.46, meanbuyprice_withDiscount = 84.46
        , lastbuyprice_withTax = 84.46, meanbuyprice_withTax = 84.46, lastbuyprice_withDiscountAndTax = 84.46
                where sellbilldetailid = 655;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (7, '2026-09-22', 507, 506.76, 506.76
                    , 506.76, 506.76, 506.76, 506.76
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 506.76, 506.76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+507, sellCostBuyPrice =sellCostBuyPrice+506.76
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+506.76, sellCostMeanBuyPrice = sellCostMeanBuyPrice+506.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+506.76, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+506.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+506.76
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+506.76
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+506.76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-22', 507, 506.76, 506.76
                    , 506.76, 506.76, 506.76, 506.76
                    , 0, 0, 0, 0
                    , 0, 0, 0, 506.76, 506.76, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+507, sellCostBuyPrice =sellCostBuyPrice+506.76
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+506.76, sellCostMeanBuyPrice = sellCostMeanBuyPrice+506.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+506.76, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+506.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+506.76
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+506.76
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+506.76
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '137', userid = '1', storedetaildate = '2026-09-22 20:12:19' WHERE storedetailid = '7';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '6', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '143', '137', '1', '2026-09-22 20:12:19','0','0'); -- id=1421
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00011', '99', '1', '11', '5', '106', '530', '0', '', '0', '2026-09-22 20:12:19', '11', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','106','530','0','','0','','0','0','0','0'); -- id=656
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 656;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (11, '2026-09-22', 530, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, sellCostBuyPrice =sellCostBuyPrice+525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-22', 530, 525, 525
                    , 525, 525, 525, 525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 525, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+530, 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 = '73', userid = '1', storedetaildate = '2026-09-22 20:12:20' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '5', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '78', '73', '1', '2026-09-22 20:12:20','0','0'); -- id=1422
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('121.4','00040', '99', '1', '40', '1', '123', '123', '0', '', '0', '2026-09-22 20:12:20', '40', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','123','123','0','','0','','0','0','0','0'); -- id=657
UPDATE sellbilldetail SET  lastbuyprice = 121.40 , meanbuyprice = 121.40, lastbuyprice_withDiscount = 121.40, meanbuyprice_withDiscount = 121.40
        , lastbuyprice_withTax = 121.4, meanbuyprice_withTax = 121.4, lastbuyprice_withDiscountAndTax = 121.4
                where sellbilldetailid = 657;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (40, '2026-09-22', 123, 121.4, 121.4
                    , 121.4, 121.4, 121.4, 121.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 121.4, 121.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+123, sellCostBuyPrice =sellCostBuyPrice+121.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+121.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+121.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+121.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+121.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+121.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+121.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+121.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+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-22', 123, 121.4, 121.4
                    , 121.4, 121.4, 121.4, 121.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 121.4, 121.4, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+123, sellCostBuyPrice =sellCostBuyPrice+121.4
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+121.4, sellCostMeanBuyPrice = sellCostMeanBuyPrice+121.4
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+121.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+121.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+121.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+121.4
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+121.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 = '24', userid = '1', storedetaildate = '2026-09-22 20:12:20' WHERE storedetailid = '40';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('40', '1', '1', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '24', '1', '2026-09-22 20:12:20','0','0'); -- id=1423
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','00013', '99', '1', '13', '1', '308', '308', '0', '', '0', '2026-09-22 20:12:20', '13', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','308','308','0','','0','','0','0','0','0'); -- id=658
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 = 658;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (13, '2026-09-22', 308, 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+308, 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-22', 308, 306, 306
                    , 306, 306, 306, 306
                    , 0, 0, 0, 0
                    , 0, 0, 0, 306, 306, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+308, 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 = '17', userid = '1', storedetaildate = '2026-09-22 20:12:20' WHERE storedetailid = '13';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '1', '1', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '18', '17', '1', '2026-09-22 20:12:20','0','0'); -- id=1424
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('105','00006', '99', '1', '6', '2', '106', '212', '0', '', '0', '2026-09-22 20:12:20', '6', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','106','212','0','','0','0.00','0','0','0','0'); -- id=659
UPDATE sellbilldetail SET  lastbuyprice = 105.00 , meanbuyprice = 105.00, lastbuyprice_withDiscount = 105.00, meanbuyprice_withDiscount = 105.00
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where sellbilldetailid = 659;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-09-22', 212, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, 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+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-22', 212, 210, 210
                    , 210, 210, 210, 210
                    , 0, 0, 0, 0
                    , 0, 0, 0, 210, 210, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+212, 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 = '145', userid = '1', storedetaildate = '2026-09-22 20:12:21' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '2', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '147', '145', '1', '2026-09-22 20:12:21','0','0'); -- id=1425
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 17;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('69.5','00318', '99', '7', '318', '2', '73', '146', '0', '', '0', '2026-09-22 20:12:21', '318', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','17-2,','1','1','0','0','73','146','0','','0','0.00','0','0','0','0'); -- id=660
UPDATE sellbilldetail SET  lastbuyprice = 69.50 , meanbuyprice = 68.78, lastbuyprice_withDiscount = 69.50, meanbuyprice_withDiscount = 68.78
        , lastbuyprice_withTax = 69.5, meanbuyprice_withTax = 68.78, lastbuyprice_withDiscountAndTax = 69.5
                where sellbilldetailid = 660;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (318, '2026-09-22', 146, 139, 139
                    , 137.56, 139, 137.56, 139
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 139, 137.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+146, sellCostBuyPrice =sellCostBuyPrice+139
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+139, sellCostMeanBuyPrice = sellCostMeanBuyPrice+137.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+139, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+137.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+139
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+139
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+137.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-22', 146, 139, 139
                    , 137.56, 139, 137.56, 139
                    , 0, 0, 0, 0
                    , 0, 0, 0, 139, 137.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+146, sellCostBuyPrice =sellCostBuyPrice+139
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+139, sellCostMeanBuyPrice = sellCostMeanBuyPrice+137.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+139, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+137.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+139
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+139
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+137.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 = '65', userid = '1', storedetaildate = '2026-09-22 20:12:21' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '2', '1', '99', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '67', '65', '1', '2026-09-22 20:12:21','0','0'); -- id=1426
UPDATE dailyentry SET totalcreditor = '611.65', totaldebtor = '611.65', thedate = '2026-09-21', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-21 14:14:15', entryComment = 'اضافة فاتورة مبيعات رقم 87', fromFlag = '1',related='0',isopeningentry='0',operationId='87',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=87' WHERE id = '723';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '611.65', '611.65', '2026-09-22', '1', '0', '723', '2026-09-22 20:12:21','تم عكس القيد رقم 723 ','1','0','0','0','0',''); -- id=778
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('778', '426', '611.65', '','0'); -- id=778
UPDATE accountstree SET name = 'فؤاد الطوخي', customName = 'فؤاد الطوخي', customNameEn = 'فؤاد الطوخي', nameEn = 'فؤاد الطوخي', parent = '58', accountNature = '0', theValue = '-0.019999999999982', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 20:11:03' WHERE id = '426';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('778', '143', '611.65', '','0'); -- id=778
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '311729.53', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '590.50', totaldebtor = '590.50', thedate = '2026-09-21', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-21 14:14:15', entryComment = 'اضافة فاتورة مبيعات رقم 87 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='87',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=87' WHERE id = '724';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '590.50', '590.50', '2026-09-22', '1', '0', '724', '2026-09-22 20:12:22','تم عكس القيد رقم 724 ','1','0','0','0','0',''); -- id=779
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('779', '402', '590.50', '','0'); -- id=779
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '292582.46', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('779', '382', '590.50', '','0'); -- id=779
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2090329.11', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2422.9', '2422.9', '2026-09-22', '1', '0', '0', '2026-09-22 20:12:22','اضافة فاتورة مبيعات رقم 99','1','0',null,'0','99','sellbillController.php?do=showDetail&sellbillid=99'); -- id=780
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('780', '426', '2422.9', '','0'); -- id=780
UPDATE accountstree SET name = 'فؤاد الطوخي', customName = 'فؤاد الطوخي', customNameEn = 'فؤاد الطوخي', nameEn = 'فؤاد الطوخي', parent = '58', accountNature = '0', theValue = '2422.88', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 20:11:03' WHERE id = '426';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('780', '143', '2422.9', '','0'); -- id=780
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '314152.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 ( '2398.66', '2398.66', '2026-09-22', '1', '0', '0', '2026-09-22 20:12:22','اضافة فاتورة مبيعات رقم 99 - صرف البضاعة من المخزن','1','0',null,'0','99','sellbillController.php?do=showDetail&sellbillid=99'); -- id=781
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('781', '402', '2398.66', '','0'); -- id=781
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '294981.12', 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 ('781', '382', '2398.66', '','0'); -- id=781
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2087930.45', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='780,0,781' where sellbillid=99;
 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-22', 2422.9, 2398.66, 2398.66
                    , 2397.22, 2398.66, 2397.22, 2398.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2398.66, 2397.22, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2422.9, sellCostBuyPrice =sellCostBuyPrice+2398.66
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2398.66, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2397.22
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2398.66, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2397.22
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2398.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2398.66
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2397.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 (2, '2026-09-22', 2422.9, 2398.66, 2398.66
                    , 2397.22, 2398.66, 2397.22, 2398.66
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2398.66, 2397.22, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2422.9, sellCostBuyPrice =sellCostBuyPrice+2398.66
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2398.66, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2397.22
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2398.66, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2397.22
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2398.66
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2398.66
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2397.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, 2422.9, 2398.66, 2398.66
                    , 2397.22, 2398.66, 2397.22, 2398.66, 2398.66, 2397.22)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2422.9, netSellCostBuyPrice = netSellCostBuyPrice+2398.66
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2398.66
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2397.22
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2398.66
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2397.22
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2398.66
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2398.66
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2397.22;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 87 and newid=99 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 16:42:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:12:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 20:12:24', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=editprint&id=99'); -- id=2046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:09:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:39:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:39:36', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2047
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:09:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:39:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:39:59', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2048
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 ('06ab2cb6917339', '2026-09-22 20:39:37', '1', '32676.00', '39051', '0', '0', '6375.00',  '6375.00', '', '6375', '1', '2026-09-22 20:40:00', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=15
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 ('00076', '15', '12', '76', '1500', '4.25', '6375.00', '0', '', '2026-09-22 20:40:00', '76','','','0','0','0','0','0',null,'4.25','6375','0','0','0','0','0','0','0','0','1'); -- id=42
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:39:37', 1, 76, 0, 0
                    , 4.25, 1500, 0, 0, 1, '2026-09-22 20:40:00')
                ON DUPLICATE KEY UPDATE buyprice = 4.25,
                        buyQuantity =buyQuantity+1500, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 20:40:00' ; -- id=42
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('76', '4.25', '1500', '0', 'buyBillController.php', '42', '', '0', '0'); -- id=42
UPDATE product SET  productBuyPrice = "4.25" WHERE productId = 76 ;
UPDATE buybilldetail SET  quantitybefore = 57 WHERE buybilldetailid = 42 ;
UPDATE product SET productName = 'علبه اسبوط 4 مخرج اسمر ', productDescription = '', productCatId = '12', productBuyPrice = '4.25', productSellAllPrice = '4.50', productSellUnitPrice = '4.75', productSellHalfPrice = '4.50', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '20', parcode = '00076',type ='0', expireDate = '0' , dailyentryId = '88',isService = '0',isOptic = '0',lastbuyprice = '4.25',lastbuyprice_withDiscount = '4.25',meanbuyprice = '4.25',meanbuyprice_withDiscount = '4.25' , productbuypricereal = '4.25' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '5.88' , buypart_precentage = '11.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='4.25',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='4.25',meanbuyprice_withTax='4.25',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='4.25',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '76';
UPDATE buybilldetail 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 buybilldetailid = 42;
UPDATE productunit SET proUnitBuyPrice  = 4.25 * productnumber WHERE productid = 76;
UPDATE storedetail SET  productquantity = '1557', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '76';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('76', '1', '1500', '0', '15', 'اضافة فاتورة مشتريات', 'buyBillController.php', '57', '1557', '1', '2026-09-22 20:39:37','0','0'); -- id=1427
UPDATE supplier SET  suppliercurrentDebt = '39051',suppliercurrentDebtInCurrency= '39051' , userid = '1', supplierdate = '2026-09-22 20:40:00'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '32676.00', '6375', '0', 'اضافة فاتورة مشتريات', '15', '39051', '2026-09-22 20:39:37', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','6375','1','32676','6375','39051','0',''); -- id=36
update buybill set dailyentryid='0,0' where buybillid=15;
COMMIT;
UPDATE product SET overAllAveragePrice = 4.25 WHERE productId = 76;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:10:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:40:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:40:01', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=15'); -- id=2049
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:10:24";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:40:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:40:24', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2050
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:11:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:41:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:41:18', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2051
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 ('06ab2cb9942272', '2026-09-22 20:40:25', '1', '39051.00', '42113.5', '0', '0', '3062.50',  '3062.50', '', '3062.5', '1', '2026-09-22 20:41:19', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=16
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 ('00075', '16', '12', '75', '1750', '1.75', '3062.50', '0', '', '2026-09-22 20:41:19', '75','','','0','0','0','0','0',null,'1.75','3062.5','0','0','0','0','0','0','0','0','1'); -- id=43
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:40:25', 1, 75, 0, 0
                    , 1.75, 1750, 0, 0, 1, '2026-09-22 20:41:19')
                ON DUPLICATE KEY UPDATE buyprice = 1.75,
                        buyQuantity =buyQuantity+1750, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 20:41:19' ; -- id=43
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('75', '1.75', '1750', '0', 'buyBillController.php', '43', '', '0', '0'); -- id=43
UPDATE product SET  productBuyPrice = "1.75" WHERE productId = 75 ;
UPDATE buybilldetail SET  quantitybefore = 625 WHERE buybilldetailid = 43 ;
UPDATE product SET productName = 'خابور بلاستيك ', productDescription = '', productCatId = '12', productBuyPrice = '1.75', productSellAllPrice = '1.90', productSellUnitPrice = '1.95', productSellHalfPrice = '1.90', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '250', parcode = '00075',type ='0', expireDate = '0' , dailyentryId = '87',isService = '0',isOptic = '0',lastbuyprice = '1.75',lastbuyprice_withDiscount = '1.75',meanbuyprice = '1.75',meanbuyprice_withDiscount = '1.75' , productbuypricereal = '1.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.57' , buyhalf_precentage = '8.57' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1.75',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='1.75',meanbuyprice_withTax='1.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='1.75',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '75';
UPDATE buybilldetail SET  lastbuyprice = 1.75 , meanbuyprice = 1.75, lastbuyprice_withDiscount = 1.75, meanbuyprice_withDiscount = 1.75
        , lastbuyprice_withTax = 1.75, meanbuyprice_withTax = 1.75, lastbuyprice_withDiscountAndTax = 1.75
                where buybilldetailid = 43;
UPDATE productunit SET proUnitBuyPrice  = 1.75 * productnumber WHERE productid = 75;
UPDATE storedetail SET  productquantity = '2375', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '75';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('75', '1', '1750', '0', '16', 'اضافة فاتورة مشتريات', 'buyBillController.php', '625', '2375', '1', '2026-09-22 20:40:25','0','0'); -- id=1428
UPDATE supplier SET  suppliercurrentDebt = '42113.5',suppliercurrentDebtInCurrency= '42113.5' , userid = '1', supplierdate = '2026-09-22 20:41:19'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '39051.00', '3062.5', '0', 'اضافة فاتورة مشتريات', '16', '42113.5', '2026-09-22 20:40:25', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','3062.5','1','39051','3062.5','42113.5','0',''); -- id=37
update buybill set dailyentryid='0,0' where buybillid=16;
COMMIT;
UPDATE product SET overAllAveragePrice = 1.75 WHERE productId = 75;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:11:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:41:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:41:21', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=16'); -- id=2052
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:11:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:41:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-09-22 20:41:32', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=2053
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:11:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:41:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-22 20:41:58', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2054
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:12:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:42:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:42:18', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php'); -- id=2055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:12:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:42:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:42:43', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=add'); -- id=2056
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 ('عبده سوسته المهندسين', '', '', '0', '', '0', '1', '2026-09-22 20:42:43', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=13
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 ('13', '0', '0', '0', 'إضافة مورد جديد', '13', '0', '2026-09-22 20:42:43', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=38
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '13',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('عبده سوسته المهندسين', 'عبده سوسته المهندسين', 'عبده سوسته المهندسين', 'عبده سوسته المهندسين', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-22 20:42:45'); -- id=463
UPDATE supplier SET suppliername = 'عبده سوسته المهندسين', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-22', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='463',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '13';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:12:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:42:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:42:45', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=sucess'); -- id=2057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:12:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:42:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:42:47', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=show'); -- id=2058
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:12:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:42:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:42:50', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-09-22 20:43:09', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientReportsController.php'); -- id=2060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-22 20:43:09', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-22 20:43:13', '1', 'oneSupplier', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=2062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:18', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php'); -- id=2063
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:34', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=add'); -- id=2064
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 ('نشات', '', '', '0', '', '0', '1', '2026-09-22 20:43:35', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=14
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 ('14', '0', '0', '0', 'إضافة مورد جديد', '14', '0', '2026-09-22 20:43:35', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=39
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '14',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('نشات', 'نشات', 'نشات', 'نشات', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-22 20:43:36'); -- id=464
UPDATE supplier SET suppliername = 'نشات', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-22', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='464',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '14';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:37', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=sucess'); -- id=2065
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:39', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=show'); -- id=2066
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:49', '1', 'tempdelete', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=tempdelete&id=14'); -- id=2067
UPDATE supplier SET conditions = 1, suppliername = "نشات-del"
		        WHERE supplierid =14 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:50', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=sucess'); -- id=2068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:13:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:43:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-22 20:43:52', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierController.php?do=show'); -- id=2069
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:14:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:44:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:44:22', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2070
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:14:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:44:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 20:44:52', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:15:13";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:45:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 20:45:13', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2072
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('كشاف 100 وات واجهه','','6','675','725','725','725','2026-09-22','0','1','0','','0','0','0','0','0','675','675','675','675','675','0','7.41','7.41','7.41','.','0','0','0','675','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','675','675','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','675','0','0','0','0','0','0','','','0','0','0','0'); -- id=436
UPDATE product SET productName = 'كشاف 100 وات واجهه', productDescription = '', productCatId = '6', productBuyPrice = '675', productSellAllPrice = '725', productSellUnitPrice = '725', productSellHalfPrice = '725', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00436',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675' , buypricereal_precentage = '0' , buytotal_precentage = '7.41' , buyhalf_precentage = '7.41' , buypart_precentage = '7.41',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',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='675',meanbuyprice_withTax='675',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='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '436';
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', '436', '1.00', '2026-09-22', '1', '0','0043601','725','725','725','675','','0','0','0','0','0','0','0','0','0','0'); -- id=436
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('436', '1', '1', '1', '2026-09-22'); -- id=436
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '1', '1', '0', '436', 'إضافة منتج', 'productController.php', '0', '1', '1', '2026-09-22','0','0'); -- id=1429
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (436, 1,'2026-09-22 20:45:15',1)
                ON DUPLICATE KEY UPDATE productid = 436, edited = 1, sysdate = '2026-09-22 20:45:15', userid = 1; -- id=553
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '675', '675', '2026-09-22', '1', '0', '0', '2026-09-22 20:45:15','إضافة منتج كشاف 100 وات واجهه الكمية 1','1','0','0','0','436','productController.php?do=edit&id=436'); -- id=782
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('782', '382', '675', '','0'); -- id=782
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2088605.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 ('782', '121', '675', '','0'); -- id=782
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1208709.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 = '6', productBuyPrice = '675.00', productSellAllPrice = '725.00', productSellUnitPrice = '725.00', productSellHalfPrice = '725.00', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00436',type ='0', expireDate = '0' , dailyentryId = '782',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675' , buypricereal_precentage = '0' , buytotal_precentage = '7.41' , buyhalf_precentage = '7.41' , buypart_precentage = '7.41',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',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='675',meanbuyprice_withTax='675',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='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '436';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:15:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:45:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 20:45:17', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:15:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:45:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:45:19', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2074
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:16:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:46:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:46:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2075
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 ('06ab2ccc05142a', '2026-09-22 20:45:20', '1', '42113.50', '42113.5', '0', '0', '675.00',  '675.00', '675', '0', '1', '2026-09-22 20:46:15', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=17
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 ('00436', '17', '6', '436', '1', '675', '675.00', '0', '', '2026-09-22 20:46:15', '436','','','0','0','0','0','0',null,'675','675','0','0','0','0','0','0','0','0','1'); -- id=44
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:45:20', 1, 436, 0, 0
                    , 675, 1, 0, 0, 1, '2026-09-22 20:46:16')
                ON DUPLICATE KEY UPDATE buyprice = 675,
                        buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 20:46:16' ; -- id=44
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('436', '675', '1', '0', 'buyBillController.php', '44', '', '0', '0'); -- id=44
UPDATE product SET  productBuyPrice = "675" WHERE productId = 436 ;
UPDATE buybilldetail SET  quantitybefore = 1 WHERE buybilldetailid = 44 ;
UPDATE product SET productName = 'كشاف 100 وات واجهه', productDescription = '', productCatId = '6', productBuyPrice = '675.00', productSellAllPrice = '725.00', productSellUnitPrice = '725.00', productSellHalfPrice = '725.00', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00436',type ='0', expireDate = '0' , dailyentryId = '782',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.41' , buyhalf_precentage = '7.41' , buypart_precentage = '7.41',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',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='675',meanbuyprice_withTax='675',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='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '436';
UPDATE buybilldetail SET  lastbuyprice = 675 , meanbuyprice = 675, lastbuyprice_withDiscount = 675, meanbuyprice_withDiscount = 675
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where buybilldetailid = 44;
UPDATE productunit SET proUnitBuyPrice  = 675 * productnumber WHERE productid = 436;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '436';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '1', '1', '0', '17', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1', '2', '1', '2026-09-22 20:45:20','0','0'); -- id=1430
UPDATE supplier SET  suppliercurrentDebt = '42113.5',suppliercurrentDebtInCurrency= '42113.5' , userid = '1', supplierdate = '2026-09-22 20:46:15'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '42113.50', '0', '0', 'اضافة فاتورة مشتريات', '17', '42113.5', '2026-09-22 20:45:20', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','42113.5','0','42113.5','0',''); -- id=40
UPDATE save SET  savecurrentvalue = '-235078.84',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-234403.84','675', '1', '1', 'اضافة فاتورة مشتريات', '17', '-235078.84', '2026-09-22 20:45:20', '1',  'buyBillController.php','0','','0'); -- id=94
update buybill set dailyentryid='0,0' where buybillid=17;
COMMIT;
UPDATE product SET overAllAveragePrice = 675 WHERE productId = 436;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:16:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:46:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:46:17', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=17'); -- id=2076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:16:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:46:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2026-09-22 20:46:47', '1', 'all', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/suppliersAndProductsReportController.php?do=all'); -- id=2077
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:16:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:46:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('suppliersAndProductsReportController.php', '2026-09-22 20:46:55', '1', 'all', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/suppliersAndProductsReportController.php?do=all'); -- id=2078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:17:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:47:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-22 20:47:01', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php'); -- id=2079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:17:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:47:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-22 20:47:15', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/profitreportController.php?do=show'); -- id=2080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:17:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:47:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-22 20:47:32', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php'); -- id=2081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:17:52";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:47:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-22 20:47:52', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellBillReportsController.php?do=show'); -- id=2082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:18:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:48:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:48:12', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2083
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:18:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 20:48:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 20:48:20', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2084
UPDATE productunit SET unitid = '1', productid = '70', productnumber = '1.00', productunitdate = '2026-09-14', userid = '1', conditions = '0',proUnitParcode='0007001',proUnitSellAllPrice='380',proUnitSellHalfPrice='380',proUnitSellUnitPrice ='380',proUnitBuyPrice='312',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '70';
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو احمر', productDescription = '', productCatId = '12', productBuyPrice = '328', productSellAllPrice = '380', productSellUnitPrice = '380', productSellHalfPrice = '380', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '20', parcode = '00070',type ='0', expireDate = '0' , dailyentryId = '82',isService = '0',isOptic = '0',lastbuyprice = '312.00',lastbuyprice_withDiscount = '312',meanbuyprice = '312.00',meanbuyprice_withDiscount = '312' , productbuypricereal = '312' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='312',meanbuyprice_withTax='312',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='312',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '70';
UPDATE productunit SET unitid = '1', productid = '73', productnumber = '1.00', productunitdate = '2026-09-14', userid = '1', conditions = '0',proUnitParcode='0007301',proUnitSellAllPrice='475',proUnitSellHalfPrice='475',proUnitSellUnitPrice ='475',proUnitBuyPrice='390',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '73';
UPDATE product SET productName = 'لفه خرطوم 23 ملي مصطفي محمود 5 كيلو', productDescription = '', productCatId = '12', productBuyPrice = '410', productSellAllPrice = '475', productSellUnitPrice = '475', productSellHalfPrice = '475', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '5', parcode = '00073',type ='0', expireDate = '0' , dailyentryId = '85',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '73';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:50:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 21:20:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 21:20:30', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:52:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 21:22:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-22 21:22:05', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientController.php'); -- id=2086
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 17:53:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 21:23:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 21:23:03', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2087
UPDATE productunit SET unitid = '1', productid = '70', productnumber = '1.00', productunitdate = '2026-09-14', userid = '1', conditions = '0',proUnitParcode='0007001',proUnitSellAllPrice='380',proUnitSellHalfPrice='380',proUnitSellUnitPrice ='380',proUnitBuyPrice='312',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '70';
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو احمر', productDescription = '', productCatId = '12', productBuyPrice = '332', productSellAllPrice = '380', productSellUnitPrice = '380', productSellHalfPrice = '380', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '20', parcode = '00070',type ='0', expireDate = '0' , dailyentryId = '82',isService = '0',isOptic = '0',lastbuyprice = '312.00',lastbuyprice_withDiscount = '312',meanbuyprice = '312.00',meanbuyprice_withDiscount = '312' , productbuypricereal = '312' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='312',meanbuyprice_withTax='312',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='312',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '70';
UPDATE productunit SET unitid = '1', productid = '73', productnumber = '1.00', productunitdate = '2026-09-14', userid = '1', conditions = '0',proUnitParcode='0007301',proUnitSellAllPrice='475',proUnitSellHalfPrice='475',proUnitSellUnitPrice ='475',proUnitBuyPrice='390',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '73';
UPDATE product SET productName = 'لفه خرطوم 23 ملي مصطفي محمود 5 كيلو', productDescription = '', productCatId = '12', productBuyPrice = '415', productSellAllPrice = '475', productSellUnitPrice = '475', productSellHalfPrice = '475', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '5', parcode = '00073',type ='0', expireDate = '0' , dailyentryId = '85',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '73';
UPDATE productunit SET unitid = '1', productid = '83', productnumber = '1.00', productunitdate = '2026-09-14', userid = '1', conditions = '0',proUnitParcode='0008301',proUnitSellAllPrice='45',proUnitSellHalfPrice='45',proUnitSellUnitPrice ='45',proUnitBuyPrice='42.3',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '83';
UPDATE product SET productName = 'لفه سوسته 16 ملي رصاصي', productDescription = '', productCatId = '12', productBuyPrice = '39.6', productSellAllPrice = '45', productSellUnitPrice = '45', productSellHalfPrice = '45', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '40', parcode = '00083',type ='0', expireDate = '0' , dailyentryId = '99',isService = '0',isOptic = '0',lastbuyprice = '42.30',lastbuyprice_withDiscount = '42.3',meanbuyprice = '42.30',meanbuyprice_withDiscount = '42.3' , productbuypricereal = '42.3' , buypricereal_precentage = '0' , buytotal_precentage = '6.38' , buyhalf_precentage = '6.38' , buypart_precentage = '6.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='42.3',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='42.3',meanbuyprice_withTax='42.3',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='42.3',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '83';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 18:10:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 21:40:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 21:40:47', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=2088
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 ('06ab2cd757dace', '2026-09-22 20:48:21', '13', '0.00', '3145', '0', '0', '33145.00',  '33145.00', '30000', '3145', '1', '2026-09-22 21:40:48', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=18
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 ('00070', '18', '12', '70', '40', '332', '13280.00', '0', '', '2026-09-22 21:40:48', '70','','','0','0','0','0','0',null,'332','13280','0','0','0','0','0','0','0','0','1'); -- id=45
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:48:21', 1, 70, 0, 0
                    , 332, 40, 0, 0, 1, '2026-09-22 21:40:48')
                ON DUPLICATE KEY UPDATE buyprice = 332,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 21:40:48' ; -- id=45
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('70', '332', '40', '0', 'buyBillController.php', '45', '', '0', '0'); -- id=45
UPDATE product SET  productBuyPrice = "332" WHERE productId = 70 ;
UPDATE buybilldetail SET  quantitybefore = 42 WHERE buybilldetailid = 45 ;
UPDATE product SET productName = 'لفه خرطوم 16 ملي مصطفي محمود 4 كيلو احمر', productDescription = '', productCatId = '12', productBuyPrice = '332.00', productSellAllPrice = '380.00', productSellUnitPrice = '380.00', productSellHalfPrice = '380.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '20', parcode = '00070',type ='0', expireDate = '0' , dailyentryId = '82',isService = '0',isOptic = '0',lastbuyprice = '332',lastbuyprice_withDiscount = '332',meanbuyprice = '321.76',meanbuyprice_withDiscount = '321.76' , productbuypricereal = '312.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='312',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='332',meanbuyprice_withTax='321.76',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='332',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '70';
UPDATE buybilldetail SET  lastbuyprice = 332 , meanbuyprice = 321.76, lastbuyprice_withDiscount = 332, meanbuyprice_withDiscount = 321.76
        , lastbuyprice_withTax = 332, meanbuyprice_withTax = 321.76, lastbuyprice_withDiscountAndTax = 332
                where buybilldetailid = 45;
UPDATE productunit SET proUnitBuyPrice  = 332 * productnumber WHERE productid = 70;
UPDATE storedetail SET  productquantity = '82', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '40', '0', '18', 'اضافة فاتورة مشتريات', 'buyBillController.php', '42', '82', '1', '2026-09-22 20:48:21','0','0'); -- id=1431
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 ('00073', '18', '12', '73', '15', '415', '6225.00', '0', '', '2026-09-22 21:40:48', '73','','','0','0','0','0','0',null,'415','6225','0','0','0','0','0','0','0','0','1'); -- id=46
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:48:21', 1, 73, 0, 0
                    , 415, 15, 0, 0, 1, '2026-09-22 21:40:49')
                ON DUPLICATE KEY UPDATE buyprice = 415,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 21:40:49' ; -- id=46
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('73', '415', '15', '0', 'buyBillController.php', '46', '', '0', '0'); -- id=46
UPDATE product SET  productBuyPrice = "415" WHERE productId = 73 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 46 ;
UPDATE product SET productName = 'لفه خرطوم 23 ملي مصطفي محمود 5 كيلو', productDescription = '', productCatId = '12', productBuyPrice = '415.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '5', parcode = '00073',type ='0', expireDate = '0' , dailyentryId = '85',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '407.05',meanbuyprice_withDiscount = '407.05' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.56' , buyhalf_precentage = '2.56' , buypart_precentage = '5.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='415',meanbuyprice_withTax='407.05',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '73';
UPDATE buybilldetail SET  lastbuyprice = 415 , meanbuyprice = 407.05, lastbuyprice_withDiscount = 415, meanbuyprice_withDiscount = 407.05
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 407.05, lastbuyprice_withDiscountAndTax = 415
                where buybilldetailid = 46;
UPDATE productunit SET proUnitBuyPrice  = 415 * productnumber WHERE productid = 73;
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '73';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('73', '1', '15', '0', '18', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '22', '1', '2026-09-22 20:48:21','0','0'); -- id=1432
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 ('00082', '18', '12', '82', '250', '30.8', '7700.00', '0', '', '2026-09-22 21:40:48', '82','','','0','0','0','0','0',null,'30.8','7700','0','0','0','0','0','0','0','0','1'); -- id=47
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:48:21', 1, 82, 0, 0
                    , 30.8, 250, 0, 0, 1, '2026-09-22 21:40:50')
                ON DUPLICATE KEY UPDATE buyprice = 30.8,
                        buyQuantity =buyQuantity+250, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 21:40:50' ; -- id=47
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('82', '30.8', '250', '0', 'buyBillController.php', '47', '', '0', '0'); -- id=47
UPDATE product SET  productBuyPrice = "30.8" WHERE productId = 82 ;
UPDATE buybilldetail SET  quantitybefore = 98 WHERE buybilldetailid = 47 ;
UPDATE product SET productName = 'لفه سوسته 13 ملي رصاصي', productDescription = '', productCatId = '12', productBuyPrice = '30.80', productSellAllPrice = '34.00', productSellUnitPrice = '34.00', productSellHalfPrice = '34.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '30', parcode = '00082',type ='0', expireDate = '0' , dailyentryId = '98',isService = '0',isOptic = '0',lastbuyprice = '30.8',lastbuyprice_withDiscount = '30.8',meanbuyprice = '30.8',meanbuyprice_withDiscount = '30.8' , productbuypricereal = '30.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.39' , buyhalf_precentage = '10.39' , buypart_precentage = '10.39',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='30.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='30.8',meanbuyprice_withTax='30.8',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='30.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 = '82';
UPDATE buybilldetail SET  lastbuyprice = 30.8 , meanbuyprice = 30.8, lastbuyprice_withDiscount = 30.8, meanbuyprice_withDiscount = 30.8
        , lastbuyprice_withTax = 30.8, meanbuyprice_withTax = 30.8, lastbuyprice_withDiscountAndTax = 30.8
                where buybilldetailid = 47;
UPDATE productunit SET proUnitBuyPrice  = 30.8 * productnumber WHERE productid = 82;
UPDATE storedetail SET  productquantity = '348', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '82';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('82', '1', '250', '0', '18', 'اضافة فاتورة مشتريات', 'buyBillController.php', '98', '348', '1', '2026-09-22 20:48:21','0','0'); -- id=1433
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 ('00083', '18', '12', '83', '150', '39.6', '5940.00', '0', '', '2026-09-22 21:40:48', '83','','','0','0','0','0','0',null,'39.6','5940','0','0','0','0','0','0','0','0','1'); -- id=48
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-22 20:48:21', 1, 83, 0, 0
                    , 39.6, 150, 0, 0, 1, '2026-09-22 21:40:51')
                ON DUPLICATE KEY UPDATE buyprice = 39.6,
                        buyQuantity =buyQuantity+150, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-22 21:40:51' ; -- id=48
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('83', '39.6', '150', '0', 'buyBillController.php', '48', '', '0', '0'); -- id=48
UPDATE product SET  productBuyPrice = "39.6" WHERE productId = 83 ;
UPDATE buybilldetail SET  quantitybefore = 139 WHERE buybilldetailid = 48 ;
UPDATE product SET productName = 'لفه سوسته 16 ملي رصاصي', productDescription = '', productCatId = '12', productBuyPrice = '39.60', productSellAllPrice = '45.00', productSellUnitPrice = '45.00', productSellHalfPrice = '45.00', productDate = '2026-09-14', conditions = '0', userId = '1', limitamount = '40', parcode = '00083',type ='0', expireDate = '0' , dailyentryId = '99',isService = '0',isOptic = '0',lastbuyprice = '39.6',lastbuyprice_withDiscount = '39.6',meanbuyprice = '40.9',meanbuyprice_withDiscount = '40.9' , productbuypricereal = '42.30' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.38' , buyhalf_precentage = '6.38' , buypart_precentage = '6.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='42.3',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='39.6',meanbuyprice_withTax='40.9',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='39.6',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '83';
UPDATE buybilldetail SET  lastbuyprice = 39.6 , meanbuyprice = 40.9, lastbuyprice_withDiscount = 39.6, meanbuyprice_withDiscount = 40.9
        , lastbuyprice_withTax = 39.6, meanbuyprice_withTax = 40.9, lastbuyprice_withDiscountAndTax = 39.6
                where buybilldetailid = 48;
UPDATE productunit SET proUnitBuyPrice  = 39.6 * productnumber WHERE productid = 83;
UPDATE storedetail SET  productquantity = '289', userid = '1', storedetaildate = '2026-09-22' WHERE storedetailid = '83';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('83', '1', '150', '0', '18', 'اضافة فاتورة مشتريات', 'buyBillController.php', '139', '289', '1', '2026-09-22 20:48:21','0','0'); -- id=1434
UPDATE supplier SET  suppliercurrentDebt = '3145',suppliercurrentDebtInCurrency= '3145' , userid = '1', supplierdate = '2026-09-22 21:40:48'   WHERE supplierid = '13';
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 ('13', '0.00', '3145', '0', 'اضافة فاتورة مشتريات', '18', '3145', '2026-09-22 20:48:21', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','3145','1','0','3145','3145','0',''); -- id=41
UPDATE save SET  savecurrentvalue = '-265078.84',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-235078.84','30000', '1', '1', 'اضافة فاتورة مشتريات', '18', '-265078.84', '2026-09-22 20:48:21', '1',  'buyBillController.php','0','','0'); -- id=95
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '33145', '33145', '2026-09-22', '1', '0', '0', '2026-09-22 21:40:52','اضافة فاتورة مشتريات رقم 18','1','0',null,'0','18','buyBillController.php?do=details&id=18'); -- id=783
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('783', '382', '33145', '','0'); -- id=783
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2121750.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 ('783', '463', '33145', '','0'); -- id=783
UPDATE accountstree SET name = 'عبده سوسته المهندسين', customName = 'عبده سوسته المهندسين', customNameEn = 'عبده سوسته المهندسين', nameEn = 'عبده سوسته المهندسين', parent = '81', accountNature = '1', theValue = '33145', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-22 20:42:45' WHERE id = '463';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-09-22', '1', '0', '0', '2026-09-22 21:40:52','اضافة فاتورة مشتريات رقم 18 - سداد الفاتورة للمورد','1','0',null,'0','18','buyBillController.php?do=details&id=18'); -- id=784
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('784', '463', '30000', '','0'); -- id=784
UPDATE accountstree SET name = 'عبده سوسته المهندسين', customName = 'عبده سوسته المهندسين', customNameEn = 'عبده سوسته المهندسين', nameEn = 'عبده سوسته المهندسين', parent = '81', accountNature = '1', theValue = '3145', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-22 20:42:45' WHERE id = '463';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('784', '383', '30000', '','0'); -- id=784
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-217711.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';
update buybill set dailyentryid='783,784' where buybillid=18;
COMMIT;
UPDATE product SET overAllAveragePrice = 332 WHERE productId = 70;UPDATE product SET overAllAveragePrice = 415 WHERE productId = 73;UPDATE product SET overAllAveragePrice = 30.8 WHERE productId = 82;UPDATE product SET overAllAveragePrice = 39.6 WHERE productId = 83;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 18:10:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 21:40:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-22 21:40:53', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=18'); -- id=2089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:24:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:54:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 22:54:09', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2090

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ab2d598094d2
-- ----------------------------------------------------------------------------------------------------

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-22 22:54:09', '06ab2d598094d2', '1', '0.00', '0', '0', '1', '2945.00', '2945', '2945', '0', '1', '2026-09-22 22:54:09', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','2945','0','','0','0','2945','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-22','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=100
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','اضافة فاتورة مبيعات','100', '0', '2026-09-22 22:54:10', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2945', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-22 22:54:09','0','0','',''); -- id=172
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('2600','00252', '100', '10', '252', '1', '2945', '2945', '0', '', '1', '2026-09-22 22:54:10', '252', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','2945','2945','0','','0','0.00','0','0','0','0'); -- id=661
UPDATE sellbilldetail SET  lastbuyprice = 2600.00 , meanbuyprice = 2600.00, lastbuyprice_withDiscount = 2600.00, meanbuyprice_withDiscount = 2600.00
        , lastbuyprice_withTax = 2600, meanbuyprice_withTax = 2600, lastbuyprice_withDiscountAndTax = 2600
                where sellbilldetailid = 661;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (252, '2026-09-22', 2945, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2945, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-22', 2945, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2945, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-22 22:54:10' WHERE storedetailid = '252';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('252', '1', '1', '1', '100', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '20', '1', '2026-09-22 22:54:10','0','0'); -- id=1435
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-262133.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 ('-265078.84375','2945', '0', '1', 'اضافة فاتورة مبيعات', '100', '-262133.84375', '2026-09-22 22:54:10', '1',  'sellbillController.php','1','','0'); -- id=96
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2945', '2945', '2026-09-22', '1', '0', '0', '2026-09-22 22:54:10','اضافة فاتورة مبيعات رقم 100','1','0',null,'0','100','sellbillController.php?do=showDetail&sellbillid=100'); -- id=785
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('785', '383', '2945', '','0'); -- id=785
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-214766.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 ('785', '143', '2945', '','0'); -- id=785
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '317097.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 ( '2600', '2600', '2026-09-22', '1', '0', '0', '2026-09-22 22:54:10','اضافة فاتورة مبيعات رقم 100 - صرف البضاعة من المخزن','1','0',null,'0','100','sellbillController.php?do=showDetail&sellbillid=100'); -- id=786
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('786', '402', '2600', '','0'); -- id=786
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '297581.12', 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 ('786', '382', '2600', '','0'); -- id=786
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2119150.45', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='785,0,786' where sellbillid=100;
 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-22', 2945, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2945, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, 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-22', 2945, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2945, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, 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, 2945, 2600, 2600
                    , 2600, 2600, 2600, 2600, 2600, 2600)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2945, netSellCostBuyPrice = netSellCostBuyPrice+2600
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2600
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2600
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2600
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2600
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2600;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ab2d598094d2 and sellbillId = 100 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:24:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:54:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 22:54:12', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:24:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:54:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 22:54:28', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=show'); -- id=2092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:24:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:54:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 22:54:33', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2093
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:25:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:55:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 22:55:07', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php?do=add'); -- id=2094
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 ('متر سلك 4 ملي الفؤاد','','10','26.5','29','31.5','29','2026-09-22','0','1','0','','0','0','0','0','0','26.5','26.5','26.5','26.5','26.5','0','9.43','9.43','18.87','.','0','0','0','26.5','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','26.5','26.5','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','26.5','0','0','0','0','0','0','','','0','0','0','0'); -- id=437
UPDATE product SET productName = 'متر سلك 4 ملي الفؤاد', productDescription = '', productCatId = '10', productBuyPrice = '26.5', productSellAllPrice = '29', productSellUnitPrice = '31.5', productSellHalfPrice = '29', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00437',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '26.5',lastbuyprice_withDiscount = '26.5',meanbuyprice = '26.5',meanbuyprice_withDiscount = '26.5' , productbuypricereal = '26.5' , buypricereal_precentage = '0' , buytotal_precentage = '9.43' , buyhalf_precentage = '9.43' , buypart_precentage = '18.87',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26.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='26.5',meanbuyprice_withTax='26.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='26.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 = '437';
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', '437', '1.00', '2026-09-22', '1', '0','0043701','29','29','31.5','26.5','','0','0','0','0','0','0','0','0','0','0'); -- id=437
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('437', '1', '90', '1', '2026-09-22'); -- id=437
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('437', '1', '90', '0', '437', 'إضافة منتج', 'productController.php', '0', '90', '1', '2026-09-22','0','0'); -- id=1436
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (437, 1,'2026-09-22 22:55:09',1)
                ON DUPLICATE KEY UPDATE productid = 437, edited = 1, sysdate = '2026-09-22 22:55:09', userid = 1; -- id=554
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2385', '2385', '2026-09-22', '1', '0', '0', '2026-09-22 22:55:09','إضافة منتج متر سلك 4 ملي الفؤاد الكمية 90','1','0','0','0','437','productController.php?do=edit&id=437'); -- id=787
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('787', '382', '2385', '','0'); -- id=787
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2121535.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 ('787', '121', '2385', '','0'); -- id=787
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '1211094.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 = 'متر سلك 4 ملي الفؤاد', productDescription = '', productCatId = '10', productBuyPrice = '26.50', productSellAllPrice = '29.00', productSellUnitPrice = '31.50', productSellHalfPrice = '29.00', productDate = '2026-09-22', conditions = '0', userId = '1', limitamount = '0', parcode = '00437',type ='0', expireDate = '0' , dailyentryId = '787',isService = '0',isOptic = '0',lastbuyprice = '26.5',lastbuyprice_withDiscount = '26.5',meanbuyprice = '26.5',meanbuyprice_withDiscount = '26.5' , productbuypricereal = '26.5' , buypricereal_precentage = '0' , buytotal_precentage = '9.43' , buyhalf_precentage = '9.43' , buypart_precentage = '18.87',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='26.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='26.5',meanbuyprice_withTax='26.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='26.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 = '437';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:25:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:55:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-22 22:55:11', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/productController.php'); -- id=2095
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-22 19:25:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-09-22 22:55:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-22 22:55:18', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2096
