UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:46:01";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:46:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:16:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-05 12:16:30', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/index.php'); -- id=3493
UPDATE programsettings SET companyname = 'الشاذلي للاضاءه الحديثه', address = ' العنوان :كفر بهيده بجوار المستشفي<br/> المرتجع خلال 3 اشهورمن تاريخ الفاتوره<br/>الا الاسلاك خلال 20يوم<br/>ممنوع رجوع الاسلاك والليد المفتوح', specializtion = '', phone = '01096879556-01091024885', faxnumber = '', email = 'mousa_maged@hotmail.com', website = '', logo = 'a5583ab9a3a85fbef9bfbbd46031c2d2.jpeg', roundnumbers = '1', saveprinting = '1', deptprinting = '1', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '2',clientsearchvalue = '2', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = 'D', taxcard = '123456789123', commercialregistration = '1234', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-10-05',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='57a85883346811cbf7076a51c5bd887a2e96bf2df777a95668d34a3537aceedfe3f238b684c96d789642405e6f69293dbb311716d957a5ac40fe5570cf297eaf',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='0' , date='1' , limitamount = '0' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='9aad922c8dc25742295df2779fde48ab62230719d569b9aa71bf6d5e0e08471c7dbda60d508155af60894a0ba3bbd86ffbee699027a409bcd9ca11e28a846cc5',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:46:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-05 12:16:38', '1', 'handleExpiredCards', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=3494
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:46:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:16:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:16:51', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3495
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:49:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:19:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:19:53', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3496
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:20:15', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3497

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =370
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '600.8' , clientdate = '2026-10-05 12:20:16', userid = '1' WHERE clientid = '5';
UPDATE client SET  inUse = 0 where clientid = 5;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','6793.80','6193','1','ايصال تحصيل (( قبض من عميل ))','370', '600.8', '2026-10-05 12:19:54', '1', 'clientPayedDeptController.php', '   ', '6193', '0', null, '0', null, null,'', '-1','1','1','6193','1','','28','0','','.'); -- id=370
UPDATE save SET  savecurrentvalue = '-411715.91',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-417908.91','6193', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '370', '-411715.91', '2026-10-05 12:20:16', '1',  'clientPayedDeptController.php','5','','0'); -- id=220
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6193', '6193', '2026-10-05', '1', '0', '0', '2026-10-05 12:20:16','اضافة ايصال سداد للعميل احمد عبدالحميد حسون ','1','0','0','0','370','clientPayedDeptController.php?do=show&id=370'); -- id=1316
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1316', '383', '6193', '','0'); -- id=1322
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-156273.88', 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 ('1316', '430', '6193', '','0'); -- id=1318
UPDATE accountstree SET name = 'احمد عبدالحميد حسون ', customName = 'احمد عبدالحميد حسون ', customNameEn = 'احمد عبدالحميد حسون ', nameEn = 'احمد عبدالحميد حسون ', parent = '58', accountNature = '0', theValue = '600.8', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 14:49:28' WHERE id = '430';
UPDATE clientdebtchange SET clientid = '5', clientdebtchangebefore = '6793.800', clientdebtchangeamount = '6193.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '370', clientdebtchangeafter = '600.800', clientdebtchangedate = '2026-10-05 12:19:54', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '6193.000',discount='', reciptid='0', dailyentryid = '1316',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='6193',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '370';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:20:17', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3498
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:19";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:20:19', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3499
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:20:20', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=3500
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:21";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:20:22', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3501
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:20:37', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3502
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:50:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:20:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:20:41', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3503
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:04', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3504

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =371
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-10-05 12:21:04', userid = '1' WHERE clientid = '2';
UPDATE client SET  inUse = 0 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','6608.29','6608.29','1','ايصال تحصيل (( قبض من عميل ))','371', '0', '2026-10-05 12:20:41', '1', 'clientPayedDeptController.php', '   ', '6608.29', '0', null, '0', null, null,'', '-1','1','1','6608.29','1','','29','0','','.'); -- id=371
UPDATE save SET  savecurrentvalue = '-405107.62',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-411715.91','6608.29', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '371', '-405107.62', '2026-10-05 12:21:05', '1',  'clientPayedDeptController.php','2','','0'); -- id=221
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6608.29', '6608.29', '2026-10-05', '1', '0', '0', '2026-10-05 12:21:05','اضافة ايصال سداد للعميل فؤاد الطوخي','1','0','0','0','371','clientPayedDeptController.php?do=show&id=371'); -- id=1317
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1317', '383', '6608.29', '','0'); -- id=1323
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-149665.59', 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 ('1317', '426', '6608.29', '','0'); -- id=1319
UPDATE accountstree SET name = 'فؤاد الطوخي', customName = 'فؤاد الطوخي', customNameEn = 'فؤاد الطوخي', nameEn = 'فؤاد الطوخي', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 20:11:03' WHERE id = '426';
UPDATE clientdebtchange SET clientid = '2', clientdebtchangebefore = '6608.290', clientdebtchangeamount = '6608.290', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '371', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-10-05 12:20:41', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '6608.290',discount='', reciptid='0', dailyentryid = '1317',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='6608.29',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '371';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:06', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3505
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:08";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:08', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3506
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:21:14', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3507
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:20";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:21:20', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3508
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:36', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3509
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:49', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3510

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =372
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(44,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-10-05 12:21:49', userid = '1' WHERE clientid = '44';
UPDATE client SET  inUse = 0 where clientid = 44;
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 ('44','4001.40','4001.4','1','ايصال تحصيل (( قبض من عميل ))','372', '0', '2026-10-05 12:21:36', '1', 'clientPayedDeptController.php', '   ', '4001.4', '0', null, '0', null, null,'', '-1','1','1','4001.4','1','','30','0','','.'); -- id=372
UPDATE save SET  savecurrentvalue = '-401106.22',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-405107.62','4001.4', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '372', '-401106.22', '2026-10-05 12:21:49', '1',  'clientPayedDeptController.php','44','','0'); -- id=222
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4001.4', '4001.4', '2026-10-05', '1', '0', '0', '2026-10-05 12:21:50','اضافة ايصال سداد للعميل احمد فتوح خميس ','1','0','0','0','372','clientPayedDeptController.php?do=show&id=372'); -- id=1318
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1318', '383', '4001.4', '','0'); -- id=1324
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-145664.19', 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 ('1318', '476', '4001.4', '','0'); -- id=1320
UPDATE accountstree SET name = 'احمد فتوح خميس ', customName = 'احمد فتوح خميس ', customNameEn = 'احمد فتوح خميس ', nameEn = 'احمد فتوح خميس ', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-01 08:43:22' WHERE id = '476';
UPDATE clientdebtchange SET clientid = '44', clientdebtchangebefore = '4001.400', clientdebtchangeamount = '4001.400', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '372', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-10-05 12:21:36', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4001.400',discount='', reciptid='0', dailyentryid = '1318',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4001.4',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '372';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:51', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3511
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:53', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3512
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:51:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:21:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:21:55', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3513
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:22:11', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3514

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =373
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(37,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-10-05 12:22:11', userid = '1' WHERE clientid = '37';
UPDATE client SET  inUse = 0 where clientid = 37;
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 ('37','3380.00','3380','1','ايصال تحصيل (( قبض من عميل ))','373', '0', '2026-10-05 12:21:55', '1', 'clientPayedDeptController.php', '   ', '3380', '0', null, '0', null, null,'', '-1','1','1','3380','1','','31','0','','.'); -- id=373
UPDATE save SET  savecurrentvalue = '-397726.22',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-401106.22','3380', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '373', '-397726.22', '2026-10-05 12:22:11', '1',  'clientPayedDeptController.php','37','','0'); -- id=223
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3380', '3380', '2026-10-05', '1', '0', '0', '2026-10-05 12:22:11','اضافة ايصال سداد للعميل محمد الجبالي ','1','0','0','0','373','clientPayedDeptController.php?do=show&id=373'); -- id=1319
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1319', '383', '3380', '','0'); -- id=1325
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-142284.19', 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 ('1319', '469', '3380', '','0'); -- id=1321
UPDATE accountstree SET name = 'محمد الجبالي ', customName = 'محمد الجبالي ', customNameEn = 'محمد الجبالي ', nameEn = 'محمد الجبالي ', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-24 10:20:19' WHERE id = '469';
UPDATE clientdebtchange SET clientid = '37', clientdebtchangebefore = '3380.000', clientdebtchangeamount = '3380.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '373', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-10-05 12:21:55', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '3380.000',discount='', reciptid='0', dailyentryid = '1319',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='3380',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '373';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:12";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:22:12', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3515
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:14";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 12:22:14', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3516
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:22:15', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3517
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:22";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 12:22:22', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3518
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:22:51', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3519

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac379f69bde4
-- ----------------------------------------------------------------------------------------------------

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-10-05 12:22:51', '06ac379f69bde4', '4', '-346.32', '-126.32', '0', '1', '220.00', '220', '0', '220', '1', '2026-10-05 12:22:51', '', '1', '0', 'محمد عبدالله الالفي', '1', '1', '3', '0', 'محمد عبدالله الالفي', '2' ,'0','','','','','-1','0','0','0','0','0','220','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-05','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=223
UPDATE client SET  clientdebt = '-126.32', 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','-346.32','220','0','اضافة فاتورة مبيعات','223', '-126.32', '2026-10-05 12:22:52', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','220','1','2026-10-05 12:22:51','0','0','',''); -- id=374
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 ('106','00110', '223', '3', '110', '2', '110', '220', '0', '', '1', '2026-10-05 12:22:52', '110', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','110','220','0','','0','0.00','0','0','0','0'); -- id=1950
UPDATE sellbilldetail SET  lastbuyprice = 106.00 , meanbuyprice = 106.00, lastbuyprice_withDiscount = 106.00, meanbuyprice_withDiscount = 106.00
        , lastbuyprice_withTax = 106, meanbuyprice_withTax = 106, lastbuyprice_withDiscountAndTax = 106
                where sellbilldetailid = 1950;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (110, '2026-10-05', 220, 212, 212
                    , 212, 212, 212, 212
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 212, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+212
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+212, sellCostMeanBuyPrice = sellCostMeanBuyPrice+212
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+212, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+212
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+212
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+212
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 220, 212, 212
                    , 212, 212, 212, 212
                    , 0, 0, 0, 0
                    , 0, 0, 0, 212, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+212
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+212, sellCostMeanBuyPrice = sellCostMeanBuyPrice+212
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+212, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+212
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+212
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+212
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-10-05 12:22:52' WHERE storedetailid = '110';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('110', '1', '2', '1', '223', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '10', '1', '2026-10-05 12:22:52','0','0'); -- id=3661
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '220', '220', '2026-10-05', '1', '0', '0', '2026-10-05 12:22:52','اضافة فاتورة مبيعات رقم 223','1','0',null,'0','223','sellbillController.php?do=showDetail&sellbillid=223'); -- id=1320
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1320', '428', '220', '','0'); -- id=1326
UPDATE accountstree SET name = 'محمد عبدالله الالفي', customName = 'محمد عبدالله الالفي', customNameEn = 'محمد عبدالله الالفي', nameEn = 'محمد عبدالله الالفي', parent = '58', accountNature = '0', theValue = '-126.32', 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 ('1320', '143', '220', '','0'); -- id=1322
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '998198.33', 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 ( '212', '212', '2026-10-05', '1', '0', '0', '2026-10-05 12:22:52','اضافة فاتورة مبيعات رقم 223 - صرف البضاعة من المخزن','1','0',null,'0','223','sellbillController.php?do=showDetail&sellbillid=223'); -- id=1321
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1321', '402', '212', '','0'); -- id=1327
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '905407.99', 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 ('1321', '382', '212', '','0'); -- id=1323
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2423869.6', 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='1320,0,1321' where sellbillid=223;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 220, 212, 212
                    , 212, 212, 212, 212
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,212, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+212
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+212, sellCostMeanBuyPrice = sellCostMeanBuyPrice+212
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+212, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+212
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+212
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+212
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, 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-10-05', 220, 212, 212
                    , 212, 212, 212, 212
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,212, 212, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+220, sellCostBuyPrice =sellCostBuyPrice+212
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+212, sellCostMeanBuyPrice = sellCostMeanBuyPrice+212
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+212, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+212
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+212
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+212
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+212
                        , returnSellVal = returnSellVal+0, 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, 220, 212, 212
                    , 212, 212, 212, 212, 212, 212)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+220, netSellCostBuyPrice = netSellCostBuyPrice+212
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+212
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+212
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+212
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+212
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+212
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+212
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+212;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac379f69bde4 and sellbillId = 223 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:52:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:22:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:22:54', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3520
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:54:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:24:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:24:54', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3521
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:55:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:25:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:25:27', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3522

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac37af76944f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-05 12:25:27', '06ac37af76944f', '1', '0.00', '0', '0', '1', '280.00', '280', '280', '0', '1', '2026-10-05 12:25:27', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '10' ,'0','','','','','-1','0','0','0','0','0','280','0','','0','0','280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-05','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=224
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','اضافة فاتورة مبيعات','224', '0', '2026-10-05 12:25:28', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '280', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-05 12:25:27','0','0','',''); -- id=375
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 99;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('24.8','00291', '224', '24', '291', '10', '28', '280', '0', '', '1', '2026-10-05 12:25:28', '291', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','99-10,','1','1','0','0','28','280','0','','0','0.00','0','0','0','0'); -- id=1951
UPDATE sellbilldetail SET  lastbuyprice = 24.80 , meanbuyprice = 24.80, lastbuyprice_withDiscount = 24.80, meanbuyprice_withDiscount = 24.80
        , lastbuyprice_withTax = 24.8, meanbuyprice_withTax = 24.8, lastbuyprice_withDiscountAndTax = 24.8
                where sellbilldetailid = 1951;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (291, '2026-10-05', 280, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 280, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0, 248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-05 12:25:28' WHERE storedetailid = '291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('291', '1', '10', '1', '224', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '56', '1', '2026-10-05 12:25:28','0','0'); -- id=3662
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-397446.21875',  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 ('-397726.21875','280', '0', '1', 'اضافة فاتورة مبيعات', '224', '-397446.21875', '2026-10-05 12:25:28', '1',  'sellbillController.php','1','','0'); -- id=224
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '280', '280', '2026-10-05', '1', '0', '0', '2026-10-05 12:25:29','اضافة فاتورة مبيعات رقم 224','1','0',null,'0','224','sellbillController.php?do=showDetail&sellbillid=224'); -- id=1322
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1322', '383', '280', '','0'); -- id=1328
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-142004.19', 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 ('1322', '143', '280', '','0'); -- id=1324
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '998478.33', 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 ( '248', '248', '2026-10-05', '1', '0', '0', '2026-10-05 12:25:29','اضافة فاتورة مبيعات رقم 224 - صرف البضاعة من المخزن','1','0',null,'0','224','sellbillController.php?do=showDetail&sellbillid=224'); -- id=1323
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1323', '402', '248', '','0'); -- id=1329
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '905655.99', 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 ('1323', '382', '248', '','0'); -- id=1325
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2423621.6', 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='1322,0,1323' where sellbillid=224;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 280, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 280, 248, 248
                    , 248, 248, 248, 248
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,248, 248, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+280, sellCostBuyPrice =sellCostBuyPrice+248
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+248, sellCostMeanBuyPrice = sellCostMeanBuyPrice+248
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+248, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+248
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+248
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+248
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+248
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 280, 248, 248
                    , 248, 248, 248, 248, 248, 248)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+280, netSellCostBuyPrice = netSellCostBuyPrice+248
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+248
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+248
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+248
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+248
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+248
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+248
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+248;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac37af76944f and sellbillId = 224 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 08:55:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:25:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:25:30', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:18:57";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 12:48:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 12:48:57', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3524
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:49:03";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:19:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:19:03', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3525
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:49:15";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:19:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:19:15', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3526
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:53:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:23:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:23:32', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3527
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 ('06ac387aae71d2', '2026-10-05 13:19:06', '1', '67268.92', '67268.92', '0', '0', '488771.00',  '488771.00', '488771', '0', '1', '2026-10-05 13:23:32', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=42
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 ('00003', '42', '1', '3', '1800', '34.8', '62640.00', '0', '', '2026-10-05 13:23:32', '3','','','0','0','0','0','0',null,'34.8','62640','0','0','0','0','0','0','0','0','1'); -- id=153
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 3, 0, 0
                    , 34.8, 1800, 0, 0, 1, '2026-10-05 13:23:33')
                ON DUPLICATE KEY UPDATE buyprice = 34.8,
                        buyQuantity =buyQuantity+1800, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:33' ; -- id=153
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('3', '34.8', '1800', '0', 'buyBillController.php', '153', '', '0', '0'); -- id=153
UPDATE product SET  productBuyPrice = "34.8" WHERE productId = 3 ;
UPDATE buybilldetail SET  quantitybefore = 1257 WHERE buybilldetailid = 153 ;
UPDATE product SET productName = 'مفتاح مفرد اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '34.80', productSellAllPrice = '34.90', productSellUnitPrice = '36.00', productSellHalfPrice = '34.90', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '0', parcode = '00003',type ='0', expireDate = '0' , dailyentryId = '8',isService = '0',isOptic = '0',lastbuyprice = '34.8',lastbuyprice_withDiscount = '34.8',meanbuyprice = '34.8',meanbuyprice_withDiscount = '34.8' , productbuypricereal = '34.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.29' , buyhalf_precentage = '0.29' , buypart_precentage = '3.45',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34.8',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34.8',meanbuyprice_withTax='34.8',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '3';
UPDATE buybilldetail SET  lastbuyprice = 34.8 , meanbuyprice = 34.8, lastbuyprice_withDiscount = 34.8, meanbuyprice_withDiscount = 34.8
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where buybilldetailid = 153;
UPDATE productunit SET proUnitBuyPrice  = 34.8 * productnumber WHERE productid = 3;
UPDATE storedetail SET  productquantity = '3057', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '1800', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1257', '3057', '1', '2026-10-05 13:19:06','0','0'); -- id=3663
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 ('00004', '42', '1', '4', '1800', '34.8', '62640.00', '0', '', '2026-10-05 13:23:32', '4','','','0','0','0','0','0',null,'34.8','62640','0','0','0','0','0','0','0','0','1'); -- id=154
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 4, 0, 0
                    , 34.8, 1800, 0, 0, 1, '2026-10-05 13:23:33')
                ON DUPLICATE KEY UPDATE buyprice = 34.8,
                        buyQuantity =buyQuantity+1800, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:33' ; -- id=154
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('4', '34.8', '1800', '0', 'buyBillController.php', '154', '', '0', '0'); -- id=154
UPDATE product SET  productBuyPrice = "34.8" WHERE productId = 4 ;
UPDATE buybilldetail SET  quantitybefore = 1501 WHERE buybilldetailid = 154 ;
UPDATE product SET productName = 'بريزه مفرد اسمر', productDescription = '', productCatId = '1', productBuyPrice = '34.80', productSellAllPrice = '34.90', productSellUnitPrice = '36.00', productSellHalfPrice = '34.90', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '1000', parcode = '00004',type ='0', expireDate = '0' , dailyentryId = '9',isService = '0',isOptic = '0',lastbuyprice = '34.8',lastbuyprice_withDiscount = '34.8',meanbuyprice = '34.8',meanbuyprice_withDiscount = '34.8' , productbuypricereal = '34.80' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.29' , buyhalf_precentage = '0.29' , buypart_precentage = '3.45',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='34.8',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='34.8',meanbuyprice_withTax='34.8',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='34.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '4';
UPDATE buybilldetail SET  lastbuyprice = 34.8 , meanbuyprice = 34.8, lastbuyprice_withDiscount = 34.8, meanbuyprice_withDiscount = 34.8
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where buybilldetailid = 154;
UPDATE productunit SET proUnitBuyPrice  = 34.8 * productnumber WHERE productid = 4;
UPDATE storedetail SET  productquantity = '3301', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1800', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1501', '3301', '1', '2026-10-05 13:19:06','0','0'); -- id=3664
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 ('00001', '42', '1', '1', '2400', '52.75', '126600.00', '0', '', '2026-10-05 13:23:32', '1','','','0','0','0','0','0',null,'52.75','126600','0','0','0','0','0','0','0','0','1'); -- id=155
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 1, 0, 0
                    , 52.75, 2400, 0, 0, 1, '2026-10-05 13:23:34')
                ON DUPLICATE KEY UPDATE buyprice = 52.75,
                        buyQuantity =buyQuantity+2400, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:34' ; -- id=155
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1', '52.75', '2400', '0', 'buyBillController.php', '155', '', '0', '0'); -- id=155
UPDATE product SET  productBuyPrice = "52.75" WHERE productId = 1 ;
UPDATE buybilldetail SET  quantitybefore = 351 WHERE buybilldetailid = 155 ;
UPDATE product SET productName = 'شاسيه بالوش اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '52.75', productSellAllPrice = '53.33', productSellUnitPrice = '54.78', productSellHalfPrice = '53.33', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '0', parcode = '00001',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '52.75',lastbuyprice_withDiscount = '52.75',meanbuyprice = '52.75',meanbuyprice_withDiscount = '52.75' , productbuypricereal = '52.75' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.10' , buyhalf_precentage = '1.10' , buypart_precentage = '3.85',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='52.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='52.75',meanbuyprice_withTax='52.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='52.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 = '1';
UPDATE buybilldetail 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 buybilldetailid = 155;
UPDATE productunit SET proUnitBuyPrice  = 52.75 * productnumber WHERE productid = 1;
UPDATE storedetail SET  productquantity = '2751', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '2400', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '351', '2751', '1', '2026-10-05 13:19:06','0','0'); -- id=3665
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00009', '42', '1', '9', '180', '306', '55080.00', '0', '', '2026-10-05 13:23:32', '9','','','0','0','0','0','0',null,'306','55080','0','0','0','0','0','0','0','0','1'); -- id=156
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 9, 0, 0
                    , 306, 180, 0, 0, 1, '2026-10-05 13:23:35')
                ON DUPLICATE KEY UPDATE buyprice = 306,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:35' ; -- id=156
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('9', '306', '180', '0', 'buyBillController.php', '156', '', '0', '0'); -- id=156
UPDATE product SET  productBuyPrice = "306" WHERE productId = 9 ;
UPDATE buybilldetail SET  quantitybefore = 47 WHERE buybilldetailid = 156 ;
UPDATE product SET productName = 'قطعه طواريء ', productDescription = '', productCatId = '1', productBuyPrice = '306.00', productSellAllPrice = '307.00', productSellUnitPrice = '319.00', productSellHalfPrice = '307.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '15', parcode = '00009',type ='0', expireDate = '0' , dailyentryId = '14',isService = '0',isOptic = '0',lastbuyprice = '306',lastbuyprice_withDiscount = '306',meanbuyprice = '306',meanbuyprice_withDiscount = '306' , productbuypricereal = '306.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.33' , buyhalf_precentage = '0.33' , buypart_precentage = '4.25',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='306',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='306',meanbuyprice_withTax='306',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='306',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '9';
UPDATE buybilldetail SET  lastbuyprice = 306 , meanbuyprice = 306, lastbuyprice_withDiscount = 306, meanbuyprice_withDiscount = 306
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where buybilldetailid = 156;
UPDATE productunit SET proUnitBuyPrice  = 306 * productnumber WHERE productid = 9;
UPDATE storedetail SET  productquantity = '227', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '180', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '47', '227', '1', '2026-10-05 13:19:06','0','0'); -- id=3666
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 ('00012', '42', '1', '12', '288', '63', '18144.00', '0', '', '2026-10-05 13:23:32', '12','','','0','0','0','0','0',null,'63','18144','0','0','0','0','0','0','0','0','1'); -- id=157
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 12, 0, 0
                    , 63, 288, 0, 0, 1, '2026-10-05 13:23:36')
                ON DUPLICATE KEY UPDATE buyprice = 63,
                        buyQuantity =buyQuantity+288, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:36' ; -- id=157
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('12', '63', '288', '0', 'buyBillController.php', '157', '', '0', '0'); -- id=157
UPDATE product SET  productBuyPrice = "63" WHERE productId = 12 ;
UPDATE buybilldetail SET  quantitybefore = 47 WHERE buybilldetailid = 157 ;
UPDATE product SET productName = 'مفتاح ديفاتيري اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '63.00', productSellAllPrice = '64.00', productSellUnitPrice = '66.00', productSellHalfPrice = '64.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '36', parcode = '00012',type ='0', expireDate = '0' , dailyentryId = '17',isService = '0',isOptic = '0',lastbuyprice = '63',lastbuyprice_withDiscount = '63',meanbuyprice = '63',meanbuyprice_withDiscount = '63' , productbuypricereal = '63.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.59' , buyhalf_precentage = '1.59' , buypart_precentage = '4.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='63',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='63',meanbuyprice_withTax='63',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='63',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '12';
UPDATE buybilldetail SET  lastbuyprice = 63 , meanbuyprice = 63, lastbuyprice_withDiscount = 63, meanbuyprice_withDiscount = 63
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where buybilldetailid = 157;
UPDATE productunit SET proUnitBuyPrice  = 63 * productnumber WHERE productid = 12;
UPDATE storedetail SET  productquantity = '335', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '12';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '288', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '47', '335', '1', '2026-10-05 13:19:06','0','0'); -- id=3667
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 ('00013', '42', '1', '13', '90', '306', '27540.00', '0', '', '2026-10-05 13:23:32', '13','','','0','0','0','0','0',null,'306','27540','0','0','0','0','0','0','0','0','1'); -- id=158
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 13, 0, 0
                    , 306, 90, 0, 0, 1, '2026-10-05 13:23:37')
                ON DUPLICATE KEY UPDATE buyprice = 306,
                        buyQuantity =buyQuantity+90, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:37' ; -- id=158
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('13', '306', '90', '0', 'buyBillController.php', '158', '', '0', '0'); -- id=158
UPDATE product SET  productBuyPrice = "306" WHERE productId = 13 ;
UPDATE buybilldetail SET  quantitybefore = 14 WHERE buybilldetailid = 158 ;
UPDATE product SET productName = 'جرس قطعه اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '306.00', productSellAllPrice = '308.00', productSellUnitPrice = '317.70', productSellHalfPrice = '308.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '5', parcode = '00013',type ='0', expireDate = '0' , dailyentryId = '18',isService = '0',isOptic = '0',lastbuyprice = '306',lastbuyprice_withDiscount = '306',meanbuyprice = '306',meanbuyprice_withDiscount = '306' , productbuypricereal = '306.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.65' , buyhalf_precentage = '0.65' , buypart_precentage = '3.82',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='306',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='306',meanbuyprice_withTax='306',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='306',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '13';
UPDATE buybilldetail SET  lastbuyprice = 306 , meanbuyprice = 306, lastbuyprice_withDiscount = 306, meanbuyprice_withDiscount = 306
        , lastbuyprice_withTax = 306, meanbuyprice_withTax = 306, lastbuyprice_withDiscountAndTax = 306
                where buybilldetailid = 158;
UPDATE productunit SET proUnitBuyPrice  = 306 * productnumber WHERE productid = 13;
UPDATE storedetail SET  productquantity = '104', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '13';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '1', '90', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '14', '104', '1', '2026-10-05 13:19:06','0','0'); -- id=3668
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00016', '42', '1', '16', '144', '63', '9072.00', '0', '', '2026-10-05 13:23:32', '16','','','0','0','0','0','0',null,'63','9072','0','0','0','0','0','0','0','0','1'); -- id=159
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 16, 0, 0
                    , 63, 144, 0, 0, 1, '2026-10-05 13:23:38')
                ON DUPLICATE KEY UPDATE buyprice = 63,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:38' ; -- id=159
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('16', '63', '144', '0', 'buyBillController.php', '159', '', '0', '0'); -- id=159
UPDATE product SET  productBuyPrice = "63" WHERE productId = 16 ;
UPDATE buybilldetail SET  quantitybefore = 82 WHERE buybilldetailid = 159 ;
UPDATE product SET productName = 'زر جرس مفرد اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '63.00', productSellAllPrice = '64.00', productSellUnitPrice = '67.00', productSellHalfPrice = '64.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '36', parcode = '00016',type ='0', expireDate = '0' , dailyentryId = '21',isService = '0',isOptic = '0',lastbuyprice = '63',lastbuyprice_withDiscount = '63',meanbuyprice = '63',meanbuyprice_withDiscount = '63' , productbuypricereal = '63.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.59' , buyhalf_precentage = '1.59' , buypart_precentage = '6.35',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='63',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='63',meanbuyprice_withTax='63',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='63',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '16';
UPDATE buybilldetail SET  lastbuyprice = 63 , meanbuyprice = 63, lastbuyprice_withDiscount = 63, meanbuyprice_withDiscount = 63
        , lastbuyprice_withTax = 63, meanbuyprice_withTax = 63, lastbuyprice_withDiscountAndTax = 63
                where buybilldetailid = 159;
UPDATE productunit SET proUnitBuyPrice  = 63 * productnumber WHERE productid = 16;
UPDATE storedetail SET  productquantity = '226', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '144', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '82', '226', '1', '2026-10-05 13:19:06','0','0'); -- id=3669
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00015', '42', '1', '15', '180', '163', '29340.00', '0', '', '2026-10-05 13:23:32', '15','','','0','0','0','0','0',null,'163','29340','0','0','0','0','0','0','0','0','1'); -- id=160
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 15, 0, 0
                    , 163, 180, 0, 0, 1, '2026-10-05 13:23:39')
                ON DUPLICATE KEY UPDATE buyprice = 163,
                        buyQuantity =buyQuantity+180, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:39' ; -- id=160
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('15', '163', '180', '0', 'buyBillController.php', '160', '', '0', '0'); -- id=160
UPDATE product SET  productBuyPrice = "163" WHERE productId = 15 ;
UPDATE buybilldetail SET  quantitybefore = 99 WHERE buybilldetailid = 160 ;
UPDATE product SET productName = 'مفتاح سخان 20 امبير اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '163.00', productSellAllPrice = '165.00', productSellUnitPrice = '170.00', productSellHalfPrice = '165.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '36', parcode = '00015',type ='0', expireDate = '0' , dailyentryId = '20',isService = '0',isOptic = '0',lastbuyprice = '163',lastbuyprice_withDiscount = '163',meanbuyprice = '163',meanbuyprice_withDiscount = '163' , productbuypricereal = '163.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '1.23' , buyhalf_precentage = '1.23' , buypart_precentage = '4.29',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='163',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='163',meanbuyprice_withTax='163',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='163',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '15';
UPDATE buybilldetail SET  lastbuyprice = 163 , meanbuyprice = 163, lastbuyprice_withDiscount = 163, meanbuyprice_withDiscount = 163
        , lastbuyprice_withTax = 163, meanbuyprice_withTax = 163, lastbuyprice_withDiscountAndTax = 163
                where buybilldetailid = 160;
UPDATE productunit SET proUnitBuyPrice  = 163 * productnumber WHERE productid = 15;
UPDATE storedetail SET  productquantity = '279', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '15';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '1', '180', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '99', '279', '1', '2026-10-05 13:19:06','0','0'); -- id=3670
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00006', '42', '1', '6', '178', '105', '18690.00', '0', '', '2026-10-05 13:23:32', '6','','','0','0','0','0','0',null,'105','18690','0','0','0','0','0','0','0','0','1'); -- id=161
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 6, 0, 0
                    , 105, 178, 0, 0, 1, '2026-10-05 13:23:40')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+178, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:40' ; -- id=161
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('6', '105', '178', '0', 'buyBillController.php', '161', '', '0', '0'); -- id=161
UPDATE product SET  productBuyPrice = "105" WHERE productId = 6 ;
UPDATE buybilldetail SET  quantitybefore = 160 WHERE buybilldetailid = 161 ;
UPDATE product SET productName = 'بريزه ام كي اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '109.00', productSellHalfPrice = '106.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '40', parcode = '00006',type ='0', expireDate = '0' , dailyentryId = '11',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '6';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 161;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 6;
UPDATE storedetail SET  productquantity = '338', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '178', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '160', '338', '1', '2026-10-05 13:19:06','0','0'); -- id=3671
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00011', '42', '1', '11', '200', '105', '21000.00', '0', '', '2026-10-05 13:23:32', '11','','','0','0','0','0','0',null,'105','21000','0','0','0','0','0','0','0','0','1'); -- id=162
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 11, 0, 0
                    , 105, 200, 0, 0, 1, '2026-10-05 13:23:41')
                ON DUPLICATE KEY UPDATE buyprice = 105,
                        buyQuantity =buyQuantity+200, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:41' ; -- id=162
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('11', '105', '200', '0', 'buyBillController.php', '162', '', '0', '0'); -- id=162
UPDATE product SET  productBuyPrice = "105" WHERE productId = 11 ;
UPDATE buybilldetail SET  quantitybefore = 114 WHERE buybilldetailid = 162 ;
UPDATE product SET productName = 'بريزه مجوفه اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '105.00', productSellAllPrice = '106.00', productSellUnitPrice = '109.00', productSellHalfPrice = '106.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '20', parcode = '00011',type ='0', expireDate = '0' , dailyentryId = '16',isService = '0',isOptic = '0',lastbuyprice = '105',lastbuyprice_withDiscount = '105',meanbuyprice = '105',meanbuyprice_withDiscount = '105' , productbuypricereal = '105.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='105',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='105',meanbuyprice_withTax='105',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='105',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '11';
UPDATE buybilldetail SET  lastbuyprice = 105 , meanbuyprice = 105, lastbuyprice_withDiscount = 105, meanbuyprice_withDiscount = 105
        , lastbuyprice_withTax = 105, meanbuyprice_withTax = 105, lastbuyprice_withDiscountAndTax = 105
                where buybilldetailid = 162;
UPDATE productunit SET proUnitBuyPrice  = 105 * productnumber WHERE productid = 11;
UPDATE storedetail SET  productquantity = '314', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '200', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '114', '314', '1', '2026-10-05 13:19:06','0','0'); -- id=3672
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 ('00005', '42', '1', '5', '5500', '10.55', '58025.00', '0', '', '2026-10-05 13:23:32', '5','','','0','0','0','0','0',null,'10.55','58025','0','0','0','0','0','0','0','0','1'); -- id=163
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:19:06', 1, 5, 0, 0
                    , 10.55, 5500, 0, 0, 1, '2026-10-05 13:23:41')
                ON DUPLICATE KEY UPDATE buyprice = 10.55,
                        buyQuantity =buyQuantity+5500, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:23:41' ; -- id=163
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('5', '10.55', '5500', '0', 'buyBillController.php', '163', '', '0', '0'); -- id=163
UPDATE product SET  productBuyPrice = "10.55" WHERE productId = 5 ;
UPDATE buybilldetail SET  quantitybefore = 1092 WHERE buybilldetailid = 163 ;
UPDATE product SET productName = 'سداده اسمر ', productDescription = '', productCatId = '1', productBuyPrice = '10.55', productSellAllPrice = '10.65', productSellUnitPrice = '10.95', productSellHalfPrice = '10.65', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '500', parcode = '00005',type ='0', expireDate = '0' , dailyentryId = '10',isService = '0',isOptic = '0',lastbuyprice = '10.55',lastbuyprice_withDiscount = '10.55',meanbuyprice = '10.55',meanbuyprice_withDiscount = '10.55' , productbuypricereal = '10.55' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.95' , buyhalf_precentage = '0.95' , buypart_precentage = '3.79',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10.55',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='10.55',meanbuyprice_withTax='10.55',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='10.55',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '5';
UPDATE buybilldetail SET  lastbuyprice = 10.55 , meanbuyprice = 10.55, lastbuyprice_withDiscount = 10.55, meanbuyprice_withDiscount = 10.55
        , lastbuyprice_withTax = 10.55, meanbuyprice_withTax = 10.55, lastbuyprice_withDiscountAndTax = 10.55
                where buybilldetailid = 163;
UPDATE productunit SET proUnitBuyPrice  = 10.55 * productnumber WHERE productid = 5;
UPDATE storedetail SET  productquantity = '6592', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '5500', '0', '42', 'اضافة فاتورة مشتريات', 'buyBillController.php', '1092', '6592', '1', '2026-10-05 13:19:06','0','0'); -- id=3673
UPDATE supplier SET  suppliercurrentDebt = '67268.92',suppliercurrentDebtInCurrency= '67268.92' , userid = '1', supplierdate = '2026-10-05 13:23:32'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '67268.92', '0', '0', 'اضافة فاتورة مشتريات', '42', '67268.92', '2026-10-05 13:19:06', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','67268.92','0','67268.92','0',''); -- id=75
UPDATE save SET  savecurrentvalue = '-886217.22',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-397446.22','488771', '1', '1', 'اضافة فاتورة مشتريات', '42', '-886217.22', '2026-10-05 13:19:06', '1',  'buyBillController.php','0','','0'); -- id=225
update buybill set dailyentryid='0,0' where buybillid=42;
COMMIT;
UPDATE product SET overAllAveragePrice = 52.75 WHERE productId = 1;UPDATE product SET overAllAveragePrice = 34.8 WHERE productId = 3;UPDATE product SET overAllAveragePrice = 34.8 WHERE productId = 4;UPDATE product SET overAllAveragePrice = 10.55 WHERE productId = 5;UPDATE product SET overAllAveragePrice = 105 WHERE productId = 6;UPDATE product SET overAllAveragePrice = 306 WHERE productId = 9;UPDATE product SET overAllAveragePrice = 105 WHERE productId = 11;UPDATE product SET overAllAveragePrice = 63 WHERE productId = 12;UPDATE product SET overAllAveragePrice = 306 WHERE productId = 13;UPDATE product SET overAllAveragePrice = 163 WHERE productId = 15;UPDATE product SET overAllAveragePrice = 63 WHERE productId = 16;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:53:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:23:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:23:43', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=42'); -- id=3528
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:58:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:28:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:28:10', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:59:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:29:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:29:39', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3530
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 ('06ac389cb52d20', '2026-10-05 13:28:11', '16', '0.00', '7100', '0', '0', '20100.00',  '20100.00', '13000', '7100', '1', '2026-10-05 13:29:39', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=43
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 ('00567', '43', '9', '567', '100', '45', '4500.00', '0', '', '2026-10-05 13:29:39', '567','','','0','0','0','0','0',null,'45','4500','0','0','0','0','0','0','0','0','1'); -- id=164
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:28:11', 1, 567, 0, 0
                    , 45, 100, 0, 0, 1, '2026-10-05 13:29:40')
                ON DUPLICATE KEY UPDATE buyprice = 45,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:29:40' ; -- id=164
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('567', '45', '100', '0', 'buyBillController.php', '164', '', '0', '0'); -- id=164
UPDATE product SET  productBuyPrice = "45" WHERE productId = 567 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 164 ;
UPDATE product SET productName = 'اب داون تاون ليد ثلاثي', productDescription = '', productCatId = '9', productBuyPrice = '45.00', productSellAllPrice = '49.00', productSellUnitPrice = '52.00', productSellHalfPrice = '49.00', productDate = '2026-10-04', conditions = '0', userId = '1', limitamount = '0', parcode = '00567',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '45',lastbuyprice_withDiscount = '45',meanbuyprice = '45',meanbuyprice_withDiscount = '45' , productbuypricereal = '45.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.89' , buyhalf_precentage = '8.89' , buypart_precentage = '15.56',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='45',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='45',meanbuyprice_withTax='45',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='45',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '567';
UPDATE buybilldetail SET  lastbuyprice = 45 , meanbuyprice = 45, lastbuyprice_withDiscount = 45, meanbuyprice_withDiscount = 45
        , lastbuyprice_withTax = 45, meanbuyprice_withTax = 45, lastbuyprice_withDiscountAndTax = 45
                where buybilldetailid = 164;
UPDATE productunit SET proUnitBuyPrice  = 45 * productnumber WHERE productid = 567;
UPDATE storedetail SET  productquantity = '100', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '567';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('567', '1', '100', '0', '43', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '100', '1', '2026-10-05 13:28:11','0','0'); -- id=3674
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 ('00568', '43', '9', '568', '60', '125', '7500.00', '0', '', '2026-10-05 13:29:39', '568','','','0','0','0','0','0',null,'125','7500','0','0','0','0','0','0','0','0','1'); -- id=165
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:28:11', 1, 568, 0, 0
                    , 125, 60, 0, 0, 1, '2026-10-05 13:29:40')
                ON DUPLICATE KEY UPDATE buyprice = 125,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:29:40' ; -- id=165
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('568', '125', '60', '0', 'buyBillController.php', '165', '', '0', '0'); -- id=165
UPDATE product SET  productBuyPrice = "125" WHERE productId = 568 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 165 ;
UPDATE product SET productName = 'بلفونيره 30 وات كريستال تاون ليد ', productDescription = '', productCatId = '9', productBuyPrice = '125.00', productSellAllPrice = '135.00', productSellUnitPrice = '150.00', productSellHalfPrice = '150.00', productDate = '2026-10-04', conditions = '0', userId = '1', limitamount = '0', parcode = '00568',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '125',lastbuyprice_withDiscount = '125',meanbuyprice = '125',meanbuyprice_withDiscount = '125' , productbuypricereal = '125.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.00' , buyhalf_precentage = '20.00' , buypart_precentage = '20.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='125',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='125',meanbuyprice_withTax='125',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='125',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '568';
UPDATE buybilldetail SET  lastbuyprice = 125 , meanbuyprice = 125, lastbuyprice_withDiscount = 125, meanbuyprice_withDiscount = 125
        , lastbuyprice_withTax = 125, meanbuyprice_withTax = 125, lastbuyprice_withDiscountAndTax = 125
                where buybilldetailid = 165;
UPDATE productunit SET proUnitBuyPrice  = 125 * productnumber WHERE productid = 568;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('568', '1', '60', '0', '43', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-05 13:28:11','0','0'); -- id=3675
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 ('00569', '43', '9', '569', '60', '135', '8100.00', '0', '', '2026-10-05 13:29:39', '569','','','0','0','0','0','0',null,'135','8100','0','0','0','0','0','0','0','0','1'); -- id=166
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 13:28:11', 1, 569, 0, 0
                    , 135, 60, 0, 0, 1, '2026-10-05 13:29:41')
                ON DUPLICATE KEY UPDATE buyprice = 135,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 13:29:41' ; -- id=166
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('569', '135', '60', '0', 'buyBillController.php', '166', '', '0', '0'); -- id=166
UPDATE product SET  productBuyPrice = "135" WHERE productId = 569 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 166 ;
UPDATE product SET productName = 'تراك بديل ماجنتيك 35 وات ', productDescription = '', productCatId = '9', productBuyPrice = '135.00', productSellAllPrice = '150.00', productSellUnitPrice = '175.00', productSellHalfPrice = '150.00', productDate = '2026-10-04', conditions = '0', userId = '1', limitamount = '0', parcode = '00569',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '135',lastbuyprice_withDiscount = '135',meanbuyprice = '135',meanbuyprice_withDiscount = '135' , productbuypricereal = '135.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '11.11' , buypart_precentage = '29.63',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='135',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='135',meanbuyprice_withTax='135',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='135',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '569';
UPDATE buybilldetail SET  lastbuyprice = 135 , meanbuyprice = 135, lastbuyprice_withDiscount = 135, meanbuyprice_withDiscount = 135
        , lastbuyprice_withTax = 135, meanbuyprice_withTax = 135, lastbuyprice_withDiscountAndTax = 135
                where buybilldetailid = 166;
UPDATE productunit SET proUnitBuyPrice  = 135 * productnumber WHERE productid = 569;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '569';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('569', '1', '60', '0', '43', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-05 13:28:11','0','0'); -- id=3676
UPDATE supplier SET  suppliercurrentDebt = '7100',suppliercurrentDebtInCurrency= '7100' , userid = '1', supplierdate = '2026-10-05 13:29:39'   WHERE supplierid = '16';
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 ('16', '0.00', '7100', '0', 'اضافة فاتورة مشتريات', '43', '7100', '2026-10-05 13:28:11', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','7100','1','0','7100','7100','0',''); -- id=76
UPDATE save SET  savecurrentvalue = '-899217.22',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-886217.22','13000', '1', '1', 'اضافة فاتورة مشتريات', '43', '-899217.22', '2026-10-05 13:28:11', '1',  'buyBillController.php','0','','0'); -- id=226
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20100', '20100', '2026-10-05', '1', '0', '0', '2026-10-05 13:29:42','اضافة فاتورة مشتريات رقم 43','1','0',null,'0','43','buyBillController.php?do=details&id=43'); -- id=1324
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1324', '382', '20100', '','0'); -- id=1330
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2443721.6', 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 ('1324', '478', '20100', '','0'); -- id=1326
UPDATE accountstree SET name = 'تاون ليد ', customName = 'تاون ليد ', customNameEn = 'تاون ليد ', nameEn = 'تاون ليد ', parent = '81', accountNature = '1', theValue = '20100', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-04 18:39:04' WHERE id = '478';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13000', '13000', '2026-10-05', '1', '0', '0', '2026-10-05 13:29:42','اضافة فاتورة مشتريات رقم 43 - سداد الفاتورة للمورد','1','0',null,'0','43','buyBillController.php?do=details&id=43'); -- id=1325
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1325', '478', '13000', '','0'); -- id=1331
UPDATE accountstree SET name = 'تاون ليد ', customName = 'تاون ليد ', customNameEn = 'تاون ليد ', nameEn = 'تاون ليد ', parent = '81', accountNature = '1', theValue = '7100', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-04 18:39:04' WHERE id = '478';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1325', '383', '13000', '','0'); -- id=1327
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-155004.19', 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='1324,1325' where buybillid=43;
COMMIT;
UPDATE product SET overAllAveragePrice = 45 WHERE productId = 567;UPDATE product SET overAllAveragePrice = 125 WHERE productId = 568;UPDATE product SET overAllAveragePrice = 135 WHERE productId = 569;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:59:43";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:29:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 13:29:43', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=43'); -- id=3531
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:59:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:29:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-05 13:29:53', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=3532
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 09:59:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:29:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-05 13:29:58', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=3533
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:00:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:30:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:30:27', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3534
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:00:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:30:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-05 13:30:30', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php'); -- id=3535
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:00:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:30:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-05 13:30:36', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/storedetailController.php?do=show'); -- id=3536
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:00:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:30:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:30:48', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3537
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:00:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:30:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:30:52', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3538
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:26:29";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:56:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:56:29', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3539

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac38a6cc1f2e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-05 13:56:30', '06ac38a6cc1f2e', '1', '0.00', '0', '0', '1', '497.18', '497.18', '497.18', '0', '1', '2026-10-05 13:56:30', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','497','0','','0','0','497.18','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-05','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=225
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','اضافة فاتورة مبيعات','225', '0', '2026-10-05 13:56:31', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '497.18', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-05 13:56:30','0','0','',''); -- id=376
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('417','00058', '225', '1', '58', '1', '418', '418', '0', '', '0', '2026-10-05 13:56:31', '58', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','418','418','0','','0','','0','0','0','0'); -- id=1952
UPDATE sellbilldetail SET  lastbuyprice = 417.00 , meanbuyprice = 417.00, lastbuyprice_withDiscount = 417.00, meanbuyprice_withDiscount = 417.00
        , lastbuyprice_withTax = 417, meanbuyprice_withTax = 417, lastbuyprice_withDiscountAndTax = 417
                where sellbilldetailid = 1952;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (58, '2026-10-05', 418, 417, 417
                    , 417, 417, 417, 417
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 417, 417, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+418, sellCostBuyPrice =sellCostBuyPrice+417
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+417, sellCostMeanBuyPrice = sellCostMeanBuyPrice+417
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+417, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+417
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+417
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+417
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+417
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 418, 417, 417
                    , 417, 417, 417, 417
                    , 0, 0, 0, 0
                    , 0, 0, 0, 417, 417, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+418, sellCostBuyPrice =sellCostBuyPrice+417
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+417, sellCostMeanBuyPrice = sellCostMeanBuyPrice+417
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+417, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+417
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+417
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+417
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+417
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-10-05 13:56:31' WHERE storedetailid = '58';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('58', '1', '1', '1', '225', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '1', '2026-10-05 13:56:31','0','0'); -- id=3677
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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', '225', '1', '54', '1', '79.18', '79.18', '0', '', '0', '2026-10-05 13:56:31', '54', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','79.18','79.18','0','','0','0.00','0','0','0','0'); -- id=1953
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 = 1953;
 INSERT INTO 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-10-05', 79.18, 79.18, 79.18
                    , 79.18, 79.18, 79.18, 79.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 79.18, 79.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+79.18, sellCostBuyPrice =sellCostBuyPrice+79.18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+79.18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+79.18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+79.18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+79.18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+79.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+79.18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+79.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 79.18, 79.18, 79.18
                    , 79.18, 79.18, 79.18, 79.18
                    , 0, 0, 0, 0
                    , 0, 0, 0, 79.18, 79.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+79.18, sellCostBuyPrice =sellCostBuyPrice+79.18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+79.18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+79.18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+79.18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+79.18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+79.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+79.18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+79.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '95', userid = '1', storedetaildate = '2026-10-05 13:56:31' WHERE storedetailid = '54';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('54', '1', '1', '1', '225', 'اضافة فاتورة مبيعات', 'sellbillController.php', '96', '95', '1', '2026-10-05 13:56:31','0','0'); -- id=3678
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-898720.07',  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 ('-899217.25','497.18', '0', '1', 'اضافة فاتورة مبيعات', '225', '-898720.07', '2026-10-05 13:56:32', '1',  'sellbillController.php','1','','0'); -- id=227
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '497.18', '497.18', '2026-10-05', '1', '0', '0', '2026-10-05 13:56:32','اضافة فاتورة مبيعات رقم 225','1','0',null,'0','225','sellbillController.php?do=showDetail&sellbillid=225'); -- id=1326
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1326', '383', '497.18', '','0'); -- id=1332
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-154507.01', 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 ('1326', '143', '497.18', '','0'); -- id=1328
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '998975.51', 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 ( '496.18', '496.18', '2026-10-05', '1', '0', '0', '2026-10-05 13:56:32','اضافة فاتورة مبيعات رقم 225 - صرف البضاعة من المخزن','1','0',null,'0','225','sellbillController.php?do=showDetail&sellbillid=225'); -- id=1327
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1327', '402', '496.18', '','0'); -- id=1333
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '906152.17', 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 ('1327', '382', '496.18', '','0'); -- id=1329
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2443225.42', 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='1326,0,1327' where sellbillid=225;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 497.18, 496.18, 496.18
                    , 496.18, 496.18, 496.18, 496.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,496.18, 496.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+497.18, sellCostBuyPrice =sellCostBuyPrice+496.18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+496.18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+496.18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+496.18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+496.18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+496.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+496.18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+496.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 497.18, 496.18, 496.18
                    , 496.18, 496.18, 496.18, 496.18
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,496.18, 496.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+497.18, sellCostBuyPrice =sellCostBuyPrice+496.18
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+496.18, sellCostMeanBuyPrice = sellCostMeanBuyPrice+496.18
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+496.18, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+496.18
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+496.18
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+496.18
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+496.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 497.18, 496.18, 496.18
                    , 496.18, 496.18, 496.18, 496.18, 496.18, 496.18)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+497.18, netSellCostBuyPrice = netSellCostBuyPrice+496.18
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+496.18
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+496.18
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+496.18
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+496.18
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+496.18
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+496.18
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+496.18;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac38a6cc1f2e and sellbillId = 225 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 10:26:33";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 13:56:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 13:56:33', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3540
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:04:01";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:34:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:34:02', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php'); -- id=3541
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:04:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:34:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:34:27', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3542
UPDATE storedetail SET  productquantity = '320', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '18', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '338', '320', '1', '2026-10-05','0','0'); -- id=3679
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1890', '1890', '2026-10-05', '1', '0', '0', '2026-10-05 14:34:28','اعادة جرد للمنتج : (بريزه ام كي اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 320','1','0',null,'0','3679','inventoryController.php?do=details&id=3679'); -- id=1328
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1328', '188', '1890', '','0'); -- id=1334
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-57589.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1328', '382', '1890', '','0'); -- id=1330
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2441335.42', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:04:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:34:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:34:39', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3543
UPDATE storedetail SET  productquantity = '323', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '9', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '314', '323', '1', '2026-10-05','0','0'); -- id=3680
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '945', '945', '2026-10-05', '1', '0', '0', '2026-10-05 14:34:39','اعادة جرد للمنتج : (بريزه مجوفه اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 323','1','0',null,'0','3680','inventoryController.php?do=details&id=3680'); -- id=1329
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1329', '382', '945', '','0'); -- id=1335
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2442280.42', 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 ('1329', '188', '945', '','0'); -- id=1331
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-58534.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:05:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:35:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:35:12', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3544
UPDATE storedetail SET  productquantity = '3358', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '57', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '3301', '3358', '1', '2026-10-05','0','0'); -- id=3681
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1983.6', '1983.6', '2026-10-05', '1', '0', '0', '2026-10-05 14:35:12','اعادة جرد للمنتج : (بريزه مفرد اسمر/كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 3358','1','0',null,'0','3681','inventoryController.php?do=details&id=3681'); -- id=1330
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1330', '382', '1983.6', '','0'); -- id=1336
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2444264.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1330', '188', '1983.6', '','0'); -- id=1332
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-60517.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:05:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:35:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:35:23', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3545
UPDATE storedetail SET  productquantity = '267', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '41', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '226', '267', '1', '2026-10-05','0','0'); -- id=3682
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2583', '2583', '2026-10-05', '1', '0', '0', '2026-10-05 14:35:23','اعادة جرد للمنتج : (زر جرس مفرد اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 267','1','0',null,'0','3682','inventoryController.php?do=details&id=3682'); -- id=1331
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1331', '382', '2583', '','0'); -- id=1337
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2446847.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1331', '188', '2583', '','0'); -- id=1333
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-63100.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:05:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:35:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:35:37', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3546
UPDATE storedetail SET  productquantity = '6150', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '442', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '6592', '6150', '1', '2026-10-05','0','0'); -- id=3683
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4663.1', '4663.1', '2026-10-05', '1', '0', '0', '2026-10-05 14:35:38','اعادة جرد للمنتج : (سداده اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 6150','1','0',null,'0','3683','inventoryController.php?do=details&id=3683'); -- id=1332
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1332', '188', '4663.1', '','0'); -- id=1338
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-58437.55', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1332', '382', '4663.1', '','0'); -- id=1334
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2442183.92', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:05:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:35:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:35:55', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3547
UPDATE storedetail SET  productquantity = '6650', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '500', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '6150', '6650', '1', '2026-10-05','0','0'); -- id=3684
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5275', '5275', '2026-10-05', '1', '0', '0', '2026-10-05 14:35:55','اعادة جرد للمنتج : (سداده اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 6650','1','0',null,'0','3684','inventoryController.php?do=details&id=3684'); -- id=1333
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1333', '382', '5275', '','0'); -- id=1339
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2447458.92', 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 ('1333', '188', '5275', '','0'); -- id=1335
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-63712.55', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:06:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:36:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:36:41', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3548
UPDATE storedetail SET  productquantity = '2825', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '74', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '2751', '2825', '1', '2026-10-05','0','0'); -- id=3685
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3903.5', '3903.5', '2026-10-05', '1', '0', '0', '2026-10-05 14:36:42','اعادة جرد للمنتج : (شاسيه بالوش اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 2825','1','0',null,'0','3685','inventoryController.php?do=details&id=3685'); -- id=1334
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1334', '382', '3903.5', '','0'); -- id=1340
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2451362.42', 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 ('1334', '188', '3903.5', '','0'); -- id=1336
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-67616.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:06:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:36:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:36:52', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3549
UPDATE storedetail SET  productquantity = '221', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '9';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('9', '1', '6', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '227', '221', '1', '2026-10-05','0','0'); -- id=3686
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1836', '1836', '2026-10-05', '1', '0', '0', '2026-10-05 14:36:52','اعادة جرد للمنتج : (قطعه طواريء /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 221','1','0',null,'0','3686','inventoryController.php?do=details&id=3686'); -- id=1335
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1335', '188', '1836', '','0'); -- id=1341
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-65780.05', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1335', '382', '1836', '','0'); -- id=1337
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2449526.42', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:06:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:36:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:36:58', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3550
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '40';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('40', '1', '4', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '60', '56', '1', '2026-10-05','0','0'); -- id=3687
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '485.6', '485.6', '2026-10-05', '1', '0', '0', '2026-10-05 14:36:59','اعادة جرد للمنتج : (مفتاح 4 طرف اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 56','1','0',null,'0','3687','inventoryController.php?do=details&id=3687'); -- id=1336
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1336', '188', '485.6', '','0'); -- id=1342
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-65294.45', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1336', '382', '485.6', '','0'); -- id=1338
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2449040.82', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:07:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:37:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:37:11', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3551
UPDATE storedetail SET  productquantity = '241', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '5', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '236', '241', '1', '2026-10-05','0','0'); -- id=3688
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1185', '1185', '2026-10-05', '1', '0', '0', '2026-10-05 14:37:11','اعادة جرد للمنتج : (مفتاح تكييف 45 امبير اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 241','1','0',null,'0','3688','inventoryController.php?do=details&id=3688'); -- id=1337
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1337', '382', '1185', '','0'); -- id=1343
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2450225.82', 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 ('1337', '188', '1185', '','0'); -- id=1339
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-66479.45', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:07:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:37:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:37:23', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3552
UPDATE storedetail SET  productquantity = '341', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '12';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '6', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '335', '341', '1', '2026-10-05','0','0'); -- id=3689
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '378', '378', '2026-10-05', '1', '0', '0', '2026-10-05 14:37:24','اعادة جرد للمنتج : (مفتاح ديفاتيري اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 341','1','0',null,'0','3689','inventoryController.php?do=details&id=3689'); -- id=1338
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1338', '382', '378', '','0'); -- id=1344
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2450603.82', 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 ('1338', '188', '378', '','0'); -- id=1340
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-66857.45', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:07:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:37:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:37:35', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3553
UPDATE storedetail SET  productquantity = '283', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '15';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '1', '4', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '279', '283', '1', '2026-10-05','0','0'); -- id=3690
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '652', '652', '2026-10-05', '1', '0', '0', '2026-10-05 14:37:35','اعادة جرد للمنتج : (مفتاح سخان 20 امبير اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 283','1','0',null,'0','3690','inventoryController.php?do=details&id=3690'); -- id=1339
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1339', '382', '652', '','0'); -- id=1345
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2451255.82', 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 ('1339', '188', '652', '','0'); -- id=1341
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-67509.45', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:08:10";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:38:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:38:10', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3554
UPDATE storedetail SET  productquantity = '3196', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '139', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '3057', '3196', '1', '2026-10-05','0','0'); -- id=3691
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4837.2', '4837.2', '2026-10-05', '1', '0', '0', '2026-10-05 14:38:11','اعادة جرد للمنتج : (مفتاح مفرد اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 3196','1','0',null,'0','3691','inventoryController.php?do=details&id=3691'); -- id=1340
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1340', '382', '4837.2', '','0'); -- id=1346
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2456093.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1340', '188', '4837.2', '','0'); -- id=1342
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-72346.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:08:31";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:38:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:38:31', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3555
UPDATE storedetail SET  productquantity = '3136', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '60', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '3196', '3136', '1', '2026-10-05','0','0'); -- id=3692
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2088', '2088', '2026-10-05', '1', '0', '0', '2026-10-05 14:38:32','اعادة جرد للمنتج : (مفتاح مفرد اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 3136','1','0',null,'0','3692','inventoryController.php?do=details&id=3692'); -- id=1341
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1341', '188', '2088', '','0'); -- id=1347
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-70258.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1341', '382', '2088', '','0'); -- id=1343
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2454005.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:08:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:38:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:38:41', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3556
UPDATE storedetail SET  productquantity = '280', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '15';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '1', '3', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '283', '280', '1', '2026-10-05','0','0'); -- id=3693
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '489', '489', '2026-10-05', '1', '0', '0', '2026-10-05 14:38:41','اعادة جرد للمنتج : (مفتاح سخان 20 امبير اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 280','1','0',null,'0','3693','inventoryController.php?do=details&id=3693'); -- id=1342
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1342', '188', '489', '','0'); -- id=1348
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-69769.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1342', '382', '489', '','0'); -- id=1344
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2453516.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:08:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:38:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:38:47', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3557
UPDATE storedetail SET  productquantity = '335', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '12';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '6', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '341', '335', '1', '2026-10-05','0','0'); -- id=3694
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '378', '378', '2026-10-05', '1', '0', '0', '2026-10-05 14:38:48','اعادة جرد للمنتج : (مفتاح ديفاتيري اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 335','1','0',null,'0','3694','inventoryController.php?do=details&id=3694'); -- id=1343
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1343', '188', '378', '','0'); -- id=1349
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-69391.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1343', '382', '378', '','0'); -- id=1345
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2453138.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:08:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:38:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:38:55', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3558
UPDATE storedetail SET  productquantity = '236', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '10';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '5', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '241', '236', '1', '2026-10-05','0','0'); -- id=3695
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1185', '1185', '2026-10-05', '1', '0', '0', '2026-10-05 14:38:56','اعادة جرد للمنتج : (مفتاح تكييف 45 امبير اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 236','1','0',null,'0','3695','inventoryController.php?do=details&id=3695'); -- id=1344
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1344', '188', '1185', '','0'); -- id=1350
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-68206.65', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1344', '382', '1185', '','0'); -- id=1346
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2451953.02', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:09:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:39:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:39:27', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3559
UPDATE storedetail SET  productquantity = '2750', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '75', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '2825', '2750', '1', '2026-10-05','0','0'); -- id=3696
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3956.25', '3956.25', '2026-10-05', '1', '0', '0', '2026-10-05 14:39:27','اعادة جرد للمنتج : (شاسيه بالوش اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 2750','1','0',null,'0','3696','inventoryController.php?do=details&id=3696'); -- id=1345
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1345', '188', '3956.25', '','0'); -- id=1351
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-64250.4', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1345', '382', '3956.25', '','0'); -- id=1347
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2447996.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:09:42";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:39:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:39:42', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3560
UPDATE storedetail SET  productquantity = '6592', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '58', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '6650', '6592', '1', '2026-10-05','0','0'); -- id=3697
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '611.9', '611.9', '2026-10-05', '1', '0', '0', '2026-10-05 14:39:42','اعادة جرد للمنتج : (سداده اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 6592','1','0',null,'0','3697','inventoryController.php?do=details&id=3697'); -- id=1346
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1346', '188', '611.9', '','0'); -- id=1352
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-63638.5', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1346', '382', '611.9', '','0'); -- id=1348
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2447384.87', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:09:55";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:39:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:39:55', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3561
UPDATE storedetail SET  productquantity = '313', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '7', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '320', '313', '1', '2026-10-05','0','0'); -- id=3698
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '735', '735', '2026-10-05', '1', '0', '0', '2026-10-05 14:39:56','اعادة جرد للمنتج : (بريزه ام كي اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 313','1','0',null,'0','3698','inventoryController.php?do=details&id=3698'); -- id=1347
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1347', '188', '735', '','0'); -- id=1353
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-62903.5', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1347', '382', '735', '','0'); -- id=1349
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2446649.87', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:10:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:40:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:40:05', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3562
UPDATE storedetail SET  productquantity = '315', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '11';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '8', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '323', '315', '1', '2026-10-05','0','0'); -- id=3699
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '840', '840', '2026-10-05', '1', '0', '0', '2026-10-05 14:40:05','اعادة جرد للمنتج : (بريزه مجوفه اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 315','1','0',null,'0','3699','inventoryController.php?do=details&id=3699'); -- id=1348
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1348', '188', '840', '','0'); -- id=1354
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-62063.5', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1348', '382', '840', '','0'); -- id=1350
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2445809.87', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:10:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:40:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:40:46', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3563
UPDATE storedetail SET  productquantity = '3298', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '60', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '3358', '3298', '1', '2026-10-05','0','0'); -- id=3700
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2088', '2088', '2026-10-05', '1', '0', '0', '2026-10-05 14:40:46','اعادة جرد للمنتج : (بريزه مفرد اسمر/كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 3298','1','0',null,'0','3700','inventoryController.php?do=details&id=3700'); -- id=1349
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1349', '188', '2088', '','0'); -- id=1355
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-59975.5', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1349', '382', '2088', '','0'); -- id=1351
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2443721.87', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:10:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:40:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:40:49', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3564
UPDATE storedetail SET  productquantity = '261', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '16';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('16', '1', '6', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '267', '261', '1', '2026-10-05','0','0'); -- id=3701
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '378', '378', '2026-10-05', '1', '0', '0', '2026-10-05 14:40:49','اعادة جرد للمنتج : (زر جرس مفرد اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 261','1','0',null,'0','3701','inventoryController.php?do=details&id=3701'); -- id=1350
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1350', '188', '378', '','0'); -- id=1356
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-59597.5', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1350', '382', '378', '','0'); -- id=1352
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2443343.87', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:11:24";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:41:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-05 14:41:24', '1', 'autosave', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/inventoryController.php?do=autosave'); -- id=3565
UPDATE storedetail SET  productquantity = '3069', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '67', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '3136', '3069', '1', '2026-10-05','0','0'); -- id=3702
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2331.6', '2331.6', '2026-10-05', '1', '0', '0', '2026-10-05 14:41:25','اعادة جرد للمنتج : (مفتاح مفرد اسمر /كيون) فى مخزن : (المخزن الرئيسي) بالكمية : 3069','1','0',null,'0','3702','inventoryController.php?do=details&id=3702'); -- id=1351
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1351', '188', '2331.6', '','0'); -- id=1357
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-57265.9', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1351', '382', '2331.6', '','0'); -- id=1353
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2441012.27', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:11:39";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:41:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 14:41:39', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3566
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:22:45";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:52:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 14:52:45', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3567

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac39b03de7d4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-05 14:52:45', '06ac39b03de7d4', '1', '0.00', '0', '0', '1', '6012.50', '6012.5', '6012.5', '0', '1', '2026-10-05 14:52:45', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '86.5' ,'0','','','','','-1','0','0','0','0','0','6012','0','','0','0','6012.5','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-05','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=226
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','اضافة فاتورة مبيعات','226', '0', '2026-10-05 14:52:46', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6012.5', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-05 14:52:45','0','0','',''); -- id=377
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+50 where id = 104;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('2.5','00074', '226', '12', '74', '50', '2.95', '147.5', '0', '', '1', '2026-10-05 14:52:46', '74', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','104-50,','1','1','0','0','2.95','147.5','0','','0','0.00','0','0','0','0'); -- id=1954
UPDATE sellbilldetail SET  lastbuyprice = 2.50 , meanbuyprice = 2.53, lastbuyprice_withDiscount = 2.50, meanbuyprice_withDiscount = 2.53
        , lastbuyprice_withTax = 2.5, meanbuyprice_withTax = 2.53, lastbuyprice_withDiscountAndTax = 2.5
                where sellbilldetailid = 1954;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (74, '2026-10-05', 147.5, 125, 125
                    , 126.5, 125, 126.5, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 50, 0, 125, 126.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+147.5, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+126.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+126.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+126.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+50
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 147.5, 125, 125
                    , 126.5, 125, 126.5, 125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 125, 126.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+147.5, sellCostBuyPrice =sellCostBuyPrice+125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+126.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+126.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+126.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 = '2240', userid = '1', storedetaildate = '2026-10-05 14:52:46' WHERE storedetailid = '74';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('74', '1', '50', '1', '226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2290', '2240', '1', '2026-10-05 14:52:46','0','0'); -- id=3703
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 42;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('4.25','00076', '226', '12', '76', '20', '4.75', '95', '0', '', '1', '2026-10-05 14:52:46', '76', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','42-20,','1','1','0','0','4.75','95','0','','0','0.00','0','0','0','0'); -- id=1955
UPDATE sellbilldetail SET  lastbuyprice = 4.25 , meanbuyprice = 4.25, lastbuyprice_withDiscount = 4.25, meanbuyprice_withDiscount = 4.25
        , lastbuyprice_withTax = 4.25, meanbuyprice_withTax = 4.25, lastbuyprice_withDiscountAndTax = 4.25
                where sellbilldetailid = 1955;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (76, '2026-10-05', 95, 85, 85
                    , 85, 85, 85, 85
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 85, 85, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+85
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+85, sellCostMeanBuyPrice = sellCostMeanBuyPrice+85
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+85, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+85
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+85
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+85
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+85
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 95, 85, 85
                    , 85, 85, 85, 85
                    , 0, 0, 0, 0
                    , 0, 0, 0, 85, 85, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+95, sellCostBuyPrice =sellCostBuyPrice+85
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+85, sellCostMeanBuyPrice = sellCostMeanBuyPrice+85
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+85, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+85
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+85
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+85
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+85
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1507', userid = '1', storedetaildate = '2026-10-05 14:52:47' WHERE storedetailid = '76';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('76', '1', '20', '1', '226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1527', '1507', '1', '2026-10-05 14:52:47','0','0'); -- id=3704
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 45;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 102;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('342.67','00070', '226', '12', '70', '15', '382', '5730', '0', '', '1', '2026-10-05 14:52:47', '70', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','45-5,102-10,','1','1','0','0','382','5730','0','','0','0.00','0','0','0','0'); -- id=1956
UPDATE sellbilldetail SET  lastbuyprice = 348.00 , meanbuyprice = 332.81, lastbuyprice_withDiscount = 348.00, meanbuyprice_withDiscount = 332.81
        , lastbuyprice_withTax = 348, meanbuyprice_withTax = 332.81, lastbuyprice_withDiscountAndTax = 348
                where sellbilldetailid = 1956;
 INSERT INTO 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-10-05', 5730, 5220, 5220
                    , 4992.15, 5220, 4992.15, 5100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5220, 4992.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5730, sellCostBuyPrice =sellCostBuyPrice+5220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4992.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4992.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4992.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+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 5730, 5220, 5220
                    , 4992.15, 5220, 4992.15, 5100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5220, 4992.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5730, sellCostBuyPrice =sellCostBuyPrice+5220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4992.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4992.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4992.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 = '75', userid = '1', storedetaildate = '2026-10-05 14:52:47' WHERE storedetailid = '70';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('70', '1', '15', '1', '226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '75', '1', '2026-10-05 14:52:47','0','0'); -- id=3705
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('55','00077', '226', '12', '77', '.5', '60', '30', '0', '', '1', '2026-10-05 14:52:47', '77', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','60','30','0','','0','0.00','0','0','0','0'); -- id=1957
UPDATE sellbilldetail SET  lastbuyprice = 55.00 , meanbuyprice = 55.00, lastbuyprice_withDiscount = 55.00, meanbuyprice_withDiscount = 55.00
        , lastbuyprice_withTax = 55, meanbuyprice_withTax = 55, lastbuyprice_withDiscountAndTax = 55
                where sellbilldetailid = 1957;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (77, '2026-10-05', 30, 27.5, 27.5
                    , 27.5, 27.5, 27.5, 27.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0.5, 0, 27.5, 27.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+27.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+27.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+27.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+27.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+27.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+0.5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 30, 27.5, 27.5
                    , 27.5, 27.5, 27.5, 27.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 27.5, 27.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+27.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+27.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+27.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+27.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+27.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4.3', userid = '1', storedetaildate = '2026-10-05 14:52:47' WHERE storedetailid = '77';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('77', '1', '0.5', '1', '226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.8', '4.3', '1', '2026-10-05 14:52:47','0','0'); -- id=3706
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','00433', '226', '6', '433', '1', '10', '10', '0', '', '1', '2026-10-05 14:52:47', '433', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=1958
UPDATE sellbilldetail SET  lastbuyprice = 10.00 , meanbuyprice = 10.00, lastbuyprice_withDiscount = 10.00, meanbuyprice_withDiscount = 10.00
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10, lastbuyprice_withDiscountAndTax = 10
                where sellbilldetailid = 1958;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (433, '2026-10-05', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-10-05 14:52:48' WHERE storedetailid = '433';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('433', '1', '1', '1', '226', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '6', '1', '2026-10-05 14:52:48','0','0'); -- id=3707
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-892707.5625',  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 ('-898720.0625','6012.5', '0', '1', 'اضافة فاتورة مبيعات', '226', '-892707.5625', '2026-10-05 14:52:48', '1',  'sellbillController.php','1','','0'); -- id=228
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6012.5', '6012.5', '2026-10-05', '1', '0', '0', '2026-10-05 14:52:48','اضافة فاتورة مبيعات رقم 226','1','0',null,'0','226','sellbillController.php?do=showDetail&sellbillid=226'); -- id=1352
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1352', '383', '6012.5', '','0'); -- id=1358
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-148494.51', 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 ('1352', '143', '6012.5', '','0'); -- id=1354
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1004988.01', 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 ( '5467.5', '5467.5', '2026-10-05', '1', '0', '0', '2026-10-05 14:52:48','اضافة فاتورة مبيعات رقم 226 - صرف البضاعة من المخزن','1','0',null,'0','226','sellbillController.php?do=showDetail&sellbillid=226'); -- id=1353
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1353', '402', '5467.5', '','0'); -- id=1359
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '911619.67', 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 ('1353', '382', '5467.5', '','0'); -- id=1355
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2435544.77', 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='1352,0,1353' where sellbillid=226;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 6012.5, 5467.5, 5467.5
                    , 5241.15, 5467.5, 5241.15, 5347.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5467.5, 5241.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6012.5, sellCostBuyPrice =sellCostBuyPrice+5467.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5467.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5241.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5467.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5241.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5347.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5467.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5241.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 6012.5, 5467.5, 5467.5
                    , 5241.15, 5467.5, 5241.15, 5347.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5467.5, 5241.15, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6012.5, sellCostBuyPrice =sellCostBuyPrice+5467.5
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5467.5, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5241.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5467.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5241.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5347.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5467.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5241.15
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 6012.5, 5467.5, 5467.5
                    , 5241.15, 5467.5, 5241.15, 5347.5, 5467.5, 5241.15)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6012.5, netSellCostBuyPrice = netSellCostBuyPrice+5467.5
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5467.5
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5241.15
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5467.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5241.15
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5347.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5467.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5241.15;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac39b03de7d4 and sellbillId = 226 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 11:22:49";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 14:52:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 14:52:50', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3568
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 12:36:18";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 16:06:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 16:06:18', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3569

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac39da2c5c2d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-05 16:06:22', '06ac39da2c5c2d', '1', '0.00', '0', '0', '1', '455.00', '455', '455', '0', '1', '2026-10-05 16:06:22', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','455','0','','0','0','455','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-05','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=227
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','اضافة فاتورة مبيعات','227', '0', '2026-10-05 16:06:23', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '455', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-05 16:06:22','0','0','',''); -- id=378
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', '227', '7', '318', '2', '75', '150', '0', '', '1', '2026-10-05 16:06:23', '318', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','17-2,','1','1','0','0','75','150','0','','0','0.00','0','0','0','0'); -- id=1959
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 = 1959;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (318, '2026-10-05', 150, 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+150, 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-10-05', 150, 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+150, 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 = '43', userid = '1', storedetaildate = '2026-10-05 16:06:23' WHERE storedetailid = '318';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('318', '1', '2', '1', '227', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '43', '1', '2026-10-05 16:06:23','0','0'); -- id=3708
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 75;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','00282', '227', '22', '282', '1', '305', '305', '0', '', '1', '2026-10-05 16:06:23', '282', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','1','0','','75-1,','1','1','0','0','305','305','0','','0','0.00','0','0','0','0'); -- id=1960
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 1960;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (282, '2026-10-05', 305, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 275, 275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 305, 275, 275
                    , 275, 275, 275, 275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 275, 275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+305, sellCostBuyPrice =sellCostBuyPrice+275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-05 16:06:24' WHERE storedetailid = '282';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('282', '1', '1', '1', '227', 'اضافة فاتورة مبيعات', 'sellbillController.php', '31', '30', '1', '2026-10-05 16:06:24','0','0'); -- id=3709
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-892252.5625',  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 ('-892707.5625','455', '0', '1', 'اضافة فاتورة مبيعات', '227', '-892252.5625', '2026-10-05 16:06:24', '1',  'sellbillController.php','1','','0'); -- id=229
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '455', '455', '2026-10-05', '1', '0', '0', '2026-10-05 16:06:24','اضافة فاتورة مبيعات رقم 227','1','0',null,'0','227','sellbillController.php?do=showDetail&sellbillid=227'); -- id=1354
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1354', '383', '455', '','0'); -- id=1360
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-148039.51', 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 ('1354', '143', '455', '','0'); -- id=1356
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1005443.01', 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 ( '414', '414', '2026-10-05', '1', '0', '0', '2026-10-05 16:06:24','اضافة فاتورة مبيعات رقم 227 - صرف البضاعة من المخزن','1','0',null,'0','227','sellbillController.php?do=showDetail&sellbillid=227'); -- id=1355
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1355', '402', '414', '','0'); -- id=1361
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '912033.67', 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 ('1355', '382', '414', '','0'); -- id=1357
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2435130.77', 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='1354,0,1355' where sellbillid=227;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 455, 414, 414
                    , 412.56, 414, 412.56, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,414, 412.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+412.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+412.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+412.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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 455, 414, 414
                    , 412.56, 414, 412.56, 414
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,414, 412.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+455, sellCostBuyPrice =sellCostBuyPrice+414
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+414, sellCostMeanBuyPrice = sellCostMeanBuyPrice+412.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+412.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+414
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+412.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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 455, 414, 414
                    , 412.56, 414, 412.56, 414, 414, 412.56)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+455, netSellCostBuyPrice = netSellCostBuyPrice+414
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+414
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+412.56
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+414
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+412.56
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+414
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+414
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+412.56;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac39da2c5c2d and sellbillId = 227 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 12:36:26";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 16:06:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 16:06:26', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3570
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 13:58:59";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:28:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 17:28:59', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=6'); -- id=3571
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 13:59:04";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:29:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 17:29:04', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=3572
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 13:59:06";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:29:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 17:29:06', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=3573
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 14:03:28";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:33:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 17:33:29', '1', 'addAndRetuen', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=3574

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ac3c242bdf1b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(41,@clientdebt,@clientname,@treeIdis);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-10-05 17:33:29', '06ac3c242bdf1b', '41', '7786.00', '3814.4', '0', '1', '3971.6', '3971.6', '0', '-3971.6', '1', '2026-10-05 17:33:29', '', '1', '0', 'احمد سعد','1', '1', '5', '0', 'احمد سعد', '140', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0','0','0','-1','0','1','1','','0'); -- id=14
UPDATE client SET  clientdebt = '3814.4', userid = '1' WHERE clientid = '41';
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 ('41','7786.00','3971.6','1','اضافة فاتورة مردوات مبيعات','14', '3814.4', '2026-10-05 17:33:29', '1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '3971.6', '0', null, '0', null, null,'', '0','1','1','3971.6','1','2026-10-05 17:33:29','0','0','',''); -- id=379
UPDATE client SET  inUse = 0 where clientid = 41;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('8.44', '00044', '14', '1', '44', '1', '8.8', '8.8', '0', '', '1', '0', '44', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','8.8','8.8','0','','0'); -- id=61
UPDATE returnsellbilldetail SET  lastbuyprice = 8.44 , meanbuyprice = 8.44, lastbuyprice_withDiscount = 8.44, meanbuyprice_withDiscount = 8.44
        , lastbuyprice_withTax = 8.44, meanbuyprice_withTax = 8.44, lastbuyprice_withDiscountAndTax = 8.44
                where returnsellbilldetailid = 61;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (44, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 8.8, 8.44, 8.44, 8.44
                    , 8.44, 8.44, 8.44, 0, 1, 0, 0, 8.44, 8.44)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+8.8, returnSellCostBuyPrice = returnSellCostBuyPrice+8.44, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+8.44
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+8.44, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+8.44
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+8.44
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+8.44
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+8.44
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+8.44
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 8.8, 8.44, 8.44, 8.44
                    , 8.44, 8.44, 8.44, 0, 0, 8.44, 8.44)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+8.8, returnSellCostBuyPrice = returnSellCostBuyPrice+8.44, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+8.44
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+8.44, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+8.44
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+8.44
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+8.44
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+8.44
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+8.44;
UPDATE storedetail SET  productquantity = '1751', userid = '1', storedetaildate = '2026-10-05 17:33:30' WHERE storedetailid = '44';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('44', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '1750', '1751', '1', '2026-10-05 17:33:30','0','0'); -- id=3710
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('68.63', '00052', '14', '1', '52', '1', '72', '72', '0', '', '1', '0', '52', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','72','72','0','','0'); -- id=62
UPDATE returnsellbilldetail SET  lastbuyprice = 68.63 , meanbuyprice = 68.63, lastbuyprice_withDiscount = 68.63, meanbuyprice_withDiscount = 68.63
        , lastbuyprice_withTax = 68.63, meanbuyprice_withTax = 68.63, lastbuyprice_withDiscountAndTax = 68.63
                where returnsellbilldetailid = 62;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (52, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 72, 68.63, 68.63, 68.63
                    , 68.63, 68.63, 68.63, 0, 1, 0, 0, 68.63, 68.63)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+72, returnSellCostBuyPrice = returnSellCostBuyPrice+68.63, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+68.63
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+68.63, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+68.63
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+68.63
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+68.63
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+68.63
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+68.63
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 72, 68.63, 68.63, 68.63
                    , 68.63, 68.63, 68.63, 0, 0, 68.63, 68.63)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+72, returnSellCostBuyPrice = returnSellCostBuyPrice+68.63, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+68.63
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+68.63, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+68.63
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+68.63
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+68.63
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+68.63
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+68.63;
UPDATE storedetail SET  productquantity = '131', userid = '1', storedetaildate = '2026-10-05 17:33:30' WHERE storedetailid = '52';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('52', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '130', '131', '1', '2026-10-05 17:33:30','0','0'); -- id=3711
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('89.70', '00047', '14', '1', '47', '1', '95', '95', '0', '', '1', '0', '47', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','95','95','0','','0'); -- id=63
UPDATE returnsellbilldetail SET  lastbuyprice = 89.70 , meanbuyprice = 89.70, lastbuyprice_withDiscount = 89.70, meanbuyprice_withDiscount = 89.70
        , lastbuyprice_withTax = 89.7, meanbuyprice_withTax = 89.7, lastbuyprice_withDiscountAndTax = 89.7
                where returnsellbilldetailid = 63;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (47, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 95, 89.7, 89.7, 89.7
                    , 89.7, 89.7, 89.7, 0, 1, 0, 0, 89.7, 89.7)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+95, returnSellCostBuyPrice = returnSellCostBuyPrice+89.7, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+89.7
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+89.7, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+89.7
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+89.7
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+89.7
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+89.7
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+89.7
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 95, 89.7, 89.7, 89.7
                    , 89.7, 89.7, 89.7, 0, 0, 89.7, 89.7)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+95, returnSellCostBuyPrice = returnSellCostBuyPrice+89.7, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+89.7
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+89.7, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+89.7
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+89.7
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+89.7
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+89.7
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+89.7;
UPDATE storedetail SET  productquantity = '145', userid = '1', storedetaildate = '2026-10-05 17:33:30' WHERE storedetailid = '47';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('47', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '144', '145', '1', '2026-10-05 17:33:30','0','0'); -- id=3712
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('105.00', '00006', '14', '1', '6', '1', '109', '109', '0', '', '1', '0', '6', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','109','109','0','','0'); -- id=64
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 64;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 109, 105, 105, 105
                    , 105, 105, 105, 0, 1, 0, 0, 105, 105)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+109, returnSellCostBuyPrice = returnSellCostBuyPrice+105, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+105
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+105, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+105
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+105
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+105
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+105
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+105
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 109, 105, 105, 105
                    , 105, 105, 105, 0, 0, 105, 105)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+109, returnSellCostBuyPrice = returnSellCostBuyPrice+105, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+105
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+105, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+105
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+105
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+105
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+105
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+105;
UPDATE storedetail SET  productquantity = '314', userid = '1', storedetaildate = '2026-10-05 17:33:31' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '313', '314', '1', '2026-10-05 17:33:31','0','0'); -- id=3713
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('14.00', '00206', '14', '6', '206', '70', '17.2', '1204', '0', '', '1', '0', '206', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','17.2','1204','0','','0'); -- id=65
UPDATE returnsellbilldetail SET  lastbuyprice = 14.00 , meanbuyprice = 14.00, lastbuyprice_withDiscount = 14.00, meanbuyprice_withDiscount = 14.00
        , lastbuyprice_withTax = 14, meanbuyprice_withTax = 14, lastbuyprice_withDiscountAndTax = 14
                where returnsellbilldetailid = 65;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (206, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1204, 980, 980, 980
                    , 980, 980, 980, 0, 70, 0, 0, 980, 980)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1204, returnSellCostBuyPrice = returnSellCostBuyPrice+980, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+980
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+980, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+980
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+980
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+980
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+980
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+980
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+70;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1204, 980, 980, 980
                    , 980, 980, 980, 0, 0, 980, 980)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1204, returnSellCostBuyPrice = returnSellCostBuyPrice+980, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+980
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+980, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+980
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+980
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+980
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+980
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+980;
UPDATE storedetail SET  productquantity = '85', userid = '1', storedetaildate = '2026-10-05 17:33:31' WHERE storedetailid = '206';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('206', '1', '70', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '15', '85', '1', '2026-10-05 17:33:31','0','0'); -- id=3714
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('11.00', '00207', '14', '6', '207', '5', '15', '75', '0', '', '1', '0', '207', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','15','75','0','','0'); -- id=66
UPDATE returnsellbilldetail SET  lastbuyprice = 11.00 , meanbuyprice = 11.00, lastbuyprice_withDiscount = 11.00, meanbuyprice_withDiscount = 11.00
        , lastbuyprice_withTax = 11, meanbuyprice_withTax = 11, lastbuyprice_withDiscountAndTax = 11
                where returnsellbilldetailid = 66;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (207, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 75, 55, 55, 55
                    , 55, 55, 55, 0, 5, 0, 0, 55, 55)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+75, returnSellCostBuyPrice = returnSellCostBuyPrice+55, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+55
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+55, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+55
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+55
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+55
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+55
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+55
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 75, 55, 55, 55
                    , 55, 55, 55, 0, 0, 55, 55)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+75, returnSellCostBuyPrice = returnSellCostBuyPrice+55, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+55
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+55, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+55
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+55
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+55
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+55
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+55;
UPDATE storedetail SET  productquantity = '105', userid = '1', storedetaildate = '2026-10-05 17:33:31' WHERE storedetailid = '207';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('207', '1', '5', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '100', '105', '1', '2026-10-05 17:33:31','0','0'); -- id=3715
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('188.30', '00199', '14', '20', '199', '1', '200', '200', '0', '', '1', '0', '199', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','200','200','0','','0'); -- id=67
UPDATE returnsellbilldetail SET  lastbuyprice = 188.30 , meanbuyprice = 188.30, lastbuyprice_withDiscount = 188.30, meanbuyprice_withDiscount = 188.30
        , lastbuyprice_withTax = 188.3, meanbuyprice_withTax = 188.3, lastbuyprice_withDiscountAndTax = 188.3
                where returnsellbilldetailid = 67;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (199, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 188.3, 188.3, 188.3
                    , 188.3, 188.3, 188.3, 0, 1, 0, 0, 188.3, 188.3)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+188.3, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+188.3
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+188.3, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+188.3
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+188.3
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+188.3
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+188.3
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188.3
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 200, 188.3, 188.3, 188.3
                    , 188.3, 188.3, 188.3, 0, 0, 188.3, 188.3)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+200, returnSellCostBuyPrice = returnSellCostBuyPrice+188.3, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+188.3
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+188.3, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+188.3
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+188.3
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+188.3
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+188.3
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+188.3;
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-10-05 17:33:32' WHERE storedetailid = '199';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('199', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '24', '25', '1', '2026-10-05 17:33:32','0','0'); -- id=3716
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('217.92', '00196', '14', '20', '196', '1', '245', '245', '0', '', '1', '0', '196', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','245','245','0','','0'); -- id=68
UPDATE returnsellbilldetail SET  lastbuyprice = 217.92 , meanbuyprice = 215.92, lastbuyprice_withDiscount = 217.92, meanbuyprice_withDiscount = 215.92
        , lastbuyprice_withTax = 217.92, meanbuyprice_withTax = 215.92, lastbuyprice_withDiscountAndTax = 217.92
                where returnsellbilldetailid = 68;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (196, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 245, 217.92, 217.92, 215.92
                    , 217.92, 215.92, 217.92, 0, 1, 0, 0, 217.92, 215.92)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+245, returnSellCostBuyPrice = returnSellCostBuyPrice+217.92, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+217.92
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+215.92, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+217.92
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+215.92
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+217.92
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+217.92
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+215.92
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 245, 217.92, 217.92, 215.92
                    , 217.92, 215.92, 217.92, 0, 0, 217.92, 215.92)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+245, returnSellCostBuyPrice = returnSellCostBuyPrice+217.92, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+217.92
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+215.92, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+217.92
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+215.92
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+217.92
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+217.92
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+215.92;
UPDATE storedetail SET  productquantity = '198', userid = '1', storedetaildate = '2026-10-05 17:33:32' WHERE storedetailid = '196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '197', '198', '1', '2026-10-05 17:33:32','0','0'); -- id=3717
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('44.33', '00041', '14', '1', '41', '9', '46', '414', '0', '', '1', '0', '41', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','46','414','0','','0'); -- id=69
UPDATE returnsellbilldetail SET  lastbuyprice = 44.33 , meanbuyprice = 44.33, lastbuyprice_withDiscount = 44.33, meanbuyprice_withDiscount = 44.33
        , lastbuyprice_withTax = 44.33, meanbuyprice_withTax = 44.33, lastbuyprice_withDiscountAndTax = 44.33
                where returnsellbilldetailid = 69;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 414, 398.97, 398.97, 398.97
                    , 398.97, 398.97, 398.97, 0, 9, 0, 0, 398.97, 398.97)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+414, returnSellCostBuyPrice = returnSellCostBuyPrice+398.97, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+398.97
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+398.97, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+398.97
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+398.97
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+398.97
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+398.97
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+398.97
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+9;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 414, 398.97, 398.97, 398.97
                    , 398.97, 398.97, 398.97, 0, 0, 398.97, 398.97)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+414, returnSellCostBuyPrice = returnSellCostBuyPrice+398.97, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+398.97
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+398.97, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+398.97
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+398.97
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+398.97
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+398.97
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+398.97;
UPDATE storedetail SET  productquantity = '654', userid = '1', storedetaildate = '2026-10-05 17:33:32' WHERE storedetailid = '41';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('41', '1', '9', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '645', '654', '1', '2026-10-05 17:33:32','0','0'); -- id=3718
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('29.50', '00043', '14', '1', '43', '31', '30.75', '953.25', '0', '', '1', '0', '43', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','30.75','953.25','0','','0'); -- id=70
UPDATE returnsellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where returnsellbilldetailid = 70;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (43, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 953.25, 914.5, 914.5, 914.5
                    , 914.5, 914.5, 914.5, 0, 31, 0, 0, 914.5, 914.5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+953.25, returnSellCostBuyPrice = returnSellCostBuyPrice+914.5, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+914.5
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+914.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+914.5
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+914.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+914.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+914.5
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+914.5
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+31;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 953.25, 914.5, 914.5, 914.5
                    , 914.5, 914.5, 914.5, 0, 0, 914.5, 914.5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+953.25, returnSellCostBuyPrice = returnSellCostBuyPrice+914.5, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+914.5
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+914.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+914.5
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+914.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+914.5
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+914.5
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+914.5;
UPDATE storedetail SET  productquantity = '870', userid = '1', storedetaildate = '2026-10-05 17:33:33' WHERE storedetailid = '43';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('43', '1', '31', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '839', '870', '1', '2026-10-05 17:33:33','0','0'); -- id=3719
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('29.50', '00042', '14', '1', '42', '8', '30.75', '246', '0', '', '1', '0', '42', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','30.75','246','0','','0'); -- id=71
UPDATE returnsellbilldetail SET  lastbuyprice = 29.50 , meanbuyprice = 29.50, lastbuyprice_withDiscount = 29.50, meanbuyprice_withDiscount = 29.50
        , lastbuyprice_withTax = 29.5, meanbuyprice_withTax = 29.5, lastbuyprice_withDiscountAndTax = 29.5
                where returnsellbilldetailid = 71;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (42, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 246, 236, 236, 236
                    , 236, 236, 236, 0, 8, 0, 0, 236, 236)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+246, returnSellCostBuyPrice = returnSellCostBuyPrice+236, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+236
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+236, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+236
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+236
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+236
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+236
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+236
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+8;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 246, 236, 236, 236
                    , 236, 236, 236, 0, 0, 236, 236)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+246, returnSellCostBuyPrice = returnSellCostBuyPrice+236, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+236
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+236, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+236
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+236
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+236
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+236
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+236;
UPDATE storedetail SET  productquantity = '908', userid = '1', storedetaildate = '2026-10-05 17:33:33' WHERE storedetailid = '42';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('42', '1', '8', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '900', '908', '1', '2026-10-05 17:33:33','0','0'); -- id=3720
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('36.95', '00051', '14', '1', '51', '1', '38.7', '38.7', '0', '', '1', '0', '51', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','38.7','38.7','0','','0'); -- id=72
UPDATE returnsellbilldetail SET  lastbuyprice = 36.95 , meanbuyprice = 36.95, lastbuyprice_withDiscount = 36.95, meanbuyprice_withDiscount = 36.95
        , lastbuyprice_withTax = 36.95, meanbuyprice_withTax = 36.95, lastbuyprice_withDiscountAndTax = 36.95
                where returnsellbilldetailid = 72;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (51, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 38.7, 36.95, 36.95, 36.95
                    , 36.95, 36.95, 36.95, 0, 1, 0, 0, 36.95, 36.95)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+38.7, returnSellCostBuyPrice = returnSellCostBuyPrice+36.95, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+36.95
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+36.95, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+36.95
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+36.95
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+36.95
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+36.95
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+36.95
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 38.7, 36.95, 36.95, 36.95
                    , 36.95, 36.95, 36.95, 0, 0, 36.95, 36.95)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+38.7, returnSellCostBuyPrice = returnSellCostBuyPrice+36.95, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+36.95
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+36.95, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+36.95
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+36.95
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+36.95
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+36.95
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+36.95;
UPDATE storedetail SET  productquantity = '157', userid = '1', storedetaildate = '2026-10-05 17:33:33' WHERE storedetailid = '51';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('51', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '156', '157', '1', '2026-10-05 17:33:33','0','0'); -- id=3721
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('10.55', '00360', '14', '1', '360', '4', '10.95', '43.8', '0', '', '1', '0', '360', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','10.95','43.8','0','','0'); -- id=73
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 73;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (360, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 43.8, 42.2, 42.2, 42.2
                    , 42.2, 42.2, 42.2, 0, 4, 0, 0, 42.2, 42.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+43.8, returnSellCostBuyPrice = returnSellCostBuyPrice+42.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+42.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+42.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+42.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+42.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+42.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+42.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+42.2
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+4;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 43.8, 42.2, 42.2, 42.2
                    , 42.2, 42.2, 42.2, 0, 0, 42.2, 42.2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+43.8, returnSellCostBuyPrice = returnSellCostBuyPrice+42.2, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+42.2
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+42.2, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+42.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+42.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+42.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+42.2
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+42.2;
UPDATE storedetail SET  productquantity = '593', userid = '1', storedetaildate = '2026-10-05 17:33:34' WHERE storedetailid = '360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('360', '1', '4', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '589', '593', '1', '2026-10-05 17:33:34','0','0'); -- id=3722
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('34.80', '00356', '14', '1', '356', '2', '36', '72', '0', '', '1', '0', '356', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','36','72','0','','0'); -- id=74
UPDATE returnsellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where returnsellbilldetailid = 74;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (356, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 72, 69.6, 69.6, 69.6
                    , 69.6, 69.6, 69.6, 0, 2, 0, 0, 69.6, 69.6)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+72, returnSellCostBuyPrice = returnSellCostBuyPrice+69.6, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+69.6
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+69.6, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+69.6
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+69.6
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+69.6
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+69.6
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+69.6
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+2;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 72, 69.6, 69.6, 69.6
                    , 69.6, 69.6, 69.6, 0, 0, 69.6, 69.6)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+72, returnSellCostBuyPrice = returnSellCostBuyPrice+69.6, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+69.6
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+69.6, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+69.6
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+69.6
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+69.6
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+69.6
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+69.6;
UPDATE storedetail SET  productquantity = '311', userid = '1', storedetaildate = '2026-10-05 17:33:34' WHERE storedetailid = '356';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('356', '1', '2', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '309', '311', '1', '2026-10-05 17:33:34','0','0'); -- id=3723
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('34.80', '00357', '14', '1', '357', '3', '36', '108', '0', '', '1', '0', '357', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','36','108','0','','0'); -- id=75
UPDATE returnsellbilldetail SET  lastbuyprice = 34.80 , meanbuyprice = 34.80, lastbuyprice_withDiscount = 34.80, meanbuyprice_withDiscount = 34.80
        , lastbuyprice_withTax = 34.8, meanbuyprice_withTax = 34.8, lastbuyprice_withDiscountAndTax = 34.8
                where returnsellbilldetailid = 75;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (357, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 108, 104.4, 104.4, 104.4
                    , 104.4, 104.4, 104.4, 0, 3, 0, 0, 104.4, 104.4)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+108, returnSellCostBuyPrice = returnSellCostBuyPrice+104.4, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+104.4
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+104.4, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+104.4
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+104.4
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+104.4
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+104.4
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+104.4
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 108, 104.4, 104.4, 104.4
                    , 104.4, 104.4, 104.4, 0, 0, 104.4, 104.4)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+108, returnSellCostBuyPrice = returnSellCostBuyPrice+104.4, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+104.4
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+104.4, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+104.4
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+104.4
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+104.4
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+104.4
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+104.4;
UPDATE storedetail SET  productquantity = '334', userid = '1', storedetaildate = '2026-10-05 17:33:34' WHERE storedetailid = '357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('357', '1', '3', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '331', '334', '1', '2026-10-05 17:33:34','0','0'); -- id=3724
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('84.46', '00365', '14', '1', '365', '1', '87', '87', '0', '', '1', '0', '365', '0.00', '-1','1','0','','','0','0','0','0','0','1','1','1','','0','0','87','87','0','','0'); -- id=76
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 76;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (365, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 87, 84.46, 84.46, 84.46
                    , 84.46, 84.46, 84.46, 0, 1, 0, 0, 84.46, 84.46)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+87, returnSellCostBuyPrice = returnSellCostBuyPrice+84.46, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+84.46
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+84.46, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+84.46
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+84.46
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+84.46
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+84.46
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+84.46
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 87, 84.46, 84.46, 84.46
                    , 84.46, 84.46, 84.46, 0, 0, 84.46, 84.46)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+87, returnSellCostBuyPrice = returnSellCostBuyPrice+84.46, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+84.46
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+84.46, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+84.46
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+84.46
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+84.46
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+84.46
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+84.46;
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2026-10-05 17:33:35' WHERE storedetailid = '365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('365', '1', '1', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '36', '37', '1', '2026-10-05 17:33:35','0','0'); -- id=3725
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3971.6', '3971.6', '2026-10-05', '1', '0', '0', '2026-10-05 17:33:35','اضافة فاتورة مردود مبيعات رقم 14','1','0',null,'0','14','returnsellbillController.php?do=showDetail&returnsellbillid=14'); -- id=1356
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1356', '143', '3971.6', '','0'); -- id=1362
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '1001471.41', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1356', '473', '3971.6', '','0'); -- id=1358
UPDATE accountstree SET name = 'احمد سعد', customName = 'احمد سعد', customNameEn = 'احمد سعد', nameEn = 'احمد سعد', parent = '58', accountNature = '0', theValue = '3814.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-28 20:32:28' WHERE id = '473';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3600.07', '3600.07', '2026-10-05', '1', '0', '0', '2026-10-05 17:33:35','اضافة فاتورة مردود مبيعات رقم 14 - صرف البضاعة من المخزن','1','0',null,'0','14','returnsellbillController.php?do=showDetail&returnsellbillid=14'); -- id=1357
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1357', '382', '3600.07', '','0'); -- id=1363
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2438730.84', 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 ('1357', '402', '3600.07', '','0'); -- id=1359
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '908433.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
update returnsellbill set dailyentryid='1356,0,1357' where returnsellbillid=14;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3971.6, 3600.07, 3600.07, 3598.07
                    , 3600.07, 3598.07, 3600.07 ,0, 0, 3600.07, 3598.07)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+3971.6, returnSellCostBuyPrice = returnSellCostBuyPrice+3600.07, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3600.07
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3598.07, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3600.07
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3598.07
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3600.07
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3600.07
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3598.07;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (41, '2026-10-05', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3971.6, 3600.07, 3600.07, 3598.07
                    , 3600.07, 3598.07, 3600.07 ,0, 0, 3600.07, 3598.07)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+3971.6, returnSellCostBuyPrice = returnSellCostBuyPrice+3600.07, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3600.07
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3598.07, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3600.07
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3598.07
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+3600.07
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+3600.07
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+3598.07;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -3971.6, -3600.07, -3600.07
                    , -3598.07, -3600.07, -3598.07, -3600.07, -3600.07, -3598.07)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-3971.6, netSellCostBuyPrice = netSellCostBuyPrice+-3600.07
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-3600.07
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-3598.07
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-3600.07
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-3598.07
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-3600.07
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-3600.07
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-3598.07;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ac3c242bdf1b and sellbillId = 14 and returnsellbillId = 14
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 14:03:37";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:33:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 17:33:38', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=3575
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 14:04:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 17:34:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 17:34:09', '1', 'showDetail', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=showDetail&sellbillid=227'); -- id=3576
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 16:10:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 19:40:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-05 19:40:51', '1', 'addsellBill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=3577
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:54:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:24:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 21:24:50', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php'); -- id=3578
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:54:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:24:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 21:24:51', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3579
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:54:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:24:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 21:24:58', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3580
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:55:17";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:25:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:25:17', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3581
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:55:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:25:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:25:34', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3582

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =380
-- ----------------------------------------------------------------------------------------------------

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

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:55:36";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:25:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:25:36', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3583
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:55:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:25:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:25:38', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3584
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:55:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:25:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:25:48', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3585
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:05";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:05', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3586

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =381
-- ----------------------------------------------------------------------------------------------------

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

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:07";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:07', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3587
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:09', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3588
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:11";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-05 21:26:11', '1', 'showallajax', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientdebt.php?do=showallajax'); -- id=3589
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:25', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3590
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:38";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:38', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3591

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =382
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(34,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0' , clientdate = '2026-10-05 21:26:38', userid = '1' WHERE clientid = '34';
UPDATE client SET  inUse = 0 where clientid = 34;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('34','4517.50','4517.5','1','ايصال تحصيل (( قبض من عميل ))','382', '0', '2026-10-05 21:26:26', '1', 'clientPayedDeptController.php', '   ', '4517.5', '0', null, '0', null, null,'', '-1','1','1','4517.5','1','','34','0','','.'); -- id=382
UPDATE save SET  savecurrentvalue = '-873872.16',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-878389.66','4517.5', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '382', '-873872.16', '2026-10-05 21:26:39', '1',  'clientPayedDeptController.php','34','','0'); -- id=232
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4517.5', '4517.5', '2026-10-05', '1', '0', '0', '2026-10-05 21:26:39','اضافة ايصال سداد للعميل محمود شلبي','1','0','0','0','382','clientPayedDeptController.php?do=show&id=382'); -- id=1360
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1360', '383', '4517.5', '','0'); -- id=1366
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-129659.11', 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 ('1360', '465', '4517.5', '','0'); -- id=1362
UPDATE accountstree SET name = 'محمود شلبي', customName = 'محمود شلبي', customNameEn = 'محمود شلبي', nameEn = 'محمود شلبي', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-23 12:12:39' WHERE id = '465';
UPDATE clientdebtchange SET clientid = '34', clientdebtchangebefore = '4517.500', clientdebtchangeamount = '4517.500', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '382', clientdebtchangeafter = '0.000', clientdebtchangedate = '2026-10-05 21:26:26', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '4517.500',discount='', reciptid='0', dailyentryid = '1360',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='4517.5',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '382';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:40";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:40', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3592
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:41";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:26:42', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3593
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:56:47";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:26:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:26:47', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=3594
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:57:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:27:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 21:27:51', '1', 'bill', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=3595
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:58:48";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:28:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 21:28:48', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=add'); -- id=3596
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 ('06ac3fa37e94a8', '2026-10-05 21:27:51', '5', '36706.00', '42706', '0', '0', '6000.00',  '6000.00', '0', '6000', '1', '2026-10-05 21:28:48', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=44
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 ('00029', '44', '8', '29', '30', '200', '6000.00', '0', '', '2026-10-05 21:28:48', '29','','','0','0','0','0','0',null,'200','6000','0','0','0','0','0','0','0','0','1'); -- id=167
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-05 21:27:51', 1, 29, 0, 0
                    , 200, 30, 0, 0, 1, '2026-10-05 21:28:49')
                ON DUPLICATE KEY UPDATE buyprice = 200,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-05 21:28:49' ; -- id=167
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('29', '200', '30', '0', 'buyBillController.php', '167', '', '0', '0'); -- id=167
UPDATE product SET  productBuyPrice = "200" WHERE productId = 29 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 167 ;
UPDATE product SET productName = 'قطعه بروفايل24 وات 60 سنتي ', productDescription = '', productCatId = '8', productBuyPrice = '200.00', productSellAllPrice = '220.00', productSellUnitPrice = '245.00', productSellHalfPrice = '230.00', productDate = '2026-09-13', conditions = '0', userId = '1', limitamount = '5', parcode = '00029',type ='0', expireDate = '0' , dailyentryId = '34',isService = '0',isOptic = '0',lastbuyprice = '200',lastbuyprice_withDiscount = '200',meanbuyprice = '200',meanbuyprice_withDiscount = '200' , productbuypricereal = '200.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.00' , buyhalf_precentage = '15.00' , buypart_precentage = '22.50',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='200',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='200',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='200',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '29';
UPDATE buybilldetail SET  lastbuyprice = 200 , meanbuyprice = 200, lastbuyprice_withDiscount = 200, meanbuyprice_withDiscount = 200
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where buybilldetailid = 167;
UPDATE productunit SET proUnitBuyPrice  = 200 * productnumber WHERE productid = 29;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-05' WHERE storedetailid = '29';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('29', '1', '30', '0', '44', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-05 21:27:51','0','0'); -- id=3726
UPDATE supplier SET  suppliercurrentDebt = '42706',suppliercurrentDebtInCurrency= '42706' , userid = '1', supplierdate = '2026-10-05 21:28:48'   WHERE supplierid = '5';
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 ('5', '36706.00', '6000', '0', 'اضافة فاتورة مشتريات', '44', '42706', '2026-10-05 21:27:51', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','6000','1','36706','6000','42706','0',''); -- id=77
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6000', '6000', '2026-10-05', '1', '0', '0', '2026-10-05 21:28:50','اضافة فاتورة مشتريات رقم 44','1','0',null,'0','44','buyBillController.php?do=details&id=44'); -- id=1361
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1361', '382', '6000', '','0'); -- id=1367
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '2444730.84', 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 ('1361', '423', '6000', '','0'); -- id=1363
UPDATE accountstree SET name = 'العيسوي حساب نشات', customName = 'العيسوي حساب نشات', customNameEn = 'العيسوي حساب نشات', nameEn = 'العيسوي حساب نشات', parent = '81', accountNature = '1', theValue = '42706', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 16:03:09' WHERE id = '423';
update buybill set dailyentryid='1361,0' where buybillid=44;
COMMIT;
UPDATE product SET overAllAveragePrice = 200 WHERE productId = 29;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:58:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:28:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-05 21:28:51', '1', 'editprint', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/buyBillController.php?do=editprint&id=44'); -- id=3597
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:58:58";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:28:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:28:58', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=3598
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:59:50";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:29:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:29:50', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=3599
BEGIN;
CALL supplierInUse(5,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('5', '42706.00', '9671', '1', 'ايصال دفع لمورد', '1', '33035', '2026-10-05 21:28:58', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','9671','1','0','0','0','19',''); -- id=78
UPDATE supplierdebtchange SET supplierid = '5', supplierdebtchangebefore = '42706.00', supplierdebtchangeamount = '9671', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '33035', supplierdebtchangedate = '2026-10-05 21:28:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='9671',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='42706',debtchangamountInSupplierCurrency='9671',debtchangafterInSupplierCurrency='33035', paySerialNo='19',tagids='' WHERE supplierdebtchangeid = '78';
UPDATE supplier SET  suppliercurrentDebt = '33035',suppliercurrentDebtInCurrency= '33035' , userid = '1', supplierdate = '2026-10-05 21:29:50'   WHERE supplierid = '5';
UPDATE supplier SET  inUse = 0 where supplierid = 5;
UPDATE save SET  savecurrentvalue = '-883543.16',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-873872.16','9671', '1', '1', 'ايصال دفع لمورد', '78', '-883543.16', '2026-10-05 21:29:51', '1',  'supplierPayedDeptController.php','0','','0'); -- id=233
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9671', '9671', '2026-10-05', '1', '0', '0', '2026-10-05 21:29:51','ايصال دفع لمورد ( العيسوي حساب نشات ) ','1','0','0','0','78','supplierReportsController.php?do=show&id=78'); -- id=1362
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1362', '423', '9671', '','0'); -- id=1368
UPDATE accountstree SET name = 'العيسوي حساب نشات', customName = 'العيسوي حساب نشات', customNameEn = 'العيسوي حساب نشات', nameEn = 'العيسوي حساب نشات', parent = '81', accountNature = '1', theValue = '33035', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-13 16:03:09' WHERE id = '423';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1362', '383', '9671', '','0'); -- id=1364
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-139330.11', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '5', supplierdebtchangebefore = '42706.00', supplierdebtchangeamount = '9671.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '33035.00', supplierdebtchangedate = '2026-10-05 21:28:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '1362',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='9671',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='42706',debtchangamountInSupplierCurrency='9671',debtchangafterInSupplierCurrency='33035', paySerialNo='19',tagids='' WHERE supplierdebtchangeid = '78';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:59:51";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:29:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:29:52', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=3600
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:59:53";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:29:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:29:54', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=3601
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 17:59:54";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:29:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-05 21:29:54', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=3602
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:11:09";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:41:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:41:09', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php'); -- id=3603
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:11:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:41:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:41:23', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=add'); -- id=3604

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =383
-- ----------------------------------------------------------------------------------------------------

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

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:11:25";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:41:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:41:25', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=3605
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:11:27";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:41:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-05 21:41:27', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/clientPayedDeptController.php?do=show'); -- id=3606
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:20:23";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:50:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:50:23', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php'); -- id=3607
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:22:30";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:52:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:52:30', '1', 'add', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=3608
BEGIN;
CALL supplierInUse(9,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('9', '165188.60', '4236', '1', 'ايصال دفع لمورد', '1', '160952.6', '2026-10-05 21:50:24', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','4236','1','0','0','0','20',''); -- id=79
UPDATE supplierdebtchange SET supplierid = '9', supplierdebtchangebefore = '165188.60', supplierdebtchangeamount = '4236', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '160952.6', supplierdebtchangedate = '2026-10-05 21:50:24', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='4236',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='165188.6',debtchangamountInSupplierCurrency='4236',debtchangafterInSupplierCurrency='160952.6', paySerialNo='20',tagids='' WHERE supplierdebtchangeid = '79';
UPDATE supplier SET  suppliercurrentDebt = '160952.6',suppliercurrentDebtInCurrency= '160952.6' , userid = '1', supplierdate = '2026-10-05 21:52:31'   WHERE supplierid = '9';
UPDATE supplier SET  inUse = 0 where supplierid = 9;
UPDATE save SET  savecurrentvalue = '-887178.36',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-882942.36','4236', '1', '1', 'ايصال دفع لمورد', '79', '-887178.36', '2026-10-05 21:52:31', '1',  'supplierPayedDeptController.php','0','','0'); -- id=235
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4236', '4236', '2026-10-05', '1', '0', '0', '2026-10-05 21:52:31','ايصال دفع لمورد ( شركه باندا حساب نشات  ) ','1','0','0','0','79','supplierReportsController.php?do=show&id=79'); -- id=1364
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1364', '432', '4236', '','0'); -- id=1370
UPDATE accountstree SET name = 'شركه باندا حساب نشات ', customName = 'شركه باندا حساب نشات ', customNameEn = 'شركه باندا حساب نشات ', nameEn = 'شركه باندا حساب نشات ', parent = '81', accountNature = '1', theValue = '160952.6', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-15 22:21:02' WHERE id = '432';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1364', '383', '4236', '','0'); -- id=1366
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-142965.31', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '9', supplierdebtchangebefore = '165188.60', supplierdebtchangeamount = '4236.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '160952.60', supplierdebtchangedate = '2026-10-05 21:50:24', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '1364',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='4236',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='165188.6',debtchangamountInSupplierCurrency='4236',debtchangafterInSupplierCurrency='160952.6', paySerialNo='20',tagids='' WHERE supplierdebtchangeid = '79';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:22:32";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:52:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:52:32', '1', 'sucess', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=3609
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:22:34";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:52:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-05 21:52:34', '1', 'show', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=3610
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-05 18:22:35";
UPDATE user SET loginip = "::1", lastactivetime = "2026-10-05 21:52:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-05 21:52:35', '1', '', '::1', 'DC:4A:3E:84:BB:DA', 'DESKTOP','https://localhost:8080/erp/controllers/supplierReportsController.php'); -- id=3611
