-- ALTER TABLE erp1.accountmovement AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.accountmovementkind AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.accountstree AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.accountstreefromprog AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.accountstreesetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.ads AUTO_INCREMENT = ;
-- ALTER TABLE erp1.area AUTO_INCREMENT = ;
-- ALTER TABLE erp1.assets AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.assetscat AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.assetssale AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.availableparcode AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bank AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bankaccount AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.beneficiaries AUTO_INCREMENT = ;
-- ALTER TABLE erp1.beneficiaries_eco AUTO_INCREMENT = ;
-- ALTER TABLE erp1.beneficiaries_family AUTO_INCREMENT = ;
-- ALTER TABLE erp1.billname AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billoperation AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billprint AUTO_INCREMENT = ;
-- ALTER TABLE erp1.billprinter AUTO_INCREMENT = ;
-- ALTER TABLE erp1.billproperty AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bills AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsbuy AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsettings AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsproducts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsproductsbuy AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsreturn AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsreturnproducts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billtemplate AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billtemplatedetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bind AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bindsettlement AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.boarding AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.branch AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buyandruternbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buyandruternbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buyandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybilldetailoffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybilloffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buypriceshistorybook AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.capital AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.carfile AUTO_INCREMENT = ;
-- ALTER TABLE erp1.carreview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.carreviewer AUTO_INCREMENT = ;
-- ALTER TABLE erp1.cars AUTO_INCREMENT = ;
-- ALTER TABLE erp1.cartracking AUTO_INCREMENT = ;
-- ALTER TABLE erp1.cashtransfer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.charities AUTO_INCREMENT = ;
-- ALTER TABLE erp1.charitiescenter AUTO_INCREMENT = ;
-- ALTER TABLE erp1.charitysearchlog AUTO_INCREMENT = ;
-- ALTER TABLE erp1.checkcontroller AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.checkdeposit AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.checkwithdrawal AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claimdebts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claimreturnsellbills AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claims AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claimsclientbills AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claimsellbills AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.claimstypeclients AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.client AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clientarea AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clientdebtchange AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clientpaymentreceiptt AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clientproductreview AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clinic AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.collectedparcodestemp AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.commentclient AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.costcenter AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.costcenterdetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.country AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.coupons AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.currency AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.dailyentry AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.dailyentrycreditor AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.dailyentrydebtor AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.damagedproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.datedchecked AUTO_INCREMENT = ;
-- ALTER TABLE erp1.discountcontrol AUTO_INCREMENT = ;
-- ALTER TABLE erp1.disease AUTO_INCREMENT = ;
-- ALTER TABLE erp1.doctorkashf AUTO_INCREMENT = ;
-- ALTER TABLE erp1.dollarearnings AUTO_INCREMENT = ;
-- ALTER TABLE erp1.ebillsetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.eclientsetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employee AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeattendance AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeattendancesystem AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeclosedaygroupstatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeclosedayhistory AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeclosedaystatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeeclosedaysubgroupstatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeedoctor AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeedoctordebtandpay AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeedoctordebtchange AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeegroup AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeepersonnel AUTO_INCREMENT = ;
-- ALTER TABLE erp1.employeesubgroup AUTO_INCREMENT = ;
-- ALTER TABLE erp1.entryproductspurchased AUTO_INCREMENT = ;
-- ALTER TABLE erp1.expenseexchange AUTO_INCREMENT = ;
-- ALTER TABLE erp1.expenses AUTO_INCREMENT = ;
-- ALTER TABLE erp1.expensestype AUTO_INCREMENT = ;
-- ALTER TABLE erp1.faida AUTO_INCREMENT = ;
-- ALTER TABLE erp1.faidadirector AUTO_INCREMENT = ;
-- ALTER TABLE erp1.faidaproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.goverarea AUTO_INCREMENT = ;
-- ALTER TABLE erp1.government AUTO_INCREMENT = ;
-- ALTER TABLE erp1.importcontract AUTO_INCREMENT = ;
-- ALTER TABLE erp1.impotencetreatmentsuppliersave AUTO_INCREMENT = ;
-- ALTER TABLE erp1.income AUTO_INCREMENT = ;
-- ALTER TABLE erp1.incometype AUTO_INCREMENT = ;
-- ALTER TABLE erp1.insurancecompanies AUTO_INCREMENT = ;
-- ALTER TABLE erp1.kashf AUTO_INCREMENT = ;
-- ALTER TABLE erp1.kempiala AUTO_INCREMENT = ;
-- ALTER TABLE erp1.knownways AUTO_INCREMENT = ;
-- ALTER TABLE erp1.languages AUTO_INCREMENT = ;
-- ALTER TABLE erp1.lastbillidspricesupdated AUTO_INCREMENT = ;
-- ALTER TABLE erp1.lastbillidsquickprofit AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_check AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_comreceipt AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_comreceiptdetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_comreceiptimage AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_externalmaintenance AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_finishingpayed AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_handedreport AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_initialmaintenance AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_initialmaintenancedetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_insurance AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_maintenancereceipt AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_maintenancereceiptfinish AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_producthistory AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_stage AUTO_INCREMENT = ;
-- ALTER TABLE erp1.m_stageproperity AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maccontrol AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenancecases AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.maintenancecenters AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenancecomments AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenancecompanies AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenancepolicys AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenanceprocedures AUTO_INCREMENT = ;
-- ALTER TABLE erp1.maintenances AUTO_INCREMENT = ;
-- ALTER TABLE erp1.manufacuresetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.menuurl AUTO_INCREMENT = ;
-- ALTER TABLE erp1.movementmanage AUTO_INCREMENT = ;
-- ALTER TABLE erp1.movementmanagedeleted AUTO_INCREMENT = ;
-- ALTER TABLE erp1.newdbbackup AUTO_INCREMENT = ;
-- ALTER TABLE erp1.newdbname AUTO_INCREMENT = ;
-- ALTER TABLE erp1.notics AUTO_INCREMENT = ;
-- ALTER TABLE erp1.offerpricebill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.offerpricebillprop AUTO_INCREMENT = ;
-- ALTER TABLE erp1.offerpricecondition AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinecat AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlineproductcat AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinestoresetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetempcategory AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetemporder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetemporderclient AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetemporderproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetempproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetempstoredetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.onlinetempstorereport AUTO_INCREMENT = ;
-- ALTER TABLE erp1.otherrequest AUTO_INCREMENT = ;
-- ALTER TABLE erp1.otherstoremovement AUTO_INCREMENT = ;
-- ALTER TABLE erp1.pages AUTO_INCREMENT = ;
-- ALTER TABLE erp1.partner AUTO_INCREMENT = ;
-- ALTER TABLE erp1.partnertransferbetween AUTO_INCREMENT = ;
-- ALTER TABLE erp1.partnerwithdrawal AUTO_INCREMENT = ;
-- ALTER TABLE erp1.paymentnetworks AUTO_INCREMENT = ;
-- ALTER TABLE erp1.playstationcard AUTO_INCREMENT = ;
-- ALTER TABLE erp1.playstationclientcard AUTO_INCREMENT = ;
-- ALTER TABLE erp1.playstationclientcardpayhistory AUTO_INCREMENT = ;
-- ALTER TABLE erp1.policy AUTO_INCREMENT = ;
-- ALTER TABLE erp1.premium AUTO_INCREMENT = ;
-- ALTER TABLE erp1.premiumautomatic AUTO_INCREMENT = ;
-- ALTER TABLE erp1.premiumclient AUTO_INCREMENT = ;
-- ALTER TABLE erp1.premiuminstallments AUTO_INCREMENT = ;
-- ALTER TABLE erp1.product AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productcat AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productcatunit AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productingredients AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionexecution AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionexecutionoutput AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionexecutionproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionexecutionwaste AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionorder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionout AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionoutdetails AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionoutmany AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionoutmanyinproducts AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionoutmanyoutproducts AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionrate AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productionrateproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productrecieve AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productrequests AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productserial AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productsetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.producttemp AUTO_INCREMENT = ;
-- ALTER TABLE erp1.producttempunit AUTO_INCREMENT = ;
-- ALTER TABLE erp1.productunit AUTO_INCREMENT = ;
-- ALTER TABLE erp1.programsettings AUTO_INCREMENT = ;
-- ALTER TABLE erp1.project AUTO_INCREMENT = ;
-- ALTER TABLE erp1.projectexchmaterial AUTO_INCREMENT = ;
-- ALTER TABLE erp1.projectexchmaterialdetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.projectexchmaterialdetailreturn AUTO_INCREMENT = ;
-- ALTER TABLE erp1.projectexchmaterialreturn AUTO_INCREMENT = ;
-- ALTER TABLE erp1.projectkind AUTO_INCREMENT = ;
-- ALTER TABLE erp1.properties AUTO_INCREMENT = ;
-- ALTER TABLE erp1.qrerpuserpass AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.quickprofitclient AUTO_INCREMENT = ;
-- ALTER TABLE erp1.quickprofitday AUTO_INCREMENT = ;
-- ALTER TABLE erp1.quickprofitgeneral AUTO_INCREMENT = ;
-- ALTER TABLE erp1.quickprofitproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.quickprofitstore AUTO_INCREMENT = ;
-- ALTER TABLE erp1.religions AUTO_INCREMENT = ;
-- ALTER TABLE erp1.relusergroupproperties AUTO_INCREMENT = ;
-- ALTER TABLE erp1.rentbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.rentbillprop AUTO_INCREMENT = ;
-- ALTER TABLE erp1.rentproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.rentstore AUTO_INCREMENT = ;
-- ALTER TABLE erp1.representativecompany AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restauranthall AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantkitchenprint AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantorder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantorderdeliverydetails AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantorderdetails AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantplaystation AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantplaystationplay AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantprinter AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restaurantrawdestruction AUTO_INCREMENT = ;
-- ALTER TABLE erp1.restauranttable AUTO_INCREMENT = ;
-- ALTER TABLE erp1.resturantcategory AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnbuybill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnbuybillcurr AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnbuybilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnsellbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnsellbillcurr AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnsellbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.returnsellbillreview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.richproperity AUTO_INCREMENT = ;
-- ALTER TABLE erp1.salaryreport AUTO_INCREMENT = ;
-- ALTER TABLE erp1.saudielectronicinvoice AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.save AUTO_INCREMENT = ;
-- ALTER TABLE erp1.saveclose AUTO_INCREMENT = ;
-- ALTER TABLE erp1.savedaily AUTO_INCREMENT = ;
-- ALTER TABLE erp1.savestock AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.savetype AUTO_INCREMENT = ;
-- ALTER TABLE erp1.searchfilters AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellandruternbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillandreturnreview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillandrutern AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillandruterncurr AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillcurr AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbilldetailoffer AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbilldetailorder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbilldetailtax AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillimage AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbilloffer AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillorder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillpayed AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillreview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillstatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sellbillview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.settingoperation AUTO_INCREMENT = ;
-- ALTER TABLE erp1.shippercompanies AUTO_INCREMENT = ;
-- ALTER TABLE erp1.shippingfile AUTO_INCREMENT = ;
-- ALTER TABLE erp1.simplemanufacturesetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sizecolor AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sizecolorstoredetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sliders AUTO_INCREMENT = ;
-- ALTER TABLE erp1.soldserialproduct AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sparepart AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sparepartstore AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sparepartstoredetails AUTO_INCREMENT = ;
-- ALTER TABLE erp1.sparepartstorereport AUTO_INCREMENT = ;
-- ALTER TABLE erp1.stage AUTO_INCREMENT = ;
-- ALTER TABLE erp1.stagestep AUTO_INCREMENT = ;
-- ALTER TABLE erp1.stock_import_logs AUTO_INCREMENT = ;
-- ALTER TABLE erp1.store AUTO_INCREMENT = ;
-- ALTER TABLE erp1.storedetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.storemovement AUTO_INCREMENT = ;
-- ALTER TABLE erp1.storemovement_main AUTO_INCREMENT = ;
-- ALTER TABLE erp1.storereport AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentabsences AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentaddsubjectdetails AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentaddsubjects AUTO_INCREMENT = ;
-- ALTER TABLE erp1.students AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsetting AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsexams AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsexamsval AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentspaymentsystems AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentspays AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsubjectgroupdays AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsubjectgroups AUTO_INCREMENT = ;
-- ALTER TABLE erp1.studentsubjects AUTO_INCREMENT = ;
-- ALTER TABLE erp1.subvention AUTO_INCREMENT = ;
-- ALTER TABLE erp1.subventionpay AUTO_INCREMENT = ;
-- ALTER TABLE erp1.suppay AUTO_INCREMENT = ;
-- ALTER TABLE erp1.supplier AUTO_INCREMENT = ;
-- ALTER TABLE erp1.supplierdebtchange AUTO_INCREMENT = ;
-- ALTER TABLE erp1.supplieropen AUTO_INCREMENT = ;
-- ALTER TABLE erp1.supplieropendebtchange AUTO_INCREMENT = ;
-- ALTER TABLE erp1.supplieropenexchangeorclosing AUTO_INCREMENT = ;
-- ALTER TABLE erp1.tamweenbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.tamweenclientdetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.tamweenda3mstatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.tamweenremainstatus AUTO_INCREMENT = ;
-- ALTER TABLE erp1.taskorder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.taskorderproducts AUTO_INCREMENT = ;
-- ALTER TABLE erp1.taskscases AUTO_INCREMENT = 6;
-- ALTER TABLE erp1.temreturnsellbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.temreturnsellbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.temsellandruternbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.temsellbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.temsellbillandrutern AUTO_INCREMENT = ;
-- ALTER TABLE erp1.temsellbilldetail AUTO_INCREMENT = ;
-- ALTER TABLE erp1.toworkshoporder AUTO_INCREMENT = ;
-- ALTER TABLE erp1.toworkshoporderbill AUTO_INCREMENT = ;
-- ALTER TABLE erp1.transferbtweenbankaccount AUTO_INCREMENT = ;
-- ALTER TABLE erp1.transferclientaccounts AUTO_INCREMENT = ;
-- ALTER TABLE erp1.transfermoney AUTO_INCREMENT = ;
-- ALTER TABLE erp1.typeclient AUTO_INCREMENT = ;
-- ALTER TABLE erp1.typesimpotencetreatment AUTO_INCREMENT = ;
-- ALTER TABLE erp1.typesupplier AUTO_INCREMENT = ;
-- ALTER TABLE erp1.unit AUTO_INCREMENT = ;
-- ALTER TABLE erp1.user AUTO_INCREMENT = ;
-- ALTER TABLE erp1.usergroup AUTO_INCREMENT = ;
-- ALTER TABLE erp1.usergroupadmin AUTO_INCREMENT = ;
-- ALTER TABLE erp1.vatpayment AUTO_INCREMENT = ;
-- ALTER TABLE erp1.wishlist AUTO_INCREMENT = ;
-- ALTER TABLE erp1.workshop AUTO_INCREMENT = ;
-- ALTER TABLE erp1.workstation AUTO_INCREMENT = ;
-- ALTER TABLE erp1.workstationassets AUTO_INCREMENT = ;
-- ALTER TABLE erp1.workstationworker AUTO_INCREMENT = ;
-- ALTER TABLE erp1.youtube_link AUTO_INCREMENT = ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:23', '1', 'edit', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=edit&id=2&parentid=0'); -- id=27
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:36', '1', 'update', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=update'); -- id=28
UPDATE productcat SET productCatName = 'new cat 1', productCatDate = '2025-12-09', productCatDescription = '', productCatParent = '0', userId = '1', conditions = '0', selldiscount = '0', buydiscount = '0', discounttype = '-1',isOptic = '0' , buytotal = '0' , buyhalf = '0' , buypart = '0' , buypricereal = '0', opticServices = '',logo = '.',inMenu='0',stopNegativeSale='0',price4='0',price5='0',price6='0',price7='0',price8='0',price9='0',price10='0',price11='0',price12='0',price13='0' WHERE productCatId = '2';
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (2, 1,'2025-12-09 01:28:37',1)
                ON DUPLICATE KEY UPDATE catid = 2, edited = 1, sysdate = '2025-12-09 01:28:37', userid = 1; -- id=1
DELETE FROM productcatunit WHERE productcatid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:37', '1', 'sucess', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=sucess'); -- id=29
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:38', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=show'); -- id=30
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:40', '1', 'edit', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=edit&id=1&parentid=0'); -- id=31
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:49', '1', 'update', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=update'); -- id=32
UPDATE productcat SET productCatName = 'cat1', productCatDate = '2025-12-09', productCatDescription = '', productCatParent = '0', userId = '1', conditions = '0', selldiscount = '0', buydiscount = '0', discounttype = '-1',isOptic = '0' , buytotal = '0' , buyhalf = '0' , buypart = '0' , buypricereal = '0', opticServices = '',logo = '.',inMenu='0',stopNegativeSale='0',price4='0',price5='0',price6='0',price7='0',price8='0',price9='0',price10='0',price11='0',price12='0',price13='0' WHERE productCatId = '1';
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (1, 1,'2025-12-09 01:28:50',1)
                ON DUPLICATE KEY UPDATE catid = 1, edited = 1, sysdate = '2025-12-09 01:28:50', userid = 1; -- id=3
DELETE FROM productcatunit WHERE productcatid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:50', '1', 'sucess', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=sucess'); -- id=33
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:28:51', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=show'); -- id=34
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:58:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:28:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:28:55', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=35
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 21:59:40";
UPDATE user SET loginip = "", lastactivetime = "2025-12-09 01:29:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('est_product_controller.php', '2025-12-09 01:29:40', '1', '', '', '', 'DESKTOP','https://'); -- id=36
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:02:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:32:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:32:52', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=37
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:02:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:32:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:32:54', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=38
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:03:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:33:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:33:01', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=show'); -- id=39
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:03:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:33:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:33:08', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=40
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:03:36";
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:07:02";
UPDATE user SET loginip = "", lastactivetime = "2025-12-09 01:37:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('ebug_product.php', '2025-12-09 01:37:02', '1', '', '', '', 'DESKTOP','https://'); -- id=41
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:07:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:37:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:37:44', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=42
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:07:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:37:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:37:49', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=43
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:05', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=44
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:10', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=45
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:11', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=46
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:38:17', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=47
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:38:19', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=48
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 01:38:20', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=49
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:38:23', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php'); -- id=50
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:27', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=51
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:35', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=52
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:42', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=53
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:08:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:38:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:38:46', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=54
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:09:01";
UPDATE user SET loginip = "", lastactivetime = "2025-12-09 01:39:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('ebug_product.php', '2025-12-09 01:39:01', '1', '', '', '', 'DESKTOP','https://'); -- id=55
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:10:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:40:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:40:08', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=56
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:10:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:40:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:40:23', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=57
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:12:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:42:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:42:23', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=58
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('prod1','','1','10','10','10','10','2025-12-09','0','1','0','','0','0','0','0','0','10','10','10','10','10','0','0','0','0','.','0','0','0','10','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','10','10','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','10','0','0','0','0','0','0','','','0','0','0','0'); -- id=1
UPDATE product SET productName = 'prod1', productDescription = '', productCatId = '1', productBuyPrice = '10', productSellAllPrice = '10', productSellUnitPrice = '10', productSellHalfPrice = '10', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00001',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '10',lastbuyprice_withDiscount = '10',meanbuyprice = '10',meanbuyprice_withDiscount = '10' , productbuypricereal = '10' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='10',meanbuyprice_withTax='10',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='10',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';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1', '1', '2025-12-09', '1', '0','0000101','10','10','10','10','','0','0','0','0','0','0','0','0','0','0'); -- id=1
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1', '1', '0', '1', '2025-12-09'); -- id=1
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '0', '0', '1', 'إضافة منتج', 'productController.php', '0', '0', '1', '2025-12-09','0','0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:12:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:42:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:42:31', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=59
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:12:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:42:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:42:34', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=60
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:12:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:42:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:42:38', '1', 'edit', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=edit&id=1'); -- id=61
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:12:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:42:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:42:59', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=62
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:13:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:43:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:43:09', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=63
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:13:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:43:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:43:30', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=64
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('prod2','','1','20','20','20','20','2025-12-09','0','1','0','','0','0','0','0','0','20','20','20','20','20','0','0','0','0','.','0','0','0','20','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','20','20','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','20','0','0','0','0','0','0','','','0','0','0','0'); -- id=2
UPDATE product SET productName = 'prod2', productDescription = '', productCatId = '1', productBuyPrice = '20', productSellAllPrice = '20', productSellUnitPrice = '20', productSellHalfPrice = '20', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '20',lastbuyprice_withDiscount = '20',meanbuyprice = '20',meanbuyprice_withDiscount = '20' , productbuypricereal = '20' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='20',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='20',meanbuyprice_withTax='20',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='20',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2', '1', '2025-12-09', '1', '0','0000201','20','20','20','20','','0','0','0','0','0','0','0','0','0','0'); -- id=2
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2', '1', '0', '1', '2025-12-09'); -- id=2
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2', '1', '0', '0', '2', 'إضافة منتج', 'productController.php', '0', '0', '1', '2025-12-09','0','0'); -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:13:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:43:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:43:55', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=65
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:14:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:44:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:44:19', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=66
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:14:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:44:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:44:37', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=67
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:14:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:44:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:44:55', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=68
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:15:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:45:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:45:01', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=69
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:15:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:45:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:45:20', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=70
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:15:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:45:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:45:37', '1', 'uinuseproducts', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=uinuseproducts'); -- id=71
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:15:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:45:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:45:46', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=72
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:16:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:46:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:46:00', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=73
UPDATE productunit SET proUnitSellHalfPrice = 10.00 * productnumber WHERE productid = 1;
UPDATE product SET productName = 'prod1', productDescription = '', productCatId = '1', productBuyPrice = '10.00', productSellAllPrice = '10.00', productSellUnitPrice = '10.00', productSellHalfPrice = '10.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00001',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '10.00',lastbuyprice_withDiscount = '10',meanbuyprice = '10.00',meanbuyprice_withDiscount = '10' , productbuypricereal = '10.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10',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',meanbuyprice_withTax='10',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='10',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';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1, 1,'2025-12-09 01:47:08',1)
                ON DUPLICATE KEY UPDATE productid = 1, edited = 1, sysdate = '2025-12-09 01:47:08', userid = 1; -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:17:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:47:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2025-12-09 01:47:09', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/clientPayedDeptController.php'); -- id=74
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:17:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:47:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:17:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:47:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:17:35";
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:17:45";
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 programsettings SET companyname = 'GT4', address = 'القاهرة - المقطم - شارع 9 ', specializtion = 'برمجيات - مواقع انترنت - تطبيقات موبايل', phone = '0111007088', faxnumber = '', email = 'mousa_maged@hotmail.com', website = '', logo = '3f52022081b9a1a89c6f3246463c2d62.jpg', 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` = '0', taxcard = '123456789123', commercialregistration = '1234', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2025-12-08',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='1',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='0',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='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='0',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:18:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:48:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 01:48:02', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=75
UPDATE programsettings SET companyname = 'GT4', address = 'القاهرة - المقطم - شارع 9 ', specializtion = 'برمجيات - مواقع انترنت - تطبيقات موبايل', phone = '0111007088', faxnumber = '', email = 'mousa_maged@hotmail.com', website = '', logo = '3f52022081b9a1a89c6f3246463c2d62.jpg', 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` = '0', taxcard = '123456789123', commercialregistration = '1234', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2025-12-09',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='1',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='0',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='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='0',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='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 < "2025-12-08 22:18:09";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 01:48:09', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=76
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:18:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:48:27", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 01:48:27', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/index.php'); -- id=77
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 < "2025-12-08 22:18:32";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 01:48:32', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=78
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:19:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:49:09", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2025-12-09 01:49:09', '1', 'oneSupplier', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/supplierReportsController.php?do=oneSupplier'); -- id=79
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:19:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:49:14", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 01:49:14', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=80
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:19:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:49:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:49:48', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=81
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:20:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:50:12', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=82
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('prod3','','1','30','30','30','30','2025-12-09','0','1','0','','0','0','0','0','0','30','30','30','30','30','0','0','0','0','.','0','0','0','30','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','30','30','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','30','0','0','0','0','0','0','','','0','0','0','0'); -- id=3
UPDATE product SET productName = 'prod3', productDescription = '', productCatId = '1', productBuyPrice = '30', productSellAllPrice = '30', productSellUnitPrice = '30', productSellHalfPrice = '30', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00003',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '30',lastbuyprice_withDiscount = '30',meanbuyprice = '30',meanbuyprice_withDiscount = '30' , productbuypricereal = '30' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='30',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='30',meanbuyprice_withTax='30',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='30',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';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '3', '1', '2025-12-09', '1', '0','0000301','30','30','30','30','','0','0','0','0','0','0','0','0','0','0'); -- id=3
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('3', '1', '0', '1', '2025-12-09'); -- id=3
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '0', '0', '3', 'إضافة منتج', 'productController.php', '0', '0', '1', '2025-12-09','0','0'); -- id=3
INSERT INTO onlinestoresetting (url, availableStores, onlinestoreid, onlineclientareaid, updatetype, catprohour, catprominute, proquantityhour, proquantityminute, clientshour, clientsminute, ordershour, ordersminute, clientdebtchangeStartId) VALUES ('', '', '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1'); -- id=1
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (3, 1,'2025-12-09 01:50:17',1)
                ON DUPLICATE KEY UPDATE productid = 3, edited = 1, sysdate = '2025-12-09 01:50:17', userid = 1; -- id=2
UPDATE product SET productName = 'prod3', productDescription = '', productCatId = '1', productBuyPrice = '30.00', productSellAllPrice = '30.00', productSellUnitPrice = '30.00', productSellHalfPrice = '30.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00003',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '30',lastbuyprice_withDiscount = '30',meanbuyprice = '30',meanbuyprice_withDiscount = '30' , productbuypricereal = '30' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='30',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='30',meanbuyprice_withTax='30',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='30',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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:20:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:50:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:50:38', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=83
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:20:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:50:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:50:48', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=84
UPDATE product SET productName = 'prod33', productDescription = '', productCatId = '1', productBuyPrice = '30.00', productSellAllPrice = '30.00', productSellUnitPrice = '30.00', productSellHalfPrice = '30.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00003',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '30.00',lastbuyprice_withDiscount = '30',meanbuyprice = '30.00',meanbuyprice_withDiscount = '30' , productbuypricereal = '30.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='30',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='30',meanbuyprice_withTax='30',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='30',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';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (3, 1,'2025-12-09 01:51:19',1)
                ON DUPLICATE KEY UPDATE productid = 3, edited = 1, sysdate = '2025-12-09 01:51:19', userid = 1; -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:21:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:51:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:51:24', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=85
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:21:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:51:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:51:36', '1', 'edit', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=edit&id=3'); -- id=86
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:52:10', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php'); -- id=87
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:52:36', '1', 'add2', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=add2'); -- id=88
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('cat2','2025-12-09','','0', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=3
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (3, 1,'2025-12-09 01:52:42',1)
                ON DUPLICATE KEY UPDATE catid = 3, edited = 1, sysdate = '2025-12-09 01:52:42', userid = 1; -- id=4
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '3', '1', '2025-12-09', '1', '0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:52:42', '1', 'sucess', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=sucess'); -- id=89
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2025-12-09 01:52:49', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productCatController.php?do=show'); -- id=90
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:52:54', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=91
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:22:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:52:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:52:59', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=92
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:23:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 01:53:19", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 01:53:19', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=93
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:30:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:00:42", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:00:42', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=94
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:31:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:01:26", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:01:26', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=95
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:31:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:01:57", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:01:57', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php'); -- id=96
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:32:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:02:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:02:28', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=97
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('new prod1','','3','10','10','10','10','2025-12-09','0','1','0','','0','0','0','0','0','10','10','10','10','10','0','0','0','0','.','0','0','0','10','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','10','10','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','10','0','0','0','0','0','0','','','0','0','0','0'); -- id=4
UPDATE product SET productName = 'new prod1', productDescription = '', productCatId = '3', productBuyPrice = '10', productSellAllPrice = '10', productSellUnitPrice = '10', productSellHalfPrice = '10', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00004',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '10',lastbuyprice_withDiscount = '10',meanbuyprice = '10',meanbuyprice_withDiscount = '10' , productbuypricereal = '10' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='10',meanbuyprice_withTax='10',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='10',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';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '4', '1.00', '2025-12-09', '1', '0','0000401','10','10','10','10','','0','0','0','0','0','0','0','0','0','0'); -- id=4
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('4', '1', '0', '1', '2025-12-09'); -- id=4
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '0', '0', '4', 'إضافة منتج', 'productController.php', '0', '0', '1', '2025-12-09','0','0'); -- id=4
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (4, 1,'2025-12-09 02:02:34',1)
                ON DUPLICATE KEY UPDATE productid = 4, edited = 1, sysdate = '2025-12-09 02:02:34', userid = 1; -- id=4
UPDATE product SET productName = 'new prod1', productDescription = '', productCatId = '3', productBuyPrice = '10.00', productSellAllPrice = '10.00', productSellUnitPrice = '10.00', productSellHalfPrice = '10.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00004',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '10',lastbuyprice_withDiscount = '10',meanbuyprice = '10',meanbuyprice_withDiscount = '10' , productbuypricereal = '10' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='10',meanbuyprice_withTax='10',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='10',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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:36:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:06:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:06:19', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=98
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:36:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:06:28", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:06:28', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=99
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:37:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:07:14", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:07:14', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=100
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:47:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:17:38", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:17:38', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=101
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:47:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:17:45", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:17:45', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=102
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:48:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:18:49", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:18:49', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=103
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:48:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:18:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:18:55', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=104
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:49:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:19:00", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:19:00', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=105
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:49:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:19:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:19:06', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=106
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:49:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:19:11", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:19:11', '1', 'edit', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=edit&id=1'); -- id=107
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:51:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:21:00", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:21:00', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=108
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:54:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:24:33", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:24:33', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=109
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:55:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:25:35", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2025-12-09 02:25:35', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientPayedDeptController.php'); -- id=110
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:56:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:26:05", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2025-12-09 02:26:05', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientController.php'); -- id=111
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:56:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:26:21", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2025-12-09 02:26:21', '1', 'add', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientController.php?do=add'); -- id=112
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('hazem' , '', '', '', '0', '', '0', '2025-12-09 02:26:26', '1', '0','2','0','','-10','2','10000',',','-1','0','','0','0','.','2025-12-09','0','2','','0','0','0','','','0','0','','','','','','','','','','-1','','.','.','0','','','0','0',''); -- id=2
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('2', '0', '0', '', ''); -- id=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 ('2','0','0','0','إضافة عميل جديد','2', '0', '2025-12-09 02:26:26', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=1
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('hazem', 'hazem', 'hazem', 'hazem', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2025-12-09 02:26:26'); -- id=419
UPDATE client SET clientname = 'hazem', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2025-12-09', userid = '1'  , clientareaid = '0'  ,clientcode = '2',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '2' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='2' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='419',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='.',fileimg='.',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:56:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:26:40", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2025-12-09 02:26:40', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientController.php?do=show'); -- id=113
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:56:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:26:54", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:26:54', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=114
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:57:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:27:12", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2025-12-09 02:27:12', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientPayedDeptController.php'); -- id=115
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:57:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:27:55", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2025-12-09 02:27:55', '1', 'add', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientPayedDeptController.php?do=add'); -- id=116

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =2
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '-500' , clientdate = '2025-12-09 02:28:01', 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','0.00','500','1','ايصال تحصيل (( قبض من عميل ))','2', '-500', '2025-12-09 02:27:17', '1', 'clientPayedDeptController.php', '   ', '500', '0', null, '0', null, null,'', '-1','1','1','500','1','','1','0','','.'); -- id=2
UPDATE save SET  savecurrentvalue = '500',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('0.00','500', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '2', '500', '2025-12-09 02:28:02', '1',  'clientPayedDeptController.php','2','','0'); -- id=1
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500', '500', '2025-12-09', '1', '0', '0', '2025-12-09 02:28:02','اضافة ايصال سداد للعميل hazem','1','0','0','0','2','clientPayedDeptController.php?do=show&id=2'); -- id=1
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1', '383', '500', '','0'); -- id=1
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '500', 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 ('1', '419', '500', '','0'); -- id=1
UPDATE accountstree SET name = 'hazem', customName = 'hazem', customNameEn = 'hazem', nameEn = 'hazem', parent = '58', accountNature = '0', theValue = '-500', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2025-12-09 02:26:26' WHERE id = '419';
UPDATE clientdebtchange SET clientid = '2', clientdebtchangebefore = '0.000', clientdebtchangeamount = '500.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '2', clientdebtchangeafter = '-500.000', clientdebtchangedate = '2025-12-09 02:27:17', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '500.000',discount='', reciptid='0', dailyentryid = '1',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='500',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '2';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:58:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:28:07", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2025-12-09 02:28:07', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientPayedDeptController.php'); -- id=117
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:58:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:28:21", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:28:21', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=118
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 22:59:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:29:17", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:29:17', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=119
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:04:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:34:56", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:34:56', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=120
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:08:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:38:54", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:38:54', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=121
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:09:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:39:48", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:39:48', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=122
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:10:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:40:37", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:40:37', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=123
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:11:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:41:15", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:41:15', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=124
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:12:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:42:16", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:42:16', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=125
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:12:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:42:28", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:42:28', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/productController.php?do=show'); -- id=126
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:12:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:42:40", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:42:40', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=127
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:13:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:43:06", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:43:06', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=128
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:13:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:43:28", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:43:28', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=129
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:14:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:44:47", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:44:47', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=130
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:15:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:45:11", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2025-12-09 02:45:11', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/savedailyController.php'); -- id=131
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:15:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:45:23", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2025-12-09 02:45:23', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/clientReportsController.php'); -- id=132
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:15:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:45:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2025-12-09 02:45:36', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/clientReportsController.php'); -- id=133
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:16:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:46:31", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:46:31', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=134
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:17:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:47:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:47:41', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=135

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06937716ddd9e0
-- ----------------------------------------------------------------------------------------------------

CALL clientInUse(2,@clientdebt,@clientname,@treeIdis);
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:17:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:47:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:47:55', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=136
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:18:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:48:09", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:48:09', '1', 'show', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=137
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:18:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:48:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:48:49', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=show'); -- id=138
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:19:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:49:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:49:23', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=139
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:20:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:50:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:50:40', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=140
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:20:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:50:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:50:46', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=141
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:21:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:51:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:51:01', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=142
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:21:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:51:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:51:56', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=143
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:22:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:52:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:52:14', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=144

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0693772b336746
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:23:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:53:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:53:26', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=145
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:24:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:54:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:54:26', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=146

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06937730c0c900
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:24:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:54:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:54:39', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=147
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:24:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:54:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 02:54:44', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=148
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:24:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:54:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:54:49', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=149
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:24:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:54:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:54:54', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=150
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:25:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:55:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 02:55:00', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=151
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:25:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:55:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:55:21', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=152
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:25:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:55:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-09 02:55:50', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/productController.php?do=add'); -- id=153
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('prod10','','3','100','120','120','120','2025-12-09','0','1','0','','0','0','0','0','0','100','100','100','100','100','0','20','0','0','.','0','0','0','100','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','100','100','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','100','0','0','0','0','0','0','','','0','0','0','0'); -- id=5
UPDATE product SET productName = 'prod10', productDescription = '', productCatId = '3', productBuyPrice = '100', productSellAllPrice = '120', productSellUnitPrice = '120', productSellHalfPrice = '120', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00005',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '100',lastbuyprice_withDiscount = '100',meanbuyprice = '100',meanbuyprice_withDiscount = '100' , productbuypricereal = '100' , buypricereal_precentage = '0' , buytotal_precentage = '20' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='100',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='100',meanbuyprice_withTax='100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '5';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '5', '1.00', '2025-12-09', '1', '0','0000501','120','120','120','100','','0','0','0','0','0','0','0','0','0','0'); -- id=5
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('5', '1', '100', '1', '2025-12-09'); -- id=5
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '100', '0', '5', 'إضافة منتج', 'productController.php', '0', '100', '1', '2025-12-09','0','0'); -- id=5
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (5, 1,'2025-12-09 02:55:55',1)
                ON DUPLICATE KEY UPDATE productid = 5, edited = 1, sysdate = '2025-12-09 02:55:55', userid = 1; -- id=5
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10000', '10000', '2025-12-09', '1', '0', '0', '2025-12-09 02:55:55','إضافة منتج prod10 الكمية 100','1','0','0','0','5','productController.php?do=edit&id=5'); -- id=2
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2', '382', '10000', '','0'); -- id=2
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10000', 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 ('2', '121', '10000', '','0'); -- id=2
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '10000', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'prod10', productDescription = '', productCatId = '3', productBuyPrice = '100.00', productSellAllPrice = '120.00', productSellUnitPrice = '120.00', productSellHalfPrice = '120.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00005',type ='0', expireDate = '0' , dailyentryId = '2',isService = '0',isOptic = '0',lastbuyprice = '100',lastbuyprice_withDiscount = '100',meanbuyprice = '100',meanbuyprice_withDiscount = '100' , productbuypricereal = '100' , buypricereal_precentage = '0' , buytotal_precentage = '20' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='100',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='100',meanbuyprice_withTax='100',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '5';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:26:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:56:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:56:00', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=154
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:26:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:56:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:56:18', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=155

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0693773a61ef6a
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:26:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:56:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:56:38', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=156
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:26:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:56:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 02:56:57', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=157
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:27:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:57:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:57:05', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=158
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:27:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:57:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:57:13', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=159
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:27:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:57:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:57:39', '1', 'addsellBillManyParcodes', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBillManyParcodes'); -- id=160
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:27:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:57:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:57:55', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=161
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:28:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:58:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:58:35', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=162
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:29:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:59:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 02:59:08', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=163
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:29:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 02:59:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 02:59:45', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=164
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 < "2025-12-08 23:29:51";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 02:59:51', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=165
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:30:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:00:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:00:04', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=166
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:30:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:00:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:00:57', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=167
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:31:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:01:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:01:14', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=168

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0693774cf96e0a
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:01:19', '0693774cf96e0a', '1', '0.00', '0', '0', '1', '120.00', '120', '120', '0', '1', '2025-12-09 03:01:19', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','120','0','','0','0','120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=1
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','اضافة فاتورة مبيعات','1', '0', '2025-12-09 03:01:19', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '120', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:01:19','0','0','',''); -- id=3
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 ('100','00005', '1', '3', '5', '1', '120', '120', '0', '', '0', '2025-12-09 03:01:19', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','120','120','0','','0','0.00','0','0','0','0'); -- id=1
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 5)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 5 ;
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where sellbilldetailid = 5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:32:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:02:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2025-12-09 03:02:59', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/supplierController.php'); -- id=169
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:33:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:03:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:03:50', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=170
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:34:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:04:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:04:20', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=171

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06937757bc792d
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:04:26', '06937757bc792d', '1', '0.00', '0', '0', '1', '120.00', '120', '120', '0', '1', '2025-12-09 03:04:26', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','120','0','','0','0','120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=2
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','اضافة فاتورة مبيعات','2', '0', '2025-12-09 03:04:26', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '120', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:04:26','0','0','',''); -- id=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 ('100','00005', '2', '3', '5', '1', '120', '120', '0', '', '0', '2025-12-09 03:04:26', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','120','120','0','','0','0.00','0','0','0','0'); -- id=2
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 5)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 5 ;
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where sellbilldetailid = 5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:34:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:04:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:04:33', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=172
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:34:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:04:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:04:51', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=173
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:35:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:05:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:05:01', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=174
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:36:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:06:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:06:12', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=175
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:36:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:06:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:06:28', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=176

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06937760a3f72f
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:06:33', '06937760a3f72f', '1', '0.00', '0', '0', '1', '120.00', '120', '120', '0', '1', '2025-12-09 03:06:33', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','120','0','','0','0','120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=3
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','اضافة فاتورة مبيعات','3', '0', '2025-12-09 03:06:33', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '120', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:06:33','0','0','',''); -- id=5
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('100','00005', '3', '3', '5', '1', '120', '120', '0', '', '0', '2025-12-09 03:06:33', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','120','120','0','','0','0.00','0','0','0','0'); -- id=3
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 5)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 5 ;
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where sellbilldetailid = 5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:37:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:07:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:07:02', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=177
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:37:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:07:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2025-12-09 03:07:11', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/clientReportsController.php'); -- id=178
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:37:17";
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:42:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:12:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:12:36', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=179
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:43:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:13:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:13:18', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=180
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:43:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:13:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:13:55', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=181
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:44:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:14:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:14:18', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=182
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:44:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:14:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:14:35', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=183
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:45:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:15:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2025-12-09 03:15:13', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/profitreportController.php'); -- id=184
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:45:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:15:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:15:32', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=185
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:46:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:16:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:16:01', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=186
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:46:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:16:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:16:18', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=187
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:48:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:18:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:18:35', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=188

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06937786855e12
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:18:41', '06937786855e12', '1', '0.00', '0', '0', '1', '10.00', '10', '10', '0', '1', '2025-12-09 03:18:41', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','10','0','','0','0','10','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=4
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','اضافة فاتورة مبيعات','4', '0', '2025-12-09 03:18:41', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:18:41','0','0','',''); -- id=6
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','00001', '4', '1', '1', '1', '10', '10', '0', '', '0', '2025-12-09 03:18:41', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=4
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 1)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 1 ;
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 = 1;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2025-12-09', 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, '2025-12-09', 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;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '1', '1', '4', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:18:41','0','0'); -- id=6
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '510',  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 ('500','10', '0', '1', 'اضافة فاتورة مبيعات', '4', '510', '2025-12-09 03:18:41', '1',  'sellbillController.php','1','','0'); -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:48:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:18:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:18:55', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=189
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:49:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:19:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:19:05', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=190
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:50:57";
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 < "2025-12-08 23:51:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:21:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 03:21:16', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=191
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 < "2025-12-08 23:51:22";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 03:21:22', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=192
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:52:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:22:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:22:01', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=193
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:52:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:22:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:22:20', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=194

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0693779bf6168c
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:22:26', '0693779bf6168c', '1', '0.00', '0', '0', '1', '120.00', '120', '120', '0', '1', '2025-12-09 03:22:26', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','120','0','','0','0','120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=5
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','اضافة فاتورة مبيعات','5', '0', '2025-12-09 03:22:26', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '120', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:22:26','0','0','',''); -- id=7
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 ('100','00005', '5', '3', '5', '1', '120', '120', '0', '', '0', '2025-12-09 03:22:26', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','120','120','0','','0','0.00','0','0','0','0'); -- id=5
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 5)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 5 ;
UPDATE sellbilldetail SET  lastbuyprice = 100.00 , meanbuyprice = 100.00, lastbuyprice_withDiscount = 100.00, meanbuyprice_withDiscount = 100.00
        , lastbuyprice_withTax = 100, meanbuyprice_withTax = 100, lastbuyprice_withDiscountAndTax = 100
                where sellbilldetailid = 5;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2025-12-09', 120, -100, -100
                    , -100, -100, -100, -100
                    , 0, 0, 0, 0
                    , 0, 0, 0, -1, 0, -100, -100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+-100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+-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, '2025-12-09', 120, -100, -100
                    , -100, -100, -100, -100
                    , 0, 0, 0, 0
                    , 0, 0, 0, -100, -100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+120, sellCostBuyPrice =sellCostBuyPrice+-100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '1', '1', '5', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:22:26','0','0'); -- id=7
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '630',  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 ('510','120', '0', '1', 'اضافة فاتورة مبيعات', '5', '630', '2025-12-09 03:22:26', '1',  'sellbillController.php','1','','0'); -- id=3
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '120', '120', '2025-12-09', '1', '0', '0', '2025-12-09 03:22:26','اضافة فاتورة مبيعات رقم 5','1','0',null,'0','5','sellbillController.php?do=showDetail&sellbillid=5'); -- id=3
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3', '383', '120', '','0'); -- id=3
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '620', 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 ('3', '143', '120', '','0'); -- id=3
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '120', 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 ( '-100', '-100', '2025-12-09', '1', '0', '0', '2025-12-09 03:22:26','اضافة فاتورة مبيعات رقم 5 - صرف البضاعة من المخزن','1','0',null,'0','5','sellbillController.php?do=showDetail&sellbillid=5'); -- id=4
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4', '402', '-100', '','0'); -- id=4
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-100', 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 ('4', '382', '-100', '','0'); -- id=4
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10100', 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='3,0,4' where sellbillid=5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:53:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:23:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:23:08', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=195
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:53:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:23:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:23:22', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=196

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 069377a0207794
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:23:28', '069377a0207794', '1', '0.00', '0', '0', '1', '30.00', '30', '30', '0', '1', '2025-12-09 03:23:28', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','30','0','','0','0','30','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=6
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','اضافة فاتورة مبيعات','6', '0', '2025-12-09 03:23:28', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '30', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:23:28','0','0','',''); -- id=8
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('30','00003', '6', '1', '3', '1', '30', '30', '0', '', '0', '2025-12-09 03:23:28', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','30','30','0','','0','0.00','0','0','0','0'); -- id=6
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 3)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 3 ;
UPDATE sellbilldetail SET  lastbuyprice = 30.00 , meanbuyprice = 30.00, lastbuyprice_withDiscount = 30.00, meanbuyprice_withDiscount = 30.00
        , lastbuyprice_withTax = 30, meanbuyprice_withTax = 30, lastbuyprice_withDiscountAndTax = 30
                where sellbilldetailid = 3;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0, -1, 0, -30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+-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, '2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0, -30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '1', '1', '6', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:23:28','0','0'); -- id=8
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '660',  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 ('630','30', '0', '1', 'اضافة فاتورة مبيعات', '6', '660', '2025-12-09 03:23:28', '1',  'sellbillController.php','1','','0'); -- id=4
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30', '30', '2025-12-09', '1', '0', '0', '2025-12-09 03:23:28','اضافة فاتورة مبيعات رقم 6','1','0',null,'0','6','sellbillController.php?do=showDetail&sellbillid=6'); -- id=5
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('5', '383', '30', '','0'); -- id=5
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '650', 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 ('5', '143', '30', '','0'); -- id=5
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '150', 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 ( '-30', '-30', '2025-12-09', '1', '0', '0', '2025-12-09 03:23:28','اضافة فاتورة مبيعات رقم 6 - صرف البضاعة من المخزن','1','0',null,'0','6','sellbillController.php?do=showDetail&sellbillid=6'); -- id=6
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6', '402', '-30', '','0'); -- id=6
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-130', 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 ('6', '382', '-30', '','0'); -- id=6
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10130', 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='5,0,6' where sellbillid=6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:56:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:26:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:26:40', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=197

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 069377a0207794
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:26:49', '069377a0207794', '1', '0.00', '0', '0', '1', '30.00', '30', '30', '0', '1', '2025-12-09 03:26:49', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','30','0','','0','0','30','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=7
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','اضافة فاتورة مبيعات','7', '0', '2025-12-09 03:26:49', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '30', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:26:49','0','0','',''); -- id=9
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('30','00003', '7', '1', '3', '1', '30', '30', '0', '', '0', '2025-12-09 03:26:49', '3', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','30','30','0','','0','0.00','0','0','0','0'); -- id=7
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 3)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 3 ;
UPDATE sellbilldetail SET  lastbuyprice = 30.00 , meanbuyprice = 30.00, lastbuyprice_withDiscount = 30.00, meanbuyprice_withDiscount = 30.00
        , lastbuyprice_withTax = 30, meanbuyprice_withTax = 30, lastbuyprice_withDiscountAndTax = 30
                where sellbilldetailid = 3;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (3, '2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0, -1, 0, -30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+-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, '2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0, -30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '1', '1', '7', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:26:49','0','0'); -- id=9
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '690',  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 ('660','30', '0', '1', 'اضافة فاتورة مبيعات', '7', '690', '2025-12-09 03:26:49', '1',  'sellbillController.php','1','','0'); -- id=5
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30', '30', '2025-12-09', '1', '0', '0', '2025-12-09 03:26:49','اضافة فاتورة مبيعات رقم 7','1','0',null,'0','7','sellbillController.php?do=showDetail&sellbillid=7'); -- id=7
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('7', '383', '30', '','0'); -- id=7
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '680', 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 ('7', '143', '30', '','0'); -- id=7
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '180', 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 ( '-30', '-30', '2025-12-09', '1', '0', '0', '2025-12-09 03:26:49','اضافة فاتورة مبيعات رقم 7 - صرف البضاعة من المخزن','1','0',null,'0','7','sellbillController.php?do=showDetail&sellbillid=7'); -- id=8
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8', '402', '-30', '','0'); -- id=8
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-160', 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 ('8', '382', '-30', '','0'); -- id=8
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10160', 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='7,0,8' where sellbillid=7;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,-30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 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, '2025-12-09', 30, -30, -30
                    , -30, -30, -30, -30
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,-30, -30, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30, sellCostBuyPrice =sellCostBuyPrice+-30
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-30, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-30
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-30, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-30
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-30
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-30
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-30
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 30, -30, -30
                    , -30, -30, -30, -30, -30, -30)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+30, netSellCostBuyPrice = netSellCostBuyPrice+-30
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-30
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-30
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-30
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-30
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-30
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-30
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-30;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:56:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:26:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:26:58', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=198
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:57:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:27:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:27:14', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=199

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 069377ae8a8c89
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:27:20', '069377ae8a8c89', '1', '0.00', '0', '0', '1', '20.00', '20', '20', '0', '1', '2025-12-09 03:27:20', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','20','0','','0','0','20','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=8
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','اضافة فاتورة مبيعات','8', '0', '2025-12-09 03:27:20', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '20', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:27:20','0','0','',''); -- id=10
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('20','00002', '8', '1', '2', '1', '20', '20', '0', '', '0', '2025-12-09 03:27:20', '2', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','20','20','0','','0','0.00','0','0','0','0'); -- id=8
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 2)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 2 ;
UPDATE sellbilldetail SET  lastbuyprice = 20.00 , meanbuyprice = 20.00, lastbuyprice_withDiscount = 20.00, meanbuyprice_withDiscount = 20.00
        , lastbuyprice_withTax = 20, meanbuyprice_withTax = 20, lastbuyprice_withDiscountAndTax = 20
                where sellbilldetailid = 2;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2025-12-09', 20, -20, -20
                    , -20, -20, -20, -20
                    , 0, 0, 0, 0
                    , 0, 0, 0, -1, 0, -20, -20, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+-20
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-20, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-20
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-20, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-20
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-20
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-20
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-20
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, '2025-12-09', 20, -20, -20
                    , -20, -20, -20, -20
                    , 0, 0, 0, 0
                    , 0, 0, 0, -20, -20, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+-20
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-20, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-20
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-20, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-20
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-20
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-20
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-20
                        , returnSellVal = returnSellVal+0, 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 storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2', '1', '1', '1', '8', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:27:20','0','0'); -- id=10
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '710',  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 ('690','20', '0', '1', 'اضافة فاتورة مبيعات', '8', '710', '2025-12-09 03:27:20', '1',  'sellbillController.php','1','','0'); -- id=6
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20', '20', '2025-12-09', '1', '0', '0', '2025-12-09 03:27:20','اضافة فاتورة مبيعات رقم 8','1','0',null,'0','8','sellbillController.php?do=showDetail&sellbillid=8'); -- id=9
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('9', '383', '20', '','0'); -- id=9
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '700', 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 ('9', '143', '20', '','0'); -- id=9
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '200', 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 ( '-20', '-20', '2025-12-09', '1', '0', '0', '2025-12-09 03:27:20','اضافة فاتورة مبيعات رقم 8 - صرف البضاعة من المخزن','1','0',null,'0','8','sellbillController.php?do=showDetail&sellbillid=8'); -- id=10
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('10', '402', '-20', '','0'); -- id=10
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-180', 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 ('10', '382', '-20', '','0'); -- id=10
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10180', 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='9,0,10' where sellbillid=8;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2025-12-09', 20, -20, -20
                    , -20, -20, -20, -20
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,-20, -20, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+-20
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-20, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-20
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-20, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-20
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-20
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-20
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-20
                        , returnSellVal = returnSellVal+0, 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, '2025-12-09', 20, -20, -20
                    , -20, -20, -20, -20
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,-20, -20, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20, sellCostBuyPrice =sellCostBuyPrice+-20
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+-20, sellCostMeanBuyPrice = sellCostMeanBuyPrice+-20
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+-20, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+-20
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+-20
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+-20
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+-20
                        , returnSellVal = returnSellVal+0, 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, 20, -20, -20
                    , -20, -20, -20, -20, -20, -20)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+20, netSellCostBuyPrice = netSellCostBuyPrice+-20
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-20
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-20
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-20
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-20
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-20
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-20
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-20;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:57:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:27:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:27:32', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=200
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:57:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:27:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:27:40', '1', 'showDetail', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=showDetail&sellbillid=8'); -- id=201
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:57:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:27:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:27:50', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=202
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:58:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:28:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:28:06', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=203
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:58:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:28:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:28:27', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=204
BEGIN;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:59:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:29:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:29:11', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=205
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:59:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:29:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:29:26', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=206

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 069377b6d08111
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:29:32', '069377b6d08111', '1', '0.00', '0', '0', '1', '10.00', '10', '10', '0', '1', '2025-12-09 03:29:32', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','10','0','','0','0','10','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=9
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','اضافة فاتورة مبيعات','9', '0', '2025-12-09 03:29:32', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:29:32','0','0','',''); -- id=11
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('10','00001', '9', '1', '1', '1', '10', '10', '0', '', '0', '2025-12-09 03:29:32', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=9
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 1)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 1 ;
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 = 1;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2025-12-09', 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, '2025-12-09', 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;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '1', '1', '9', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:29:32','0','0'); -- id=11
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '720',  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 ('710','10', '0', '1', 'اضافة فاتورة مبيعات', '9', '720', '2025-12-09 03:29:32', '1',  'sellbillController.php','1','','0'); -- id=7
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10', '10', '2025-12-09', '1', '0', '0', '2025-12-09 03:29:32','اضافة فاتورة مبيعات رقم 9','1','0',null,'0','9','sellbillController.php?do=showDetail&sellbillid=9'); -- id=11
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11', '383', '10', '','0'); -- id=11
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '710', 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 ('11', '143', '10', '','0'); -- id=11
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '210', 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 ( '-10', '-10', '2025-12-09', '1', '0', '0', '2025-12-09 03:29:32','اضافة فاتورة مبيعات رقم 9 - صرف البضاعة من المخزن','1','0',null,'0','9','sellbillController.php?do=showDetail&sellbillid=9'); -- id=12
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('12', '402', '-10', '','0'); -- id=12
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-190', 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 ('12', '382', '-10', '','0'); -- id=12
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10190', 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='11,0,12' where sellbillid=9;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2025-12-09', 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;
 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, '2025-12-09', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 10, -10, -10
                    , -10, -10, -10, -10, -10, -10)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10, netSellCostBuyPrice = netSellCostBuyPrice+-10
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-10
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-10
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-10
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-10
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-10
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-10
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-10;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 069377b6d08111 and sellbillId = 9 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:59:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:29:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:29:32', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=207
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-08 23:59:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:29:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:29:40', '1', 'showDetail', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=showDetail&sellbillid=9'); -- id=208
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:00:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:30:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:30:17', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=209
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:00:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:30:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:30:26', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=210
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:00:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:30:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:30:52', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=211
BEGIN;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:01:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:31:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:31:41', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=212
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 ('069377bb749a34', '2025-12-09 03:30:31', '1', '0.00', '0', '0', '0', '1000.00',  '1000', '1000', '0', '1', '2025-12-09 03:31:49', '', '1', '0', '', '1','1','1','0','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=1
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', '1', '1', '1', '100', '10', '1000.00', '0', '', '2025-12-09 03:31:49', '1','','','0','0','0','0','0',null,'10','1000','0','0','0','0','0','0','0','0','1'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:02:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:32:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:32:19', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=213
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 ('069377bb749a34', '2025-12-09 03:30:31', '1', '0.00', '0', '0', '0', '1000.00',  '1000', '1000', '0', '1', '2025-12-09 03:32:24', '', '1', '0', '', '1','1','1','0','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=2
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', '2', '1', '1', '100', '10', '1000.00', '0', '', '2025-12-09 03:32:24', '1','','','0','0','0','0','0',null,'10','1000','0','0','0','0','0','0','0','0','1'); -- id=2
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2025-12-09 03:30:31', 1, 1, 0, 0
                    , 10, 100, 0, 0, 1, '2025-12-09 03:32:24')
                ON DUPLICATE KEY UPDATE buyprice = 10,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2025-12-09 03:32:24' ; -- id=1
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1', '10', '100', '0', 'buyBillController.php', '2', '', '0', '0'); -- id=1
UPDATE product SET  productBuyPrice = "10" WHERE productId = 1 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 2 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:02:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:32:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:32:40', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=show'); -- id=214
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:02:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:32:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:32:54', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=215
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:03:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:33:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:33:12', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php'); -- id=216
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:03:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:33:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('balancereportController.php', '2025-12-09 03:33:18', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/balancereportController.php'); -- id=217
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:04:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:34:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:34:04', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php'); -- id=218
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:05:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:35:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:35:08', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php?do=show'); -- id=219
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:05:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:35:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:35:27', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php?do=show'); -- id=220
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:05:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:35:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:35:38', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php?do=show'); -- id=221
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:05:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:35:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-09 03:35:53', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php?do=show'); -- id=222
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:06:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:36:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:36:07', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=223
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:06:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:36:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:36:41', '1', 'add', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=add'); -- id=224
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 ('069377d0c6dfb8', '2025-12-09 03:36:12', '1', '0.00', '0', '0', '0', '50.00',  '50', '50', '0', '1', '2025-12-09 03:36:49', '', '1', '0', '', '1','1','1','0','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=3
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', '3', '1', '1', '5', '10', '50.00', '0', '', '2025-12-09 03:36:49', '1','','','0','0','0','0','0',null,'10','50','0','0','0','0','0','0','0','0','1'); -- id=3
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2025-12-09 03:36:12', 1, 1, 0, 0
                    , 10, 5, 0, 0, 1, '2025-12-09 03:36:49')
                ON DUPLICATE KEY UPDATE buyprice = 10,
                        buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2025-12-09 03:36:49' ; -- id=1
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1', '10', '5', '0', 'buyBillController.php', '3', '', '0', '0'); -- id=2
UPDATE product SET  productBuyPrice = "10" WHERE productId = 1 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 3 ;
UPDATE product SET productName = 'prod1', productDescription = '', productCatId = '1', productBuyPrice = '10.00', productSellAllPrice = '10.00', productSellUnitPrice = '10.00', productSellHalfPrice = '10.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00001',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '10',lastbuyprice_withDiscount = '10',meanbuyprice = '10',meanbuyprice_withDiscount = '10' , productbuypricereal = '10.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='10',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',meanbuyprice_withTax='10',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='10',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 = 10 , meanbuyprice = 10, lastbuyprice_withDiscount = 10, meanbuyprice_withDiscount = 10
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10, lastbuyprice_withDiscountAndTax = 10
                where buybilldetailid = 3;
UPDATE productunit SET proUnitBuyPrice  = 10 * productnumber WHERE productid = 1;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2025-12-09' WHERE storedetailid = '1';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '5', '0', '3', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '5', '1', '2025-12-09 03:36:12','0','0'); -- id=12
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:06:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:36:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:36:58', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=show'); -- id=225
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:07:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:37:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:37:04', '1', 'show', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=show'); -- id=226
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:07:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:37:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:37:13', '1', 'details', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=details&id=3'); -- id=227
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:07:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:37:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:37:43', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=228
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:08:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:38:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:38:13', '1', 'addAndRetuen', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addAndRetuen'); -- id=229

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 069377d6db8907
-- ----------------------------------------------------------------------------------------------------

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 ('2025-12-09 03:38:18', '069377d6db8907', '1', '0.00', '0', '0', '1', '10.00', '10', '10', '0', '1', '2025-12-09 03:38:18', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','10','0','','0','0','10','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-09','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=10
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','اضافة فاتورة مبيعات','10', '0', '2025-12-09 03:38:18', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-09 03:38:18','0','0','',''); -- id=12
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 1;
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','00001', '10', '1', '1', '1', '10', '10', '0', '', '0', '2025-12-09 03:38:18', '1', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1-1,','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=10
UPDATE storedetail SET productquantity = (select sum(`quantity`) from sizecolorstoredetail where `storeid` = 1 and `productid` = 1)
                , userid = 1, storedetaildate = "2025-12-09" WHERE  unittype = 0 and storedetailid = 1 ;
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 = 1;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2025-12-09', 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, '2025-12-09', 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;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '1', '1', '10', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '1', '2025-12-09 03:38:18','0','0'); -- id=13
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '730',  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 ('720','10', '0', '1', 'اضافة فاتورة مبيعات', '10', '730', '2025-12-09 03:38:18', '1',  'sellbillController.php','1','','0'); -- id=8
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10', '10', '2025-12-09', '1', '0', '0', '2025-12-09 03:38:18','اضافة فاتورة مبيعات رقم 10','1','0',null,'0','10','sellbillController.php?do=showDetail&sellbillid=10'); -- id=13
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('13', '383', '10', '','0'); -- id=13
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '720', 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 ('13', '143', '10', '','0'); -- id=13
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '220', 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 ( '-10', '-10', '2025-12-09', '1', '0', '0', '2025-12-09 03:38:18','اضافة فاتورة مبيعات رقم 10 - صرف البضاعة من المخزن','1','0',null,'0','10','sellbillController.php?do=showDetail&sellbillid=10'); -- id=14
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('14', '402', '-10', '','0'); -- id=14
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-200', 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 ('14', '382', '-10', '','0'); -- id=14
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10200', 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='13,0,14' where sellbillid=10;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2025-12-09', 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;
 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, '2025-12-09', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 10, -10, -10
                    , -10, -10, -10, -10, -10, -10)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10, netSellCostBuyPrice = netSellCostBuyPrice+-10
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-10
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-10
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-10
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-10
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-10
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-10
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-10;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 069377d6db8907 and sellbillId = 10 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:08:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:38:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:38:18', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=230
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:10:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:40:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 03:40:41', '1', '', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=231
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 < "2025-12-09 00:10:46";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 03:40:46', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=232
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:11:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:41:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:41:31', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=233
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:11:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:41:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:41:51', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=234
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:14:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:44:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-09 03:44:32', '1', 'bill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=235
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:14:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:44:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:44:49', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=236
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:15:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:45:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:45:29', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=237
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:15:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 03:45:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 03:45:37', '1', 'addsellBill', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=238
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 < "2025-12-09 00:39:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 04:09:12", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-09 04:09:12', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/index.php'); -- id=239
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 < "2025-12-09 00:39:18";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-09 04:09:18', '1', 'handleExpiredCards', '127.0.0.1', '', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=240
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:39:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 04:09:35", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-09 04:09:35', '1', 'addsellBill', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=241
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-09 00:40:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-09 04:10:24", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2025-12-09 04:10:24', '1', '', '127.0.0.1', '', 'MOBILE','https://localhost/erp19/controllers/salesreport.php'); -- id=242
